diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2008-11-28 03:14:27 +0300 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2008-11-28 03:14:27 +0300 |
commit | d6769d513e94a5552968f1ed79520e755183ca5d (patch) | |
tree | 14054bd4ff3281db5c8556c136fef10b0aa50f69 /source/blender/makesrna | |
parent | 963b1f7f073e09fb04f29de55c5c698cc4e3cd57 (diff) |
* RNA for raytrace mirror properties.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_material.c | 67 |
1 files changed, 65 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 485b331195c..947ffc1d8ba 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -46,6 +46,10 @@ void RNA_def_material(BlenderRNA *brna) {MA_YUV, "YUV", "YUV", ""}, {MA_HSV, "HSV", "HSV", ""}, {0, NULL, NULL, NULL}}; + static EnumPropertyItem prop_fadeto_mir_items[] = { + {MA_RAYMIR_FADETOSKY, "RAYMIR_FADETOSKY", "Fade to sky color", ""}, + {MA_RAYMIR_FADETOMAT, "RAYMIR_FADETOMAT", "Fade to material color", ""}, + {0, NULL, NULL, NULL}}; srna= RNA_def_struct(brna, "Material", "ID", "Material"); @@ -53,6 +57,7 @@ void RNA_def_material(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "Color Model", "Color model."); + /* colors */ prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, "Material", "r"); RNA_def_property_array(prop, 3); @@ -62,9 +67,67 @@ void RNA_def_material(BlenderRNA *brna) prop= RNA_def_property(srna, "specular", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "specr"); RNA_def_property_array(prop, 3); - RNA_def_property_ui_text(prop, "Specular", "Specular color."); + RNA_def_property_ui_text(prop, "Specular Color", "Specular color."); RNA_def_property_ui_range(prop, 0.0f , 1.0f, 10.0f, 3.0f); - + + prop= RNA_def_property(srna, "mirror", PROP_FLOAT, PROP_COLOR); + RNA_def_property_float_sdna(prop, NULL, "mirr"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Mirror Color", "Mirror color."); + RNA_def_property_ui_range(prop, 0.0f , 1.0f, 10.0f, 3.0f); + + prop= RNA_def_property(srna, "ambient", PROP_FLOAT, PROP_COLOR); + RNA_def_property_float_sdna(prop, NULL, "ambr"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Ambient Color", "Ambient color."); + RNA_def_property_ui_range(prop, 0.0f , 1.0f, 10.0f, 3.0f); + + /* raytrace mirror */ + prop= RNA_def_property(srna, "mode_ray_mirror", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_RAYMIRROR); /* use bitflags */ + RNA_def_property_ui_text(prop, "Ray Mirror Mode", "Toggle raytrace mirror."); + + prop= RNA_def_property(srna, "ray_mirror", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Ray Mirror", "Sets the amount mirror reflection for raytrace."); + + prop= RNA_def_property(srna, "fresnel_mir", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.0f, 5.0f); + RNA_def_property_ui_text(prop, "Fresnel", "Power of Fresnel for mirror reflection."); + + prop= RNA_def_property(srna, "fresnel_mir_i", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Fresnel Factor", "Blending factor for Fresnel."); + + prop= RNA_def_property(srna, "gloss_mir", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Gloss", "The shininess of the reflection. Values < 1.0 give diffuse, blurry reflections."); + + prop= RNA_def_property(srna, "aniso_gloss_mir", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Aniso", "The shape of the reflection, from 0.0 (circular) to 1.0 (fully stretched along the tangent."); + + prop= RNA_def_property(srna, "samp_gloss_mir", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.0f, 1024.0f); + RNA_def_property_ui_text(prop, "Gloss Samples", "Number of cone samples averaged for blurry reflections."); + + prop= RNA_def_property(srna, "adapt_thresh_mir", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Gloss Threshold", "Threshold for adaptive sampling. If a sample contributes less than this amount (as a percentage), sampling is stopped."); + + prop= RNA_def_property(srna, "ray_depth", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.0f, 10.0f); + RNA_def_property_ui_text(prop, "Ray Mirror Depth", "Maximum allowed number of light inter-reflections."); + + prop= RNA_def_property(srna, "dist_mir", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.0f, 10000.0f); + RNA_def_property_ui_text(prop, "Ray Mirror Max Dist", "Maximum distance of reflected rays. Reflections further than this range fade to sky color or material color."); + + prop= RNA_def_property(srna, "fadeto_mir", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, prop_fadeto_mir_items); + RNA_def_property_ui_text(prop, "Ray end fade-out", "The color that rays with no intersection within the Max Distance take. Material color can be best for indoor scenes, sky color for outdoor."); + + /* nodetree */ prop= RNA_def_property(srna, "nodetree", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "bNodeTree"); RNA_def_property_ui_text(prop, "Nodetree", "Nodetree"); |