[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17597] branches/blender2.5/blender/source /blender/makesrna/intern/rna_material.c: * RNA for raytrace mirror properties.

Nathan Letwory jesterking at letwory.net
Fri Nov 28 01:14:30 CET 2008


Revision: 17597
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17597
Author:   jesterking
Date:     2008-11-28 01:14:27 +0100 (Fri, 28 Nov 2008)

Log Message:
-----------
* RNA for raytrace mirror properties.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_material.c

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_material.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_material.c	2008-11-27 17:58:46 UTC (rev 17596)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_material.c	2008-11-28 00:14:27 UTC (rev 17597)
@@ -46,6 +46,10 @@
 		{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 @@
 	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 @@
 	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");





More information about the Bf-blender-cvs mailing list