[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31745] branches/soc-2010-nicks: - set valid default value for facingaxis parameter of steering actuator ( for earlier versions)

Nick Samarin nicks1987 at bigmir.net
Fri Sep 3 21:56:22 CEST 2010


Revision: 31745
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31745
Author:   nicks
Date:     2010-09-03 21:56:22 +0200 (Fri, 03 Sep 2010)

Log Message:
-----------
- set valid default value for facingaxis parameter of steering actuator (for earlier versions)
- disable instead hiding UI checkbox for facing_axis and normal_up parameters of steering actuator 
- fit rna names to the name convention for steering actuator and recast data structures

Modified Paths:
--------------
    branches/soc-2010-nicks/release/scripts/ui/properties_scene.py
    branches/soc-2010-nicks/source/blender/blenloader/intern/readfile.c
    branches/soc-2010-nicks/source/blender/editors/space_logic/logic_window.c
    branches/soc-2010-nicks/source/blender/makesrna/intern/rna_actuator.c
    branches/soc-2010-nicks/source/blender/makesrna/intern/rna_scene.c

Modified: branches/soc-2010-nicks/release/scripts/ui/properties_scene.py
===================================================================
--- branches/soc-2010-nicks/release/scripts/ui/properties_scene.py	2010-09-03 16:45:33 UTC (rev 31744)
+++ branches/soc-2010-nicks/release/scripts/ui/properties_scene.py	2010-09-03 19:56:22 UTC (rev 31745)
@@ -350,10 +350,10 @@
         split = layout.split()
 
         col = split.column()
-        col.prop(rd, "cellsize")
+        col.prop(rd, "cell_size")
         if wide_ui:
             col = split.column()
-        col.prop(rd, "cellheight")
+        col.prop(rd, "cell_height")
 
         layout.separator()
 
@@ -361,25 +361,25 @@
         split = layout.split()
         col = split.column()
         row = col.row()
-        row.prop(rd, "agentheight")
+        row.prop(rd, "agent_height")
         row = col.row()
-        row.prop(rd, "agentradius")
+        row.prop(rd, "agent_radius")
         if wide_ui:
             col = split.column()
         row = col.row()
-        row.prop(rd, "agentmaxslope")
+        row.prop(rd, "max_slope")
         row = col.row()
-        row.prop(rd, "agentmaxclimb")
+        row.prop(rd, "max_climb")
 
         layout.separator()
 
         layout.label(text="Region:")
         split = layout.split()
         col = split.column()
-        col.prop(rd, "regionminsize")
+        col.prop(rd, "region_min_size")
         if wide_ui:
             col = split.column()
-        col.prop(rd, "regionmergesize")
+        col.prop(rd, "region_merge_size")
 
         layout.separator()
 
@@ -387,23 +387,23 @@
         split = layout.split()
         col = split.column()
         row = col.row()
-        row.prop(rd, "edgemaxlen")
+        row.prop(rd, "edge_max_len")
         row = col.row()
-        row.prop(rd, "edgemaxerror")
+        row.prop(rd, "edge_max_error")
         if wide_ui:
             col = split.column()
         row = col.row()
-        row.prop(rd, "vertsperpoly")
+        row.prop(rd, "verts_per_poly")
 
         layout.separator()
 
         layout.label(text="Detail Mesh:")
         split = layout.split()
         col = split.column()
-        col.prop(rd, "detailsampledist")
+        col.prop(rd, "sample_dist")
         if wide_ui:
             col = split.column()
-        col.prop(rd, "detailsamplemaxerror")
+        col.prop(rd, "sample_max_error")
 
 
 def register():

Modified: branches/soc-2010-nicks/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/soc-2010-nicks/source/blender/blenloader/intern/readfile.c	2010-09-03 16:45:33 UTC (rev 31744)
+++ branches/soc-2010-nicks/source/blender/blenloader/intern/readfile.c	2010-09-03 19:56:22 UTC (rev 31745)
@@ -11157,6 +11157,23 @@
 		
 	}
 
+	// init facing axis property of steering actuators
+	{					
+		Object *ob;
+		for(ob = main->object.first; ob; ob = ob->id.next) {
+			bActuator *act;
+			for(act= ob->actuators.first; act; act= act->next) {
+				if(act->type==ACT_STEERING) {
+					bSteeringActuator* stact = act->data;
+					if (stact->facingaxis==0)
+					{
+						stact->facingaxis=1;
+					}						
+				}
+			}
+		}
+	}
+
 	/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
 	/* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */
 

