diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/animation/anim_channels_edit.c | 70 | ||||
-rw-r--r-- | source/blender/editors/space_buttons/buttons_texture.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_nla/nla_channels.c | 2 |
3 files changed, 38 insertions, 36 deletions
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index e705d0268e3..580cfaa48c7 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -2685,46 +2685,48 @@ static int mouse_anim_channels(bContext *C, bAnimContext *ac, int channel_index, bDopeSheet *ads = (bDopeSheet *)ac->data; Scene *sce = (Scene *)ads->source; SceneLayer *scene_layer = ac->scene_layer; - BaseLegacy *base = (BaseLegacy *)ale->data; + Base *base = (Base *)ale->data; Object *ob = base->object; AnimData *adt = ob->adt; /* set selection status */ - if (selectmode == SELECT_INVERT) { - /* swap select */ - ED_object_base_select(base, BA_INVERT); - BKE_scene_object_base_flag_sync_from_base(base); - - if (adt) adt->flag ^= ADT_UI_SELECTED; - } - else { - Base *b; - - /* deselect all */ - /* TODO: should this deselect all other types of channels too? */ - for (b = scene_layer->object_bases.first; b; b = b->next) { - ED_object_base_select(b, BA_DESELECT); - BKE_scene_object_base_flag_sync_from_base(b); - if (b->object->adt) b->object->adt->flag &= ~(ADT_UI_SELECTED | ADT_UI_ACTIVE); + if (base->flag & BASE_SELECTABLED) { + if (selectmode == SELECT_INVERT) { + /* swap select */ + ED_object_base_select(base, BA_INVERT); + BKE_scene_object_base_flag_sync_from_base(base); + + if (adt) adt->flag ^= ADT_UI_SELECTED; } - - /* select object now */ - ED_object_base_select(base, BA_SELECT); - BKE_scene_object_base_flag_sync_from_base(base); - if (adt) adt->flag |= ADT_UI_SELECTED; + else { + Base *b; + + /* deselect all */ + /* TODO: should this deselect all other types of channels too? */ + for (b = scene_layer->object_bases.first; b; b = b->next) { + ED_object_base_select(b, BA_DESELECT); + BKE_scene_object_base_flag_sync_from_base(b); + if (b->object->adt) b->object->adt->flag &= ~(ADT_UI_SELECTED | ADT_UI_ACTIVE); + } + + /* select object now */ + ED_object_base_select(base, BA_SELECT); + BKE_scene_object_base_flag_sync_from_base(base); + if (adt) adt->flag |= ADT_UI_SELECTED; + } + + /* change active object - regardless of whether it is now selected [T37883] */ + ED_object_base_activate(C, base); /* adds notifier */ + + if ((adt) && (adt->flag & ADT_UI_SELECTED)) + adt->flag |= ADT_UI_ACTIVE; + + /* ensure we exit editmode on whatever object was active before to avoid getting stuck there - T48747 */ + if (ob != sce->obedit) + ED_object_editmode_exit(C, EM_FREEDATA | EM_FREEUNDO | EM_WAITCURSOR | EM_DO_UNDO); + + notifierFlags |= (ND_ANIMCHAN | NA_SELECTED); } - - /* change active object - regardless of whether it is now selected [T37883] */ - ED_object_base_activate(C, base); /* adds notifier */ - - if ((adt) && (adt->flag & ADT_UI_SELECTED)) - adt->flag |= ADT_UI_ACTIVE; - - /* ensure we exit editmode on whatever object was active before to avoid getting stuck there - T48747 */ - if (ob != sce->obedit) - ED_object_editmode_exit(C, EM_FREEDATA | EM_FREEUNDO | EM_WAITCURSOR | EM_DO_UNDO); - - notifierFlags |= (ND_ANIMCHAN | NA_SELECTED); break; } case ANIMTYPE_FILLACTD: /* Action Expander */ diff --git a/source/blender/editors/space_buttons/buttons_texture.c b/source/blender/editors/space_buttons/buttons_texture.c index 1d67ac620b0..e3d72ba67d8 100644 --- a/source/blender/editors/space_buttons/buttons_texture.c +++ b/source/blender/editors/space_buttons/buttons_texture.c @@ -350,7 +350,7 @@ static void buttons_texture_users_from_context(ListBase *users, const bContext * if (!scene) scene = CTX_data_scene(C); - if (!(pinid || pinid == &scene->id)) { + if (!pinid || GS(pinid->name) == ID_SCE) { ob = (scene->basact) ? scene->basact->object : NULL; wrld = scene->world; brush = BKE_paint_brush(BKE_paint_get_active_from_context(C)); diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index c1c9326b4ef..fc8c4b51635 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -129,7 +129,7 @@ static int mouse_nla_channels(bContext *C, bAnimContext *ac, float x, int channe Object *ob = base->object; AnimData *adt = ob->adt; - if (nlaedit_is_tweakmode_on(ac) == 0) { + if (nlaedit_is_tweakmode_on(ac) == 0 && (base->flag & BASE_SELECTABLED)) { /* set selection status */ if (selectmode == SELECT_INVERT) { /* swap select */ |