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-11-02 22:55:32 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-11-02 22:55:32 +0400
commit30f1f28a8af3b393608b5869512a8823111294ad (patch)
tree035cee751100c31e25b55087efa476145b29af64 /source/blender/makesrna/intern/rna_material.c
parent97a0ae3e1b7eea3c069da8c6d3c7a3535734059d (diff)
Nodes: add support for shader nodes on world and lamps, in addition to materials.
The internal render engine does not support them, and they are not accesible in the UI yet, but cycles will use them.
Diffstat (limited to 'source/blender/makesrna/intern/rna_material.c')
-rw-r--r--source/blender/makesrna/intern/rna_material.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index 990d3b89bce..57770be57eb 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -269,13 +269,14 @@ static void rna_Material_use_specular_ramp_set(PointerRNA *ptr, int value)
ma->ramp_spec= add_colorband(0);
}
-static void rna_Material_use_nodes_set(PointerRNA *ptr, int value)
+static void rna_Material_use_nodes_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Material *ma= (Material*)ptr->data;
- ma->use_nodes= value;
if(ma->use_nodes && ma->nodetree==NULL)
- ED_node_shader_default(ma);
+ ED_node_shader_default(scene, &ma->id);
+
+ rna_Material_update(bmain, scene, ptr);
}
static EnumPropertyItem *rna_Material_texture_coordinates_itemf(bContext *UNUSED(C), PointerRNA *ptr,
@@ -1954,9 +1955,9 @@ void RNA_def_material(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1);
- RNA_def_property_boolean_funcs(prop, NULL, "rna_Material_use_nodes_set");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_ui_text(prop, "Use Nodes", "Use shader nodes to render the material");
- RNA_def_property_update(prop, 0, "rna_Material_update");
+ RNA_def_property_update(prop, 0, "rna_Material_use_nodes_update");
prop= RNA_def_property(srna, "active_node_material", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Material");