[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22816] branches/blender2.5/blender: Tweaked layout of game properties.

William Reynish william at reynish.com
Thu Aug 27 10:46:39 CEST 2009


Revision: 22816
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22816
Author:   billrey
Date:     2009-08-27 10:46:39 +0200 (Thu, 27 Aug 2009)

Log Message:
-----------
Tweaked layout of game properties. The Add button is now at the top, meaning it doesn't move around - this is also more consistent with constraints/modifiers etc. Used the same 'box' layout as constraints/modifiers.

Also ported some name changes from the materials UI script to RNA to keep these consistent. Animation editors always show the RNA name after all, so it's good to keep the names similar.

Modified Paths:
--------------
    branches/blender2.5/blender/release/ui/buttons_material.py
    branches/blender2.5/blender/release/ui/space_logic.py
    branches/blender2.5/blender/source/blender/editors/animation/anim_ops.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_material.c

Modified: branches/blender2.5/blender/release/ui/buttons_material.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_material.py	2009-08-27 07:07:41 UTC (rev 22815)
+++ branches/blender2.5/blender/release/ui/buttons_material.py	2009-08-27 08:46:39 UTC (rev 22816)
@@ -130,8 +130,8 @@
 		
 		col = split.column(align=True)
 		col.itemL(text="Size:")
-		col.itemR(tan, "start_size", text="Root")
-		col.itemR(tan, "end_size", text="Tip")
+		col.itemR(tan, "root_size", text="Root")
+		col.itemR(tan, "tip_size", text="Tip")
 		col.itemR(tan, "min_size", text="Minimum")
 		col.itemR(tan, "blender_units")
 		sub = col.column()
@@ -231,7 +231,7 @@
 		
 		col = split.column()
 		col.itemR(mat, "shadows", text="Receive")
-		col.itemR(mat, "transparent_shadows", text="Receive Transparent")
+		col.itemR(mat, "receive_transparent_shadows", text="Receive Transparent")
 		col.itemR(mat, "only_shadow", text="Shadows Only")
 		col.itemR(mat, "cast_shadows_only", text="Cast Only")
 		col.itemR(mat, "shadow_casting_alpha", text="Casting Alpha")
@@ -266,7 +266,7 @@
 		col.itemR(mat, "diffuse_color", text="")
 		sub = col.column()
 		sub.active = (not mat.shadeless)
-		sub.itemR(mat, "diffuse_reflection", text="Intensity")
+		sub.itemR(mat, "diffuse_intensity", text="Intensity")
 		
 		col = split.column()
 		col.active = (not mat.shadeless)
@@ -320,7 +320,7 @@
 		
 		col = split.column()
 		col.itemR(mat, "specular_color", text="")
-		col.itemR(mat, "specular_reflection", text="Intensity")
+		col.itemR(mat, "specular_intensity", text="Intensity")
 
 		col = split.column()
 		col.itemR(mat, "specular_shader", text="")
@@ -426,7 +426,7 @@
 		split = layout.split()
 		
 		col = split.column()
-		col.itemR(raym, "reflect", text="Reflectivity")
+		col.itemR(raym, "reflectivity")
 		col.itemR(mat, "mirror_color", text="")
 
 		col = split.column()
@@ -448,9 +448,9 @@
 		
 		col = split.column()
 		col.itemL(text="Gloss:")
-		col.itemR(raym, "gloss", text="Amount")
+		col.itemR(raym, "gloss_amount", text="Amount")
 		sub = col.column()
-		sub.active = raym.gloss < 1
+		sub.active = raym.gloss_amount < 1
 		sub.itemR(raym, "gloss_threshold", text="Threshold")
 		sub.itemR(raym, "gloss_samples", text="Samples")
 		sub.itemR(raym, "gloss_anisotropic", text="Anisotropic")
@@ -511,9 +511,9 @@
 			
 			col = split.column()
 			col.itemL(text="Gloss:")
-			col.itemR(rayt, "gloss", text="Amount")
+			col.itemR(rayt, "gloss_amount", text="Amount")
 			sub = col.column()
-			sub.active = rayt.gloss < 1
+			sub.active = rayt.gloss_amount < 1
 			sub.itemR(rayt, "gloss_threshold", text="Threshold")
 			sub.itemR(rayt, "gloss_samples", text="Samples")
 
