[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [24156] trunk/blender: Fixed [#19735] No normal map button in texture->image pane

Thomas Dinges dingto at gmx.de
Thu Oct 29 15:27:57 CET 2009


Revision: 24156
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=24156
Author:   dingto
Date:     2009-10-29 15:27:56 +0100 (Thu, 29 Oct 2009)

Log Message:
-----------
Fixed [#19735] No normal map button in texture->image pane
Put it into the "Image Sampling" Panel, not sure if its the right location. 

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/buttons_texture.py
    trunk/blender/source/blender/makesrna/intern/rna_texture.c

Modified: trunk/blender/release/scripts/ui/buttons_texture.py
===================================================================
--- trunk/blender/release/scripts/ui/buttons_texture.py	2009-10-29 11:26:44 UTC (rev 24155)
+++ trunk/blender/release/scripts/ui/buttons_texture.py	2009-10-29 14:27:56 UTC (rev 24156)
@@ -459,16 +459,6 @@
 		slot = context.texture_slot
 		
 		split = layout.split()
-		
-		"""
-		col = split.column()   		
-		col.itemR(tex, "flip_axis")
-		col.itemR(tex, "normal_map")
-		if slot:
-			row = col.row()
-			row.active = tex.normal_map
-			row.itemR(slot, "normal_map_space", text="")
-		"""
 
 		col = split.column()
 		col.itemL(text="Alpha:")
@@ -480,6 +470,11 @@
 		col.itemR(tex, "flip_axis", text="X/Y Axis")
 
 		col = split.column() 
+		col.itemR(tex, "normal_map")
+		row = col.row()
+		row.active = tex.normal_map
+		row.itemR(tex, "normal_space", text="")
+		
 		col.itemL(text="Filter:")
 		col.itemR(tex, "filter", text="")
 		col.itemR(tex, "mipmap")
@@ -519,6 +514,8 @@
 			col.itemL(text="Mirror:")
 			col.itemR(tex, "mirror_x", text="X")
 			col.itemR(tex, "mirror_y", text="Y")
+			layout.itemS()
+
 		elif tex.extension == 'CHECKER': 
 			col = split.column(align=True)
 			row = col.row()
@@ -526,9 +523,8 @@
 			row.itemR(tex, "checker_odd", text="Odd")
 
 			split.itemR(tex, "checker_distance", text="Distance")
+			layout.itemS()
 
-		layout.itemS()
-
 		split = layout.split()
 		
 		col = split.column(align=True)

Modified: trunk/blender/source/blender/makesrna/intern/rna_texture.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_texture.c	2009-10-29 11:26:44 UTC (rev 24155)
+++ trunk/blender/source/blender/makesrna/intern/rna_texture.c	2009-10-29 14:27:56 UTC (rev 24156)
@@ -1060,6 +1060,13 @@
 		{TEX_REPEAT, "REPEAT", 0, "Repeat", "Causes the image to repeat horizontally and vertically"},
 		{TEX_CHECKER, "CHECKER", 0, "Checker", "Causes the image to repeat in checker board pattern"},
 		{0, NULL, 0, NULL, NULL}};
+		
+	static EnumPropertyItem prop_normal_space[] = {
+		{MTEX_NSPACE_CAMERA, "CAMERA", 0, "Extend", ""},
+		{MTEX_NSPACE_WORLD, "WORLD", 0, "World", ""},
+		{MTEX_NSPACE_OBJECT, "OBJECT", 0, "Object", ""},
+		{MTEX_NSPACE_TANGENT, "TANGENT", 0, "Tangent", ""},
+		{0, NULL, 0, NULL, NULL}};
 
 	srna= RNA_def_struct(brna, "ImageTexture", "Texture");
 	RNA_def_struct_ui_text(srna, "Image Texture", "");
@@ -1104,14 +1111,6 @@
 
 	rna_def_filter_size_common(srna);
 
-	prop= RNA_def_property(srna, "normal_map", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_NORMALMAP);
-	RNA_def_property_ui_text(prop, "Normal Map", "Uses image RGB values for normal mapping");
-	RNA_def_property_update(prop, 0, "rna_Texture_update");
-
-	/* XXX: mtex->normapspace "Sets space of normal map image" "Normal Space %t|Camera %x0|World %x1|Object %x2|Tangent %x3" 
-	 *			not sure why this goes in mtex instead of texture directly? */
-
 	prop= RNA_def_property(srna, "extension", PROP_ENUM, PROP_NONE);
 	RNA_def_property_enum_sdna(prop, NULL, "extend");
 	RNA_def_property_enum_items(prop, prop_image_extension);
@@ -1230,6 +1229,21 @@
 	RNA_def_property_range(prop, 1, 256);
 	RNA_def_property_ui_text(prop, "Filter Eccentricity", "Maximum eccentricity. Higher gives less blur at distant/oblique angles, but is also slower.");
 	RNA_def_property_update(prop, 0, "rna_Texture_update");
+	
+	/* Normal Map */
+	prop= RNA_def_property(srna, "normal_map", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "imaflag", TEX_NORMALMAP);
+	RNA_def_property_ui_text(prop, "Normal Map", "Uses image RGB values for normal mapping");
+	RNA_def_property_update(prop, 0, "rna_Texture_update");
+	
+	/*	not sure why this goes in mtex instead of texture directly? */
+	RNA_def_struct_sdna(srna, "MTex");
+	
+	prop= RNA_def_property(srna, "normal_space", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_sdna(prop, NULL, "normapspace");
+	RNA_def_property_enum_items(prop, prop_normal_space);
+	RNA_def_property_ui_text(prop, "Normal Space", "Sets space of normal map image.");
+	RNA_def_property_update(prop, 0, "rna_Texture_update");
 }
 
 static void rna_def_texture_plugin(BlenderRNA *brna)





More information about the Bf-blender-cvs mailing list