[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28600] trunk/blender/source/blender: BGE Logic UI: 2dfilter actuator + object (motino) actuator + commenting out buggy sensors

Dalai Felinto dfelinto at gmail.com
Wed May 5 23:25:35 CEST 2010


Revision: 28600
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28600
Author:   dfelinto
Date:     2010-05-05 23:25:34 +0200 (Wed, 05 May 2010)

Log Message:
-----------
BGE Logic UI: 2dfilter actuator + object (motino) actuator + commenting out buggy sensors

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_logic/logic_window.c
    trunk/blender/source/blender/makesrna/intern/rna_actuator.c

Modified: trunk/blender/source/blender/editors/space_logic/logic_window.c
===================================================================
--- trunk/blender/source/blender/editors/space_logic/logic_window.c	2010-05-05 17:52:55 UTC (rev 28599)
+++ trunk/blender/source/blender/editors/space_logic/logic_window.c	2010-05-05 21:25:34 UTC (rev 28600)
@@ -3221,6 +3221,7 @@
 
 static void draw_sensor_collision(uiLayout *layout, PointerRNA *ptr)
 {
+	uiItemL(layout, "Not ported back yet", 0);
 	//XXXSENSOR
 	/* // need to solve problems in rna_sensor.c
 	uiItemR(layout, ptr, "pulse", 0, NULL, 0);
@@ -3308,8 +3309,6 @@
 	
 	uiItemR(layout, ptr, "target", 0, NULL, 0);
 	uiItemR(layout, ptr, "log", 0, NULL, 0);
-
-	//XXXSENSOR
 }
 
 static void draw_sensor_message(uiLayout *layout, PointerRNA *ptr)
@@ -3375,6 +3374,8 @@
 
 static void draw_sensor_ray(uiLayout *layout, PointerRNA *ptr)
 {
+	uiItemL(layout, "Not ported back yet", 0);
+	/*
 	uiItemR(layout, ptr, "ray_type", 0, NULL, 0);
 	switch (RNA_enum_get(ptr, "ray_type")) {
 		case SENS_RAY_PROPERTY:
@@ -3385,6 +3386,7 @@
 	uiItemR(layout, ptr, "x_ray_mode", 0, NULL, 0);
 	uiItemR(layout, ptr, "range", 0, NULL, 0);
 	uiItemR(layout, ptr, "axis", 0, NULL, 0);
+	*/
 	//XXXSENSOR - same problem as collision. enums badly used by UI code
 }
 
@@ -3576,7 +3578,24 @@
 
 static void draw_actuator_filter_2d(uiLayout *layout, PointerRNA *ptr)
 {
-	//XXXACTUATOR
+	uiLayout *split;
+
+	uiItemR(layout, ptr, "mode", 0, NULL, 0);
+	switch (RNA_enum_get(ptr, "mode"))
+	{
+		case ACT_2DFILTER_CUSTOMFILTER:
+			uiItemR(layout, ptr, "filter_pass", 0, NULL, 0);
+			uiItemR(layout, ptr, "glsl_shader", 0, NULL, 0);
+			break;
+		case ACT_2DFILTER_MOTIONBLUR:
+			split=uiLayoutSplit(layout, 0.9, 0);
+			uiItemR(split, ptr, "motion_blur_value", 0, NULL, 0);
+			uiItemR(split, ptr, "enable_motion_blur", UI_ITEM_R_TOGGLE, NULL, 0);
+			break;
+		default: // all other 2D Filters
+			uiItemR(layout, ptr, "filter_pass", 0, NULL, 0);
+			break;
+	}
 }
 
 static void draw_actuator_game(uiLayout *layout, PointerRNA *ptr)