@@ -663,8 +663,8 @@
 		col.itemR(halo, "hardness")
 		col.itemR(halo, "add")
 		col.itemL(text="Options:")
-		col.itemR(halo, "use_texture", text="Texture")
-		col.itemR(halo, "use_vertex_normal", text="Vertex Normal")
+		col.itemR(halo, "texture")
+		col.itemR(halo, "vertex_normal")
 		col.itemR(halo, "xalpha")
 		col.itemR(halo, "shaded")
 		col.itemR(halo, "soft")

Modified: branches/blender2.5/blender/release/ui/space_logic.py
===================================================================
--- branches/blender2.5/blender/release/ui/space_logic.py	2009-08-27 07:07:41 UTC (rev 22815)
+++ branches/blender2.5/blender/release/ui/space_logic.py	2009-08-27 08:46:39 UTC (rev 22816)
@@ -14,17 +14,16 @@
 		ob = context.active_object
 		game = ob.game
 		
+		layout.itemO("object.game_property_new", text="Add Game Property")
+		
 		for i, prop in enumerate(game.properties):
-			flow = layout.row(align=True)
-			flow.itemR(prop, "name", text="")
-			flow.itemR(prop, "type", text="")
-			flow.itemR(prop, "value", text="") # we dont care about the type. rna will display correctly
-			flow.itemR(prop, "debug", text="", toggle=True, icon='ICON_INFO')
-			flow.item_intO("object.game_property_remove", "index", i, text="", icon='ICON_X')
 		
-		flow = layout.row()
-		flow.itemO("object.game_property_new")
-			
-			
-
+			box = layout.box()
+			row = box.row()
+			row.itemR(prop, "name", text="")
+			row.itemR(prop, "type", text="")
+			row.itemR(prop, "value", text="") # we dont care about the type. rna will display correctly
+			row.itemR(prop, "debug", text="", toggle=True, icon='ICON_INFO')
+			row.item_intO("object.game_property_remove", "index", i, text="", icon='ICON_X')
+		
 bpy.types.register(LOGIC_PT_properties)

Modified: branches/blender2.5/blender/source/blender/editors/animation/anim_ops.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/animation/anim_ops.c	2009-08-27 07:07:41 UTC (rev 22815)
+++ branches/blender2.5/blender/source/blender/editors/animation/anim_ops.c	2009-08-27 08:46:39 UTC (rev 22816)
@@ -406,10 +406,10 @@
 	
 	/* frame management */
 		/* NOTE: 'ACTIONMOUSE' not 'LEFTMOUSE', as user may have swapped mouse-buttons */
-	WM_keymap_verify_item(keymap, "ANIM_OT_change_frame", ACTIONMOUSE, KM_PRESS, 0, 0);
+	WM_keymap_add_item(keymap, "ANIM_OT_change_frame", ACTIONMOUSE, KM_PRESS, 0, 0);
 	WM_keymap_verify_item(keymap, "ANIM_OT_time_toggle", TKEY, KM_PRESS, KM_CTRL, 0);
 	
 	/* preview range */
-	WM_keymap_verify_item(keymap, "ANIM_OT_previewrange_set", PKEY, KM_PRESS, KM_CTRL, 0);
+	WM_keymap_verify_item(keymap, "ANIM_OT_previewrange_set", PKEY, KM_PRESS, 0, 0);
 	WM_keymap_verify_item(keymap, "ANIM_OT_previewrange_clear", PKEY, KM_PRESS, KM_ALT, 0);
 }

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_material.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_material.c	2009-08-27 07:07:41 UTC (rev 22815)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_material.c	2009-08-27 08:46:39 UTC (rev 22816)
@@ -685,10 +685,10 @@
 	RNA_def_property_ui_text(prop, "Diffuse Shader Model", "");
 	RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 	
-	prop= RNA_def_property(srna, "diffuse_reflection", PROP_FLOAT, PROP_PERCENTAGE);
+	prop= RNA_def_property(srna, "diffuse_intensity", PROP_FLOAT, PROP_PERCENTAGE);
 	RNA_def_property_float_sdna(prop, NULL, "ref");
 	RNA_def_property_range(prop, 0.0f, 1.0f);
