diff options
author | Thomas Dinges <blender@dingto.org> | 2010-04-04 16:09:59 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2010-04-04 16:09:59 +0400 |
commit | d574e8b82617c389de85a09fcf9b0f14172466a8 (patch) | |
tree | 14ae0ae8d3939d471e9b4c8ef406dcd7336b1027 /source/blender/makesrna | |
parent | 426aaaa0a29ea2ddaf008142752fc1efb91033f0 (diff) |
2.5 Preview Render:
* Converted Type Buttons (Flat, Cube, Monkey etc.) in Material Preview to RNA.
* "Alpha" option in texture Preview Render is back!
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_material.c | 17 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_texture.c | 6 |
2 files changed, 23 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index b6a6f072c6b..4d47737038a 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -1486,6 +1486,16 @@ void RNA_def_material(BlenderRNA *brna) {MA_ZTRANSP, "Z_TRANSPARENCY", 0, "Z Transparency", "Use alpha buffer for transparent faces"}, {MA_RAYTRANSP, "RAYTRACE", 0, "Raytrace", "Use raytracing for transparent refraction rendering"}, {0, NULL, 0, NULL, NULL}}; + + /* Render Preview Types */ + static EnumPropertyItem preview_type_items[] = { + {MA_FLAT, "FLAT", ICON_MATPLANE, "Flat", "Preview type: Flat XY plane"}, + {MA_SPHERE, "SPHERE", ICON_MATSPHERE, "Sphere", "Preview type: Sphere"}, + {MA_CUBE, "CUBE", ICON_MATCUBE, "Flat", "Preview type: Cube"}, + {MA_MONKEY, "MONKEY", ICON_MONKEY, "Flat", "Preview type: Monkey"}, + {MA_HAIR, "HAIR", ICON_HAIR, "Flat", "Preview type: Hair strands"}, + {MA_SPHERE_A, "SPHERE_A", ICON_MAT_SPHERE_SKY, "Flat", "Preview type: Large sphere with sky"}, + {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Material", "ID"); RNA_def_struct_ui_text(srna, "Material", "Material datablock to defined the appearance of geometric objects for rendering"); @@ -1509,6 +1519,13 @@ void RNA_def_material(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Transparency Method", "Method to use for rendering transparency"); RNA_def_property_update(prop, 0, "rna_Material_update"); + /* For Preview Render */ + prop= RNA_def_property(srna, "preview_render_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "pr_type"); + RNA_def_property_enum_items(prop, preview_type_items); + RNA_def_property_ui_text(prop, "Preview render type", "Type of preview render"); + RNA_def_property_update(prop, 0, "rna_Material_update"); + prop= RNA_def_property(srna, "ambient", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "amb"); RNA_def_property_range(prop, 0, 1); diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 69d1884e756..ba91cdf690a 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -1725,6 +1725,12 @@ static void rna_def_texture(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Factor Blue", ""); RNA_def_property_update(prop, 0, "rna_Texture_update"); + /* Alpha for preview render */ + prop= RNA_def_property(srna, "use_preview_alpha", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_PRV_ALPHA); + RNA_def_property_ui_text(prop, "Show Alpha", "Show Alpha in Preview Render"); + RNA_def_property_update(prop, 0, "rna_Texture_update"); + /* nodetree */ prop= RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1); |