diff options
author | Bastien Montagne <bastien@blender.org> | 2022-03-28 18:34:36 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-03-29 18:59:55 +0300 |
commit | 5596f79821caae3d4c1eb608ce77371904f74b80 (patch) | |
tree | 92dbb06728dd7bbecfa71d17dbe25cde49dfdeb5 /source/blender/editors/animation | |
parent | 354db59fb12a5ee595ae650ac3a736e3cc6df39d (diff) |
LibOverride: Massive edits to 'editable' IDs checks in editors code.
Add new `BKE_id_is_editable` helper in `BKE_lib_id.h`, that supercedes
previous check (simple `ID_IS_LINKED()` macro) for many editing cases.
This allows to also take into account 'system override' (aka
non-editable override) case.
Ref: {T95707}.
Diffstat (limited to 'source/blender/editors/animation')
4 files changed, 12 insertions, 8 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 5169d6904f5..ed0befbcc24 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -5117,8 +5117,9 @@ static void draw_setting_widget(bAnimContext *ac, break; } - if ((ale->fcurve_owner_id != NULL && ID_IS_LINKED(ale->fcurve_owner_id)) || - (ale->id != NULL && ID_IS_LINKED(ale->id))) { + if ((ale->fcurve_owner_id != NULL && + (ID_IS_LINKED(ale->fcurve_owner_id) || ID_IS_OVERRIDE_LIBRARY(ale->fcurve_owner_id))) || + (ale->id != NULL && (ID_IS_LINKED(ale->id) || ID_IS_OVERRIDE_LIBRARY(ale->id)))) { if (setting != ACHANNEL_SETTING_EXPAND) { UI_but_flag_enable(but, UI_BUT_DISABLED); } diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 08379be36fa..31d90c8bfec 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -2789,8 +2789,9 @@ static bool rename_anim_channels(bAnimContext *ac, int channel_index) } /* don't allow renaming linked channels */ - if ((ale->fcurve_owner_id != NULL && ID_IS_LINKED(ale->fcurve_owner_id)) || - (ale->id != NULL && ID_IS_LINKED(ale->id))) { + if ((ale->fcurve_owner_id != NULL && + (ID_IS_LINKED(ale->fcurve_owner_id) || ID_IS_OVERRIDE_LIBRARY(ale->fcurve_owner_id))) || + (ale->id != NULL && (ID_IS_LINKED(ale->id) || ID_IS_OVERRIDE_LIBRARY(ale->id)))) { ANIM_animdata_freelist(&anim_data); return false; } diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 0389e57627a..a75944fa2f2 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -1462,7 +1462,7 @@ static size_t animfilter_action(bAnimContext *ac, /* don't include anything from this action if it is linked in from another file, * and we're getting stuff for editing... */ - if ((filter_mode & ANIMFILTER_FOREDIT) && ID_IS_LINKED(act)) { + if ((filter_mode & ANIMFILTER_FOREDIT) && (ID_IS_LINKED(act) || ID_IS_OVERRIDE_LIBRARY(act))) { return 0; } diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index f40c1b983d7..58d093c678d 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -659,7 +659,8 @@ void draw_fcurve_channel(AnimKeylistDrawList *draw_list, { const bool locked = (fcu->flag & FCURVE_PROTECTED) || ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) || - ((adt && adt->action) && ID_IS_LINKED(adt->action)); + ((adt && adt->action) && + (ID_IS_LINKED(adt->action) || ID_IS_OVERRIDE_LIBRARY(adt->action))); AnimKeylistDrawListElem *draw_elem = ed_keylist_draw_list_add_elem( draw_list, ANIM_KEYLIST_FCURVE, ypos, yscale_fac, saction_flag); @@ -676,7 +677,8 @@ void draw_agroup_channel(AnimKeylistDrawList *draw_list, int saction_flag) { bool locked = (agrp->flag & AGRP_PROTECTED) || - ((adt && adt->action) && ID_IS_LINKED(adt->action)); + ((adt && adt->action) && + (ID_IS_LINKED(adt->action) || ID_IS_OVERRIDE_LIBRARY(adt->action))); AnimKeylistDrawListElem *draw_elem = ed_keylist_draw_list_add_elem( draw_list, ANIM_KEYLIST_AGROUP, ypos, yscale_fac, saction_flag); @@ -692,7 +694,7 @@ void draw_action_channel(AnimKeylistDrawList *draw_list, float yscale_fac, int saction_flag) { - const bool locked = (act && ID_IS_LINKED(act)); + const bool locked = (act && (ID_IS_LINKED(act) || ID_IS_OVERRIDE_LIBRARY(act))); saction_flag &= ~SACTION_SHOW_EXTREMES; AnimKeylistDrawListElem *draw_elem = ed_keylist_draw_list_add_elem( |