[Bf-blender-cvs] [a67b33acd04] blender-v3.4-release: libOverride: RNA API: Add option to make all overrides editable in `override_hierarchy_create`.

Bastien Montagne noreply at git.blender.org
Thu Nov 17 12:20:56 CET 2022


Commit: a67b33acd04ea4816a5ceab6d5b86f8af4d4928f
Author: Bastien Montagne
Date:   Thu Nov 17 12:18:58 2022 +0100
Branches: blender-v3.4-release
https://developer.blender.org/rBa67b33acd04ea4816a5ceab6d5b86f8af4d4928f

libOverride: RNA API: Add option to make all overrides editable in `override_hierarchy_create`.

Request from Paul Golter (@paulgolter).

===================================================================

M	source/blender/makesrna/intern/rna_ID.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index b2c57846a08..43ffabf24d5 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -720,8 +720,12 @@ static ID *rna_ID_override_create(ID *id, Main *bmain, bool remap_local_usages)
   return local_id;
 }
 
-static ID *rna_ID_override_hierarchy_create(
-    ID *id, Main *bmain, Scene *scene, ViewLayer *view_layer, ID *id_instance_hint)
+static ID *rna_ID_override_hierarchy_create(ID *id,
+                                            Main *bmain,
+                                            Scene *scene,
+                                            ViewLayer *view_layer,
+                                            ID *id_instance_hint,
+                                            bool do_fully_editable)
 {
   if (!ID_IS_OVERRIDABLE_LIBRARY(id)) {
     return NULL;
@@ -735,8 +739,15 @@ static ID *rna_ID_override_hierarchy_create(
   BPy_BEGIN_ALLOW_THREADS;
 #  endif
 
-  BKE_lib_override_library_create(
-      bmain, scene, view_layer, NULL, id, id, id_instance_hint, &id_root_override, false);
+  BKE_lib_override_library_create(bmain,
+                                  scene,
+                                  view_layer,
+                                  NULL,
+                                  id,
+                                  id,
+                                  id_instance_hint,
+                                  &id_root_override,
+                                  do_fully_editable);
 
 #  ifdef WITH_PYTHON
   BPy_END_ALLOW_THREADS;
@@ -2141,6 +2152,12 @@ static void rna_def_ID(BlenderRNA *brna)
                   "",
                   "Another ID (usually an Object or Collection) used as a hint to decide where to "
                   "instantiate the new overrides");
+  RNA_def_boolean(func,
+                  "do_fully_editable",
+                  false,
+                  "",
+                  "Make all library overrides generated by this call fully editable by the user "
+                  "(none will be 'system overrides')");
 
   func = RNA_def_function(srna, "override_template_create", "rna_ID_override_template_create");
   RNA_def_function_ui_description(func, "Create an override template for this ID");



More information about the Bf-blender-cvs mailing list