[Bf-blender-cvs] [c532c4fc25a] temp-dynamic-overrides: Expose root ID* to rna
Dalai Felinto
noreply at git.blender.org
Fri May 11 16:25:24 CEST 2018
Commit: c532c4fc25ab770221fbb6491eb836d02203158f
Author: Dalai Felinto
Date: Fri May 11 16:07:19 2018 +0200
Branches: temp-dynamic-overrides
https://developer.blender.org/rBc532c4fc25ab770221fbb6491eb836d02203158f
Expose root ID* to rna
Note: We should only store root when relevante (e.g., modifiers).
And remove this dyn property when root is deleted in these cases.
===================================================================
M source/blender/blenkernel/intern/layer.c
M source/blender/makesrna/intern/rna_layer.c
===================================================================
diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c
index 34a32e4de60..e44bf7c4dea 100644
--- a/source/blender/blenkernel/intern/layer.c
+++ b/source/blender/blenkernel/intern/layer.c
@@ -2008,6 +2008,8 @@ DynamicOverrideProperty *BKE_view_layer_override_property_add(
dyn_prop->flag = DYN_OVERRIDE_PROP_USE;
dyn_prop->multiply_factor = 1.0f;
dyn_prop->override_mode = DYN_OVERRIDE_MODE_REPLACE;
+ /* TODO: We want to store the id only when the rna path is only relevant to
+ * this particular object (e.g., modifiers of an object) .*/
dyn_prop->root = owner_id;
dyn_prop->id_type = id_type;
dyn_prop->property_type = property_type;
diff --git a/source/blender/makesrna/intern/rna_layer.c b/source/blender/makesrna/intern/rna_layer.c
index 5858ea0b37b..8d81a5e53c1 100644
--- a/source/blender/makesrna/intern/rna_layer.c
+++ b/source/blender/makesrna/intern/rna_layer.c
@@ -2114,6 +2114,11 @@ static void rna_def_dynamic_override_property(BlenderRNA *brna)
"Whether the property affects the entire scene or the collection objects only");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ prop = RNA_def_property(srna, "owner_id", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "root");
+ RNA_def_property_ui_text(prop, "ID",
+ "ID owner");
+
prop = RNA_def_property(srna, "id_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, rna_enum_id_type_items);
RNA_def_property_ui_text(prop, "ID Type",
More information about the Bf-blender-cvs
mailing list