diff options
Diffstat (limited to 'source/blender/editors/animation/anim_channels_edit.c')
-rw-r--r-- | source/blender/editors/animation/anim_channels_edit.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 82f24c91df1..0db465e583b 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -50,13 +50,15 @@ #include "BKE_animsys.h" #include "BKE_action.h" -#include "BKE_depsgraph.h" #include "BKE_fcurve.h" #include "BKE_gpencil.h" #include "BKE_context.h" +#include "BKE_library.h" #include "BKE_mask.h" #include "BKE_global.h" -#include "BKE_library.h" +#include "BKE_scene.h" + +#include "DEG_depsgraph_build.h" #include "UI_view2d.h" @@ -1720,7 +1722,7 @@ static int animchannels_delete_exec(bContext *C, wmOperator *UNUSED(op)) /* send notifier that things have changed */ WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); - DAG_relations_tag_update(CTX_data_main(C)); + DEG_relations_tag_update(CTX_data_main(C)); return OPERATOR_FINISHED; } @@ -2682,16 +2684,17 @@ static int mouse_anim_channels(bContext *C, bAnimContext *ac, int channel_index, { bDopeSheet *ads = (bDopeSheet *)ac->data; Scene *sce = (Scene *)ads->source; + ViewLayer *view_layer = ac->view_layer; Base *base = (Base *)ale->data; Object *ob = base->object; AnimData *adt = ob->adt; /* set selection status */ - if ((ob->restrictflag & OB_RESTRICT_SELECT) == 0) { + if (base->flag & BASE_SELECTABLED) { if (selectmode == SELECT_INVERT) { /* swap select */ - base->flag ^= SELECT; - ob->flag = base->flag; + ED_object_base_select(base, BA_INVERT); + BKE_scene_object_base_flag_sync_from_base(base); if (adt) adt->flag ^= ADT_UI_SELECTED; } @@ -2700,20 +2703,20 @@ static int mouse_anim_channels(bContext *C, bAnimContext *ac, int channel_index, /* deselect all */ /* TODO: should this deselect all other types of channels too? */ - for (b = sce->base.first; b; b = b->next) { - b->flag &= ~SELECT; - b->object->flag = b->flag; + for (b = view_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 |= 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; |