-	RNA_def_property_ui_text(prop, "Diffuse Reflection", "Amount of diffuse reflection.");
+	RNA_def_property_ui_text(prop, "Diffuse Intensity", "Amount of diffuse reflection.");
 	RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL);
 	
 	prop= RNA_def_property(srna, "roughness", PROP_FLOAT, PROP_NONE);
@@ -746,10 +746,10 @@
 	RNA_def_property_ui_text(prop, "Enabled", "Enable raytraced reflections.");
 	RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 		
-	prop= RNA_def_property(srna, "reflect", PROP_FLOAT, PROP_PERCENTAGE);
+	prop= RNA_def_property(srna, "reflectivity", PROP_FLOAT, PROP_PERCENTAGE);
 	RNA_def_property_float_sdna(prop, NULL, "ray_mirror");
 	RNA_def_property_range(prop, 0.0f, 1.0f);
-	RNA_def_property_ui_text(prop, "Reflect", "Sets the amount mirror reflection for raytrace.");
+	RNA_def_property_ui_text(prop, "Reflectivity", "Sets the amount mirror reflection for raytrace.");
 	RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 	
 	prop= RNA_def_property(srna, "fresnel", PROP_FLOAT, PROP_NONE);
@@ -764,10 +764,10 @@
 	RNA_def_property_ui_text(prop, "Fresnel Factor", "Blending factor for Fresnel.");
 	RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 	
-	prop= RNA_def_property(srna, "gloss", PROP_FLOAT, PROP_PERCENTAGE);
+	prop= RNA_def_property(srna, "gloss_amount", PROP_FLOAT, PROP_PERCENTAGE);
 	RNA_def_property_float_sdna(prop, NULL, "gloss_mir");
 	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.");
+	RNA_def_property_ui_text(prop, "Gloss Amount", "The shininess of the reflection. Values < 1.0 give diffuse, blurry reflections.");
 	RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 	
 	prop= RNA_def_property(srna, "gloss_anisotropic", PROP_FLOAT, PROP_PERCENTAGE);
@@ -835,10 +835,10 @@
 	RNA_def_property_ui_text(prop, "Fresnel Factor", "Blending factor for Fresnel.");
 	RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 	
-	prop= RNA_def_property(srna, "gloss", PROP_FLOAT, PROP_PERCENTAGE);
+	prop= RNA_def_property(srna, "gloss_amount", PROP_FLOAT, PROP_PERCENTAGE);
 	RNA_def_property_float_sdna(prop, NULL, "gloss_tra");
 	RNA_def_property_range(prop, 0.0f, 1.0f);
-	RNA_def_property_ui_text(prop, "Gloss", "The clarity of the refraction. Values < 1.0 give diffuse, blurry refractions.");
+	RNA_def_property_ui_text(prop, "Gloss Amount", "The clarity of the refraction. Values < 1.0 give diffuse, blurry refractions.");
 	RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 	
 	prop= RNA_def_property(srna, "gloss_samples", PROP_INT, PROP_NONE);
@@ -1133,14 +1133,14 @@
 	RNA_def_property_ui_text(prop, "Star", "Renders halo as a star.");
 	RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 	
-	prop= RNA_def_property(srna, "use_texture", PROP_BOOLEAN, PROP_NONE);
+	prop= RNA_def_property(srna, "texture", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALOTEX);
-	RNA_def_property_ui_text(prop, "Use Texture", "Gives halo a texture.");
+	RNA_def_property_ui_text(prop, "Texture", "Gives halo a texture.");
 	RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 	
-	prop= RNA_def_property(srna, "use_vertex_normal", PROP_BOOLEAN, PROP_NONE);
+	prop= RNA_def_property(srna, "vertex_normal", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALOPUNO);
-	RNA_def_property_ui_text(prop, "Use Vertex Normal", "Uses the vertex normal to specify the dimension of the halo.");
+	RNA_def_property_ui_text(prop, "Vertex Normal", "Uses the vertex normal to specify the dimension of the halo.");
 	RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 	
 	prop= RNA_def_property(srna, "xalpha", PROP_BOOLEAN, PROP_NONE);
@@ -1247,10 +1247,10 @@
 	RNA_def_property_ui_text(prop, "Specular Shader Model", "");
 	RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL);
 	
-	prop= RNA_def_property(srna, "specular_reflection", PROP_FLOAT, PROP_PERCENTAGE);

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list