@@ -3631,7 +3650,75 @@
 
 static void draw_actuator_motion(uiLayout *layout, PointerRNA *ptr)
 {
-	//XXXACTUATOR
+	uiLayout *split, *row, *col, *subcol;
+	uiItemR(layout, ptr, "mode", 0, NULL, 0);
+
+	switch (RNA_enum_get(ptr, "mode")) {
+		case ACT_OBJECT_NORMAL:
+			split = uiLayoutSplit(layout, 0.9, 0);
+			uiItemR(split, ptr, "loc", 0, NULL, 0);
+			uiItemR(split, ptr, "local_location", UI_ITEM_R_TOGGLE, NULL, 0);
+
+			split = uiLayoutSplit(layout, 0.9, 0);
+			uiItemR(split, ptr, "rot", 0, NULL, 0);
+			uiItemR(split, ptr, "local_rotation", UI_ITEM_R_TOGGLE, NULL, 0);
+
+			// Matt, how to check for ob->gameflag here? Do we need to pass the obj through the drawing function only for that?
+//			if ((ob->gameflag & OB_DYNAMIC)==0)
+//				break;
+
+			split = uiLayoutSplit(layout, 0.9, 0);
+			uiItemR(split, ptr, "force", 0, NULL, 0);
+			uiItemR(split, ptr, "local_force", UI_ITEM_R_TOGGLE, NULL, 0);
+
+			split = uiLayoutSplit(layout, 0.9, 0);
+			uiItemR(split, ptr, "torque", 0, NULL, 0);
+			uiItemR(split, ptr, "local_torque", UI_ITEM_R_TOGGLE, NULL, 0);
+
+			split = uiLayoutSplit(layout, 0.9, 0);
+			uiItemR(split, ptr, "linear_velocity", 0, NULL, 0);
+			row = uiLayoutRow(split, 0);
+			uiItemR(row, ptr, "local_linear_velocity", UI_ITEM_R_TOGGLE, NULL, 0);
+			uiItemR(row, ptr, "add_linear_velocity", UI_ITEM_R_TOGGLE, NULL, 0);
+
+			split = uiLayoutSplit(layout, 0.9, 0);
+			uiItemR(split, ptr, "angular_velocity", 0, NULL, 0);
+			uiItemR(split, ptr, "local_angular_velocity", UI_ITEM_R_TOGGLE, NULL, 0);
+
+			uiItemR(layout, ptr, "damping", 0, NULL, 0);
+			break;
+		case ACT_OBJECT_SERVO:
+			uiItemR(layout, ptr, "reference_object", 0, NULL, 0);
+
+			split = uiLayoutSplit(layout, 0.9, 0);
+			uiItemR(split, ptr, "linear_velocity", 0, NULL, 0);
+
+			col = uiLayoutColumn(layout, 0);
+			uiItemR(col, ptr, "servo_limit_x", 0, NULL, 0);
+			subcol = uiLayoutColumn(col, 0);
+			uiLayoutSetActive(subcol, RNA_boolean_get(ptr, "servo_limit_x")==1);
+			uiItemR(subcol, ptr, "force_max_x", 0, NULL, 0);
+			uiItemR(subcol, ptr, "force_min_x", 0, NULL, 0);
+
+			col = uiLayoutColumn(layout, 0);
+			uiItemR(col, ptr, "servo_limit_y", 0, NULL, 0);
+			subcol = uiLayoutColumn(col, 0);
+			uiLayoutSetActive(subcol, RNA_boolean_get(ptr, "servo_limit_y")==1);
+			uiItemR(subcol, ptr, "force_max_y", 0, NULL, 0);
+			uiItemR(subcol, ptr, "force_min_y", 0, NULL, 0);
+
+			col = uiLayoutColumn(layout, 0);
+			uiItemR(col, ptr, "servo_limit_z", 0, NULL, 0);
+			subcol = uiLayoutColumn(col, 0);
+			uiLayoutSetActive(subcol, RNA_boolean_get(ptr, "servo_limit_z")==1);
+			uiItemR(subcol, ptr, "force_max_z", 0, NULL, 0);
+			uiItemR(subcol, ptr, "force_min_z", 0, NULL, 0);
+
+			uiItemR(col, ptr, "proportional_coefficient", 0, NULL, 0);
+			uiItemR(col, ptr, "integral_coefficient", 0, NULL, 0);
+			uiItemR(col, ptr, "derivate_coefficient", 0, NULL, 0);
+			break;
+	}
 }
 
 static void draw_actuator_parent(uiLayout *layout, PointerRNA *ptr)

Modified: trunk/blender/source/blender/makesrna/intern/rna_actuator.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_actuator.c	2010-05-05 17:52:55 UTC (rev 28599)
+++ trunk/blender/source/blender/makesrna/intern/rna_actuator.c	2010-05-05 21:25:34 UTC (rev 28600)
@@ -190,28 +190,43 @@
 	RNA_def_property_ui_text(prop, "Derivate Coefficient", "Not required, high values can cause instability");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
-	/* XXX We need one of those special get/set functions here:
-	int offset
-	if (flag & ACT_SERVO_LIMIT_X):
-		offset = 0
-	elif (flag & ACT_SERVO_LIMIT_Y):
-		offset = 1
-	elif (flag & ACT_SERVO_LIMIT_Z):
-		offset = 2
-	
-	prop= RNA_def_property(srna, "force_max", PROP_FLOAT, PROP_NONE);
-	RNA_def_property_float_sdna(prop, NULL, "dloc[offset]");
+	/* Servo Limit */
+	prop= RNA_def_property(srna, "force_max_x", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "dloc[0]");
 	RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
 	RNA_def_property_ui_text(prop, "Max", "Set the upper limit for force");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
-	prop= RNA_def_property(srna, "force_max", PROP_FLOAT, PROP_NONE);
-	RNA_def_property_float_sdna(prop, NULL, "drot[offset]");
+	prop= RNA_def_property(srna, "force_min_x", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "drot[0]");
 	RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
+	RNA_def_property_ui_text(prop, "Max", "Set the lower limit for force");
+	RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+	prop= RNA_def_property(srna, "force_max_y", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "dloc[0]");
+	RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
 	RNA_def_property_ui_text(prop, "Max", "Set the upper limit for force");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
-	*/
-	
+
+	prop= RNA_def_property(srna, "force_min_y", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "drot[1]");
+	RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
+	RNA_def_property_ui_text(prop, "Max", "Set the lower limit for force");
+	RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+	prop= RNA_def_property(srna, "force_max_z", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "dloc[2]");
+	RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
+	RNA_def_property_ui_text(prop, "Max", "Set the upper limit for force");
+	RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+	prop= RNA_def_property(srna, "force_min_z", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "drot[2]");
+	RNA_def_property_ui_range(prop, -100.0, 100.0, 1.0, 0.1);
+	RNA_def_property_ui_text(prop, "Max", "Set the lower limit for force");
+	RNA_def_property_update(prop, NC_LOGIC, NULL);
+
 	/* floats 3 Arrays*/
 	prop= RNA_def_property(srna, "loc", PROP_FLOAT, PROP_TRANSLATION);
 	RNA_def_property_float_sdna(prop, NULL, "dloc");
@@ -1039,11 +1054,8 @@
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 	
 	/* booleans */
-	// it must be renamed to enable_motion_blur.
-	// it'll require code change and do_version()
-	// or RNA_def_property_boolean_funcs() to flip the boolean value
-	prop= RNA_def_property(srna, "disable_motion_blur", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "flag", 1);
+	prop= RNA_def_property(srna, "enable_motion_blur", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", 1);
 	RNA_def_property_ui_text(prop, "D", "Enable/Disable Motion Blur");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 }





More information about the Bf-blender-cvs mailing list