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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-12-06 20:04:45 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-12-06 20:04:45 +0400
commitb8cc575ee312ced934498663f85b7b6b7428cc14 (patch)
treea0376292f3889a88250f3ed00bc233c44d68fff2 /source/blender/makesrna/intern/rna_nodetree.c
parentb7649ea7578e90a15a0584142c9a2720731eedfe (diff)
Fix related to #29513: materials using nodes will output passes from the active
material node. This is a confusing system, but two features were missing from 2.4x that made this at least a bit more clear: * The top right icon in the node now shows brighter again for the active node. * Setting a material datablock in a node makes that node active.
Diffstat (limited to 'source/blender/makesrna/intern/rna_nodetree.c')
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 8e567d0ac70..c588dc9c8ac 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -365,6 +365,17 @@ static void rna_Node_update(Main *bmain, Scene *scene, PointerRNA *ptr)
node_update(bmain, scene, ntree, node);
}
+static void rna_Node_material_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+ bNodeTree *ntree= (bNodeTree*)ptr->id.data;
+ bNode *node= (bNode*)ptr->data;
+
+ if(node->id)
+ nodeSetActive(ntree, node);
+
+ node_update(bmain, scene, ntree, node);
+}
+
static void rna_NodeGroup_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
bNodeTree *ntree= (bNodeTree*)ptr->id.data;
@@ -1119,7 +1130,7 @@ static void def_sh_material(StructRNA *srna)
RNA_def_property_struct_type(prop, "Material");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Material", "");
- RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
+ RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_material_update");
prop = RNA_def_property(srna, "use_diffuse", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "custom1", SH_NODE_MAT_DIFF);