diff options
author | Bastien Montagne <bastien@blender.org> | 2022-03-24 18:57:16 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-03-29 18:59:43 +0300 |
commit | 354db59fb12a5ee595ae650ac3a736e3cc6df39d (patch) | |
tree | f0e70f85d9a4e116a156335a61b3674c643ef649 /source/blender/makesrna | |
parent | 6cc9ba94b78c203e905c6974c9ff68409c5c22da (diff) |
LibOverride: Rename 'delete hierarchy' to 'clear hierarchy', add 'clear single' operations.
'Delete' was a confusing name, even though it would delete the overrides
it would replace them by linked data.
Adding the 'single' version of that operation made it even more
confusing, since often it has to keep the override ID for sakes of
hierarchy, and just reset it and turn it back into a non-editable system
override.
Ref: {T95707}.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_ID.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 5f264a19d47..d3b7e380afa 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -762,7 +762,8 @@ static void rna_ID_override_library_reset(ID *id, IDOverrideLibrary *UNUSED(override_library), Main *bmain, ReportList *reports, - bool do_hierarchy) + bool do_hierarchy, + bool set_system_override) { if (!ID_IS_OVERRIDE_LIBRARY_REAL(id)) { BKE_reportf(reports, RPT_ERROR, "ID '%s' isn't an override", id->name); @@ -770,10 +771,10 @@ static void rna_ID_override_library_reset(ID *id, } if (do_hierarchy) { - BKE_lib_override_library_id_hierarchy_reset(bmain, id); + BKE_lib_override_library_id_hierarchy_reset(bmain, id, set_system_override); } else { - BKE_lib_override_library_id_reset(bmain, id); + BKE_lib_override_library_id_reset(bmain, id, set_system_override); } WM_main_add_notifier(NC_WM | ND_LIB_OVERRIDE_CHANGED, NULL); @@ -1869,6 +1870,11 @@ static void rna_def_ID_override_library(BlenderRNA *brna) true, "", "Also reset all the dependencies of this override to match their reference linked IDs"); + RNA_def_boolean(func, + "set_system_override", + false, + "", + "Reset all user-editable overrides as (non-editable) system overrides"); func = RNA_def_function(srna, "destroy", "rna_ID_override_library_destroy"); RNA_def_function_ui_description( |