Modified: branches/soc-2010-nicks/source/blender/editors/space_logic/logic_window.c
===================================================================
--- branches/soc-2010-nicks/source/blender/editors/space_logic/logic_window.c	2010-09-03 16:45:33 UTC (rev 31744)
+++ branches/soc-2010-nicks/source/blender/editors/space_logic/logic_window.c	2010-09-03 19:56:22 UTC (rev 31745)
@@ -4336,6 +4336,7 @@
 static void draw_actuator_steering(uiLayout *layout, PointerRNA *ptr)
 {
 	uiLayout *row;
+	uiLayout *col;
 
 	uiItemR(layout, ptr, "mode", 0, NULL, 0);
 	uiItemR(layout, ptr, "target", 0, NULL, 0);
@@ -4346,25 +4347,32 @@
 	uiItemR(row, ptr, "velocity", 0, NULL, 0);
 	row = uiLayoutRow(layout, 0);
 	uiItemR(row, ptr, "acceleration", 0, NULL, 0);
-	uiItemR(row, ptr, "turnspeed", 0, NULL, 0);
+	uiItemR(row, ptr, "turn_speed", 0, NULL, 0);
+	
 	row = uiLayoutRow(layout, 0);
-	uiItemR(row, ptr, "facing", 0, NULL, 0);
-	if (RNA_boolean_get(ptr, "facing"))
+	col = uiLayoutColumn(row, 0);
+	uiItemR(col, ptr, "facing", 0, NULL, 0);
+	col = uiLayoutColumn(row, 0);
+	uiItemR(col, ptr, "facing_axis", 0, NULL, 0);
+	if (!RNA_boolean_get(ptr, "facing"))
 	{
-		uiItemR(row, ptr, "facingaxis", 0, NULL, 0);
+		uiLayoutSetActive(col, 0);
 	}
-	if (RNA_pointer_get(ptr, "navmesh").data)
+	col = uiLayoutColumn(row, 0);
+	uiItemR(col, ptr, "normal_up", 0, NULL, 0);
+	if (!RNA_pointer_get(ptr, "navmesh").data)
 	{
-		uiItemR(row, ptr, "normalup", 0, NULL, 0);		
+		uiLayoutSetActive(col, 0);
 	}
+
 	row = uiLayoutRow(layout, 0);
-	uiItemR(row, ptr, "selfterminated", 0, NULL, 0);
+	uiItemR(row, ptr, "self_terminated", 0, NULL, 0);
 	if (RNA_enum_get(ptr, "mode")==ACT_STEERING_PATHFOLLOWING)
 	{
-		uiItemR(row, ptr, "updateperiod", 0, NULL, 0);	
+		uiItemR(row, ptr, "update_period", 0, NULL, 0);	
 		row = uiLayoutRow(layout, 0);
 	}
-	uiItemR(row, ptr, "enablevisualization", 0, NULL, 0);	
+	uiItemR(row, ptr, "show_visualization", 0, NULL, 0);	
 }
 
 

Modified: branches/soc-2010-nicks/source/blender/makesrna/intern/rna_actuator.c
===================================================================
--- branches/soc-2010-nicks/source/blender/makesrna/intern/rna_actuator.c	2010-09-03 16:45:33 UTC (rev 31744)
+++ branches/soc-2010-nicks/source/blender/makesrna/intern/rna_actuator.c	2010-09-03 19:56:22 UTC (rev 31745)
@@ -1923,10 +1923,10 @@
 	RNA_def_property_ui_text(prop, "Acceleration", "Max acceleration");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
-	prop= RNA_def_property(srna, "turnspeed", PROP_FLOAT, PROP_NONE);
+	prop= RNA_def_property(srna, "turn_speed", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "turnspeed");
 	RNA_def_property_range(prop, 0.0, 720.0);
-	RNA_def_property_ui_text(prop, "Turn speed", "Max turn speed");
+	RNA_def_property_ui_text(prop, "Turn Speed", "Max turn speed");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
 	prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
@@ -1942,17 +1942,17 @@
 	RNA_def_property_ui_text(prop, "Target Object", "Set target object");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
-	prop= RNA_def_property(srna, "selfterminated", PROP_BOOLEAN, PROP_NONE);
+	prop= RNA_def_property(srna, "self_terminated", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_STEERING_SELFTERMINATED);
-	RNA_def_property_ui_text(prop, "Self terminated", "Terminate when target is reached");
+	RNA_def_property_ui_text(prop, "Self Terminated", "Terminate when target is reached");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
-	prop= RNA_def_property(srna, "enablevisualization", PROP_BOOLEAN, PROP_NONE);
+	prop= RNA_def_property(srna, "show_visualization", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_STEERING_ENABLEVISUALIZATION);
 	RNA_def_property_ui_text(prop, "Visualize", "Enable debug visualization");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
-	prop= RNA_def_property(srna, "updateperiod", PROP_INT, PROP_NONE);
+	prop= RNA_def_property(srna, "update_period", PROP_INT, PROP_NONE);
 	RNA_def_property_int_sdna(prop, NULL, "updateTime");
 	RNA_def_property_ui_range(prop, -1, 100000, 1, 1);
 	RNA_def_property_ui_text(prop, "Update period", "Path update period");
@@ -1971,13 +1971,13 @@
 	RNA_def_property_ui_text(prop, "Facing", "Enable automatic facing");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
-	prop= RNA_def_property(srna, "facingaxis", PROP_ENUM, PROP_NONE);
+	prop= RNA_def_property(srna, "facing_axis", PROP_ENUM, PROP_NONE);
 	RNA_def_property_enum_sdna(prop, NULL, "facingaxis");
 	RNA_def_property_enum_items(prop, facingaxis_items);
 	RNA_def_property_ui_text(prop, "Axis", "Axis for automatic facing");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
-	prop= RNA_def_property(srna, "normalup", PROP_BOOLEAN, PROP_NONE);
+	prop= RNA_def_property(srna, "normal_up", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_STEERING_NORMALUP);
 	RNA_def_property_ui_text(prop, "N", "Use normal of the navmesh to set \"UP\" vector");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);

Modified: branches/soc-2010-nicks/source/blender/makesrna/intern/rna_scene.c
===================================================================
--- branches/soc-2010-nicks/source/blender/makesrna/intern/rna_scene.c	2010-09-03 16:45:33 UTC (rev 31744)
+++ branches/soc-2010-nicks/source/blender/makesrna/intern/rna_scene.c	2010-09-03 19:56:22 UTC (rev 31745)
@@ -1519,70 +1519,83 @@
 	RNA_def_struct_nested(brna, srna, "Scene");
 	RNA_def_struct_ui_text(srna, "Recast Data", "Recast data for a Game datablock");
 
-	prop= RNA_def_property(srna, "cellsize", PROP_FLOAT, PROP_NONE);
+	prop= RNA_def_property(srna, "cell_size", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "cellsize");
 	RNA_def_property_ui_range(prop, 0.1, 1, 0.01, 2);
-	RNA_def_property_ui_text(prop, "Cell size", "Rasterized cell size");
+	RNA_def_property_ui_text(prop, "Cell Size", "Rasterized cell size");
 	RNA_def_property_update(prop, NC_SCENE, NULL);
 
-	prop= RNA_def_property(srna, "cellheight", PROP_FLOAT, PROP_NONE);
+	prop= RNA_def_property(srna, "cell_height", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "cellheight");
 	RNA_def_property_ui_range(prop, 0.1, 1, 0.01, 2);
-	RNA_def_property_ui_text(prop, "Cell height", "Rasterized cell height");
+	RNA_def_property_ui_text(prop, "Cell Height", "Rasterized cell height");
 	RNA_def_property_update(prop, NC_SCENE, NULL);
 
-	prop= RNA_def_property(srna, "agentheight", PROP_FLOAT, PROP_NONE);
+	prop= RNA_def_property(srna, "agent_height", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "agentheight");
 	RNA_def_property_ui_range(prop, 0.1, 5, 0.1, 2);
-	RNA_def_property_ui_text(prop, "Agent height", "Minimum height where the agent can still walk");
+	RNA_def_property_ui_text(prop, "Agent Height", "Minimum height where the agent can still walk");
 	RNA_def_property_update(prop, NC_SCENE, NULL);
 
-	prop= RNA_def_property(srna, "agentradius", PROP_FLOAT, PROP_NONE);

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list