diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-11-08 17:16:49 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-11-08 23:39:01 +0300 |
commit | 206c94fea98d44ed9667607638c455c7c0e63822 (patch) | |
tree | ddc1f6f30c18d10674daaeeaee6b465550447709 /source/blender/editors/animation/anim_channels_edit.c | |
parent | 670e6cab4319b94c96c6a61cb76199f1054b935a (diff) |
Farewell Scene->base
While getting rid of Scene->base we got the following fixes:
* Fix "Convert To" operator
* Fix "NLA allowing to selected objects that are not selectable
* Fix scene.objects (readonly, no option to link/unlink)
Note: Collada needs to use the context SceneLayer for adding objects
however I added a placeholder, so Collada maintainers can fix this
properly.
Diffstat (limited to 'source/blender/editors/animation/anim_channels_edit.c')
-rw-r--r-- | source/blender/editors/animation/anim_channels_edit.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 26ba61f0f20..e705d0268e3 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -2684,6 +2684,7 @@ 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; Object *ob = base->object; AnimData *adt = ob->adt; @@ -2691,30 +2692,30 @@ static int mouse_anim_channels(bContext *C, bAnimContext *ac, int channel_index, /* set selection status */ if (selectmode == SELECT_INVERT) { /* swap select */ - base->flag_legacy ^= SELECT; - BKE_scene_base_flag_sync_from_base(base); + ED_object_base_select(base, BA_INVERT); + BKE_scene_object_base_flag_sync_from_base(base); if (adt) adt->flag ^= ADT_UI_SELECTED; } else { - BaseLegacy *b; + Base *b; /* deselect all */ /* TODO: should this deselect all other types of channels too? */ - for (b = sce->base.first; b; b = b->next) { - b->flag_legacy &= ~SELECT; - BKE_scene_base_flag_sync_from_base(b); + 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 */ - base->flag_legacy |= SELECT; - ob->flag |= SELECT; + 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_base_object_activate(C, base); /* adds notifier */ + ED_object_base_activate(C, base); /* adds notifier */ if ((adt) && (adt->flag & ADT_UI_SELECTED)) adt->flag |= ADT_UI_ACTIVE; |