diff options
author | Thomas Dinges <blender@dingto.org> | 2009-06-14 01:22:21 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2009-06-14 01:22:21 +0400 |
commit | c3c38155ad2aca369fa956b2251ed41c749942cc (patch) | |
tree | 7c522007b81b30989af91dcad1bb573b78c19da5 /source | |
parent | 646d4041e2c3461f4494be126172cf10472914b7 (diff) |
2.5 Buttons:
* Added more material buttons by William. Thanks.
I made some minor adjustments and added Specular Shader Model RNA.
* Code cleanup and some consistency tweaks of button files.
Notes: Preview render now only shows up when there is an active world, material, texture or lamp.
* Made sure initial panels with ID Datablocks are shown, even when no block is active.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/intern/rna_material.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index a5dbb63adf2..78098570783 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -734,13 +734,28 @@ static void rna_def_material_sss(BlenderRNA *brna) void rna_def_material_specularity(StructRNA *srna) { PropertyRNA *prop; - + + static EnumPropertyItem prop_spec_shader_items[] = { + {MA_SPEC_COOKTORR, "COOKTORR", "CookTorr", ""}, + {MA_SPEC_PHONG, "PHONG", "Phong", ""}, + {MA_SPEC_BLINN, "BLINN", "Blinn", ""}, + {MA_SPEC_TOON, "TOON", "Toon", ""}, + {MA_SPEC_WARDISO, "WARDISO", "WardIso", ""}, + {0, NULL, NULL, NULL}}; + + prop= RNA_def_property(srna, "spec_shader", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "spec_shader"); + RNA_def_property_enum_items(prop, prop_spec_shader_items); + RNA_def_property_ui_text(prop, "Specular Shader Model", ""); + RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + prop= RNA_def_property(srna, "specularity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "spec"); RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_text(prop, "Specularity Intensity", ""); /* XXX: this field is also used for Halo hardness. should probably be fixed in DNA */ + /* I guess it's fine. Specular is disabled when mat type is Halo. --DingTo */ prop= RNA_def_property(srna, "specular_hardness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "har"); RNA_def_property_range(prop, 1, 511); |