Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gavrilov <angavrilov@gmail.com>2021-05-02 20:54:35 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2021-05-03 14:02:13 +0300
commit6899dbef77cd26df3588888040887e4e41c1ec43 (patch)
tree453c0b333aa3dd2a48b84f442af40ec77e818465 /source/blender/makesrna/intern/rna_material.c
parenta53d34a28a9db646a0b86f5d2dc8f1d397175ac2 (diff)
LibOverride: temporarily fix the material driver workaround with a hack.
Currently overriding properties within material node trees is not supported. However there is a workaround that allows feeding values through drivers via an intermediate custom property, as described in T82404. The workaround relies on the behavior of the ID copying code that always patches datablock self-references even without any overrides. Unfortunately, this broke during development of 2.93. This happened because a call RNA_struct_override_matches added in rB2281db72b0157 detects that no override exists, and 'restores' the self-reference to point to the original datablock. To avoid this, mark the Material.node_tree property with the PROPOVERRIDE_IGNORE flag to stop RNA_struct_override_matches from recursing into the currently unsupported node tree sub-block. This flag should be removed when this is properly supported. This was confirmed to fix the workaround and discussed with @mont29.
Diffstat (limited to 'source/blender/makesrna/intern/rna_material.c')
-rw-r--r--source/blender/makesrna/intern/rna_material.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index 7ef1904fc34..a4052430d9a 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -840,6 +840,8 @@ void RNA_def_material(BlenderRNA *brna)
prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "nodetree");
RNA_def_property_clear_flag(prop, PROP_PTR_NO_OWNERSHIP);
+ /* XXX: remove once overrides in material node trees are supported. */
+ RNA_def_property_override_flag(prop, PROPOVERRIDE_IGNORE);
RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node based materials");
prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);