diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-03-22 17:49:13 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-03-22 17:49:13 +0300 |
commit | ae5c7e7edbd6a787f1fc722dd172b593d124d0d5 (patch) | |
tree | d370751a660035755ff8dc55d63c95a0b063a358 /source | |
parent | 3bf71fbe386cb3fba1896183ea528046f6145b7d (diff) |
RNA:
* As an example, added the Material Shader Node.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 5d8516d6aa1..7ae11d2ef6c 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -41,6 +41,8 @@ StructRNA *rna_Node_refine(struct PointerRNA *ptr) switch(node->type) { case SH_NODE_OUTPUT: return &RNA_ShaderNodeOutput; + case SH_NODE_MATERIAL: + return &RNA_ShaderNodeMaterial; /* XXX complete here */ default: return &RNA_Node; @@ -58,6 +60,27 @@ static void rna_def_shader_node_output(BlenderRNA *brna) RNA_def_struct_sdna(srna, "bNode"); } +static void rna_def_shader_node_material(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "ShaderNodeMaterial", "ShaderNode"); + RNA_def_struct_ui_text(srna, "Shader Node Material", ""); + RNA_def_struct_sdna(srna, "bNode"); + + prop= RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "id"); + RNA_def_property_struct_type(prop, "Material"); + RNA_def_property_ui_text(prop, "Material", ""); + + prop= RNA_def_property(srna, "diffuse", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "custom1", SH_NODE_MAT_DIFF); + RNA_def_property_ui_text(prop, "Diffuse", "Material Node outputs Diffuse"); + + /* XXX add specular, negate normal */ +} + static void rna_def_shader_node(BlenderRNA *brna) { StructRNA *srna; @@ -99,6 +122,7 @@ static void rna_def_shader_node(BlenderRNA *brna) /* specific types */ rna_def_shader_node_output(brna); + rna_def_shader_node_material(brna); } static void rna_def_node(BlenderRNA *brna) |