Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_nla/nla_select.c
| Show First 20 Lines • Show All 606 Lines • ▼ Show 20 Lines | static int mouse_nla_strips(bContext *C, | ||||
| Scene *scene = ac->scene; | Scene *scene = ac->scene; | ||||
| bAnimListElem *ale = NULL; | bAnimListElem *ale = NULL; | ||||
| NlaStrip *strip = NULL; | NlaStrip *strip = NULL; | ||||
| int ret_value = OPERATOR_FINISHED; | int ret_value = OPERATOR_FINISHED; | ||||
| nlaedit_strip_at_region_position(ac, mval[0], mval[1], &ale, &strip); | nlaedit_strip_at_region_position(ac, mval[0], mval[1], &ale, &strip); | ||||
| int was_nla_tweak_on = scene->flag & SCE_NLA_EDIT_ON; | |||||
| /* if currently in tweakmode, exit tweakmode before changing selection states | /* if currently in tweakmode, exit tweakmode before changing selection states | ||||
| * now that we've found our target... | * now that we've found our target... | ||||
| */ | */ | ||||
| if (scene->flag & SCE_NLA_EDIT_ON) { | if (was_nla_tweak_on) { | ||||
| WM_operator_name_call(C, "NLA_OT_tweakmode_exit", WM_OP_EXEC_DEFAULT, NULL); | WM_operator_name_call(C, "NLA_OT_tweakmode_exit", WM_OP_EXEC_DEFAULT, NULL); | ||||
| } | } | ||||
| if (select_mode != SELECT_REPLACE) { | if (select_mode != SELECT_REPLACE) { | ||||
| wait_to_deselect_others = false; | wait_to_deselect_others = false; | ||||
| } | } | ||||
| /* For replacing selection, if we have something to select, we have to clear existing selection. | /* For replacing selection, if we have something to select, we have to clear existing selection. | ||||
| Show All 34 Lines | if (strip != NULL) { | ||||
| /* Highlight NLA-Track */ | /* Highlight NLA-Track */ | ||||
| if (ale->type == ANIMTYPE_NLATRACK) { | if (ale->type == ANIMTYPE_NLATRACK) { | ||||
| NlaTrack *nlt = (NlaTrack *)ale->data; | NlaTrack *nlt = (NlaTrack *)ale->data; | ||||
| nlt->flag |= NLATRACK_SELECTED; | nlt->flag |= NLATRACK_SELECTED; | ||||
| int filter = ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | | int filter = ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | | ||||
| ANIMFILTER_LIST_CHANNELS; | ANIMFILTER_LIST_CHANNELS; | ||||
| ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, nlt, ANIMTYPE_NLATRACK); | ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, nlt, ANIMTYPE_NLATRACK); | ||||
| if (was_nla_tweak_on && (strip->type == NLASTRIP_TYPE_CLIP)) { | |||||
| WM_operator_name_call(C, "NLA_OT_tweakmode_enter", WM_OP_EXEC_DEFAULT, NULL); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* free this channel */ | /* free this channel */ | ||||
| MEM_freeN(ale); | MEM_freeN(ale); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines | |||||