[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [35315] trunk/blender: BGE: Material Force Field renaming + reorganization

Dalai Felinto dfelinto at gmail.com
Thu Mar 3 02:47:18 CET 2011


Revision: 35315
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35315
Author:   dfelinto
Date:     2011-03-03 01:47:17 +0000 (Thu, 03 Mar 2011)
Log Message:
-----------
BGE: Material Force Field renaming + reorganization
the old FH setting was blended with the other physics settings (friction and elastic)
Also in the Physics panel it was saying "Use Material Physics" but the button is only for Force Field.

Since I was here I decided to change the Constraint FH ui name from Fh to Force. I don't think users really understand what FH is (I for once don't).
Thanks to Carsten Wartmann for pointing that out.

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/properties_game.py
    trunk/blender/release/scripts/ui/properties_material.py
    trunk/blender/source/blender/editors/space_logic/logic_window.c
    trunk/blender/source/blender/makesrna/intern/rna_actuator.c
    trunk/blender/source/blender/makesrna/intern/rna_material.c
    trunk/blender/source/blender/makesrna/intern/rna_object.c

Modified: trunk/blender/release/scripts/ui/properties_game.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_game.py	2011-03-02 23:40:32 UTC (rev 35314)
+++ trunk/blender/release/scripts/ui/properties_game.py	2011-03-03 01:47:17 UTC (rev 35315)
@@ -56,7 +56,7 @@
             col.prop(ob, "hide_render", text="Invisible")  # out of place but useful
 
             col = split.column()
-            col.prop(game, "use_material_physics")
+            col.prop(game, "use_material_physics_fh")
             col.prop(game, "use_rotate_from_normal")
             col.prop(game, "use_sleep")
 

Modified: trunk/blender/release/scripts/ui/properties_material.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_material.py	2011-03-02 23:40:32 UTC (rev 35314)
+++ trunk/blender/release/scripts/ui/properties_material.py	2011-03-03 01:47:17 UTC (rev 35315)
@@ -619,18 +619,23 @@
         phys = context.material.physics  # dont use node material
 
         split = layout.split()
+        row = split.row()
+        row.prop(phys, "friction")
+        row.prop(phys, "elasticity", slider=True)
 
-        col = split.column()
-        col.prop(phys, "distance")
-        col.prop(phys, "friction")
-        col.prop(phys, "use_normal_align")
 
-        col = split.column()
-        col.prop(phys, "force", slider=True)
-        col.prop(phys, "elasticity", slider=True)
-        col.prop(phys, "damping", slider=True)
+        row = layout.row()
+        row.label(text="Force Field:")
 
+        row = layout.row()
+        row.prop(phys, "fh_force")
+        row.prop(phys, "fh_damping", slider=True)
 
+        row = layout.row()
+        row.prop(phys, "fh_distance")
+        row.prop(phys, "use_fh_normal")
+
+
 class MATERIAL_PT_strand(MaterialButtonsPanel, bpy.types.Panel):
     bl_label = "Strand"
     bl_options = {'DEFAULT_CLOSED'}

Modified: trunk/blender/source/blender/editors/space_logic/logic_window.c
===================================================================
--- trunk/blender/source/blender/editors/space_logic/logic_window.c	2011-03-02 23:40:32 UTC (rev 35314)
+++ trunk/blender/source/blender/editors/space_logic/logic_window.c	2011-03-03 01:47:17 UTC (rev 35315)
@@ -3865,7 +3865,7 @@
 			row = uiLayoutRow(layout, 0);
 			uiItemR(row, ptr, "direction_axis", 0, NULL, ICON_NONE);
 			split = uiLayoutSplit(row, 0.9, 0);
-			uiItemR(split, ptr, "spring", 0, NULL, ICON_NONE);
+			uiItemR(split, ptr, "fh_force", 0, NULL, ICON_NONE);
 			uiItemR(split, ptr, "use_fh_normal", UI_ITEM_R_TOGGLE , NULL, ICON_NONE);
 
 			split = uiLayoutSplit(layout, 0.15, 0);

Modified: trunk/blender/source/blender/makesrna/intern/rna_actuator.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_actuator.c	2011-03-02 23:40:32 UTC (rev 35314)
+++ trunk/blender/source/blender/makesrna/intern/rna_actuator.c	2011-03-03 01:47:17 UTC (rev 35315)
@@ -1232,19 +1232,19 @@
 	prop= RNA_def_property(srna, "fh_height", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_fhheight_get", "rna_ConstraintActuator_fhheight_set", NULL);
 	RNA_def_property_ui_range(prop, 0.01, 2000.0, 10, 2);
-	RNA_def_property_ui_text(prop, "Distance", "Height of the Fh area");
+	RNA_def_property_ui_text(prop, "Distance", "Height of the force field area");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
-	prop= RNA_def_property(srna, "spring", PROP_FLOAT, PROP_PERCENTAGE);
+	prop= RNA_def_property(srna, "fh_force", PROP_FLOAT, PROP_PERCENTAGE);
 	RNA_def_property_float_funcs(prop, "rna_ConstraintActuator_spring_get", "rna_ConstraintActuator_spring_set", NULL);
 	RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 2);
-	RNA_def_property_ui_text(prop, "Fh", "Spring force within the Fh area");
+	RNA_def_property_ui_text(prop, "Force", "Spring force within the force field area");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
 	prop= RNA_def_property(srna, "fh_damping", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "maxrot[0]");
 	RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 2);
-	RNA_def_property_ui_text(prop, "Damping", "Damping factor of the Fh spring force");
+	RNA_def_property_ui_text(prop, "Damping", "Damping factor of the force field spring");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
 	/* booleans */

Modified: trunk/blender/source/blender/makesrna/intern/rna_material.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_material.c	2011-03-02 23:40:32 UTC (rev 35314)
+++ trunk/blender/source/blender/makesrna/intern/rna_material.c	2011-03-03 01:47:17 UTC (rev 35315)
@@ -1525,31 +1525,33 @@
 	RNA_def_struct_nested(brna, srna, "Material");
 	RNA_def_struct_ui_text(srna, "Material Physics", "Physics settings for a Material datablock");
 	
-	prop= RNA_def_property(srna, "use_normal_align", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "dynamode", MA_FH_NOR);
-	RNA_def_property_ui_text(prop, "Align to Normal", "Align dynamic game objects along the surface normal, when inside the physics distance area");
-	
 	prop= RNA_def_property(srna, "friction", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "friction");
 	RNA_def_property_range(prop, 0, 100);
 	RNA_def_property_ui_text(prop, "Friction", "Coulomb friction coefficient, when inside the physics distance area");
 
-	prop= RNA_def_property(srna, "force", PROP_FLOAT, PROP_NONE);
-	RNA_def_property_float_sdna(prop, NULL, "fh");
-	RNA_def_property_range(prop, 0, 1);
-	RNA_def_property_ui_text(prop, "Force", "Upward spring force, when inside the physics distance area");
-	
 	prop= RNA_def_property(srna, "elasticity", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "reflect");
 	RNA_def_property_range(prop, 0, 1);
 	RNA_def_property_ui_text(prop, "Elasticity", "Elasticity of collisions");
+
+	/* FH/Force Field Settings */
+	prop= RNA_def_property(srna, "use_fh_normal", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "dynamode", MA_FH_NOR);
+	RNA_def_property_ui_text(prop, "Align to Normal", "Align dynamic game objects along the surface normal, when inside the physics distance area");
+
+	prop= RNA_def_property(srna, "fh_force", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "fh");
+	RNA_def_property_range(prop, 0, 1);
+	RNA_def_property_ui_range(prop, 0.0, 1.0, 10, 2);
+	RNA_def_property_ui_text(prop, "Force", "Upward spring force, when inside the physics distance area");
 	
-	prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
+	prop= RNA_def_property(srna, "fh_distance", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "fhdist");
 	RNA_def_property_range(prop, 0, 20);
 	RNA_def_property_ui_text(prop, "Distance", "Distance of the physics area");
 	
-	prop= RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE);
+	prop= RNA_def_property(srna, "fh_damping", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "xyfrict");
 	RNA_def_property_range(prop, 0, 1);
 	RNA_def_property_ui_text(prop, "Damping", "Damping of the spring force, when inside the physics distance area");

Modified: trunk/blender/source/blender/makesrna/intern/rna_object.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_object.c	2011-03-02 23:40:32 UTC (rev 35314)
+++ trunk/blender/source/blender/makesrna/intern/rna_object.c	2011-03-03 01:47:17 UTC (rev 35315)
@@ -1435,9 +1435,9 @@
 	RNA_def_property_ui_text(prop, "Lock Z Rotation Axis", "Disable simulation of angular  motion along the Z axis");	
 	
 
-	prop= RNA_def_property(srna, "use_material_physics", PROP_BOOLEAN, PROP_NONE);
+	prop= RNA_def_property(srna, "use_material_physics_fh", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_DO_FH);
-	RNA_def_property_ui_text(prop, "Use Material Physics", "Use physics settings in materials");
+	RNA_def_property_ui_text(prop, "Use Material Force Field", "React to force field physics settings in materials");
 
 	prop= RNA_def_property(srna, "use_rotate_from_normal", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "gameflag", OB_ROT_FH);




More information about the Bf-blender-cvs mailing list