[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28694] trunk/blender/source/blender: Improved the Ray Sensor UI in the updated Logic Editor.

William Reynish william at reynish.com
Mon May 10 02:12:36 CEST 2010


Revision: 28694
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28694
Author:   billrey
Date:     2010-05-10 02:12:36 +0200 (Mon, 10 May 2010)

Log Message:
-----------
Improved the Ray Sensor UI in the updated Logic Editor.

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

Modified: trunk/blender/source/blender/editors/space_logic/logic_window.c
===================================================================
--- trunk/blender/source/blender/editors/space_logic/logic_window.c	2010-05-09 21:37:53 UTC (rev 28693)
+++ trunk/blender/source/blender/editors/space_logic/logic_window.c	2010-05-10 00:12:36 UTC (rev 28694)
@@ -3405,19 +3405,19 @@
 	uiLayout *split, *row;
 
 	split= uiLayoutSplit(layout, 0.3, 0);
-	uiItemR(split, ptr, "ray_type", UI_ITEM_R_TOGGLE, NULL, 0);
+	uiItemR(split, ptr, "ray_type", 0, "", 0);
 	switch (RNA_enum_get(ptr, "ray_type")) {
 		case SENS_RAY_PROPERTY:
-			uiItemR(split, ptr, "property", 0, NULL, 0); break;
+			uiItemR(split, ptr, "property", 0, "", 0); break;
 		case SENS_RAY_MATERIAL:
-			uiItemR(split, ptr, "material", 0, NULL, 0); break;
+			uiItemR(split, ptr, "material", 0, "", 0); break;
 	}
 
 	split= uiLayoutSplit(layout, 0.3, 0);
-	uiItemR(split, ptr, "x_ray_mode", UI_ITEM_R_TOGGLE, NULL, 0);
-	row= uiLayoutRow(split, 0);
+	uiItemR(split, ptr, "axis", 0, "", 0);
+	row= uiLayoutRow(split, 0);	
 	uiItemR(row, ptr, "range", 0, NULL, 0);
-	uiItemR(row, ptr, "axis", 0, NULL, 0);
+	uiItemR(row, ptr, "x_ray_mode", UI_ITEM_R_TOGGLE, NULL, 0);
 }
 
 static void draw_sensor_touch(uiLayout *layout, PointerRNA *ptr)

Modified: trunk/blender/source/blender/makesrna/intern/rna_sensor.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_sensor.c	2010-05-09 21:37:53 UTC (rev 28693)
+++ trunk/blender/source/blender/makesrna/intern/rna_sensor.c	2010-05-10 00:12:36 UTC (rev 28694)
@@ -592,10 +592,21 @@
 		{SENS_RAY_NEG_Y_AXIS, "NEGYAXIS", 0, "-Y axis", ""},
 		{SENS_RAY_NEG_Z_AXIS, "NEGZAXIS", 0, "-Z axis", ""},
 		{0, NULL, 0, NULL, NULL}};
+	
+	static const EnumPropertyItem prop_ray_type_items[]= {
+		{0, "PROPERTY", ICON_LOGIC, "Property", "Use a material for ray intersections"},
+		{SENS_COLLISION_MATERIAL, "MATERIAL", ICON_MATERIAL_DATA, "Material", "Use a property for ray intersections"},
+		{0, NULL, 0, NULL, NULL}};
 
 	srna= RNA_def_struct(brna, "RaySensor", "Sensor");
 	RNA_def_struct_ui_text(srna, "Ray Sensor", "Sensor to detect intersections with a ray emanating from the current object");
 	RNA_def_struct_sdna_from(srna, "bRaySensor", "data");
+	
+	prop= RNA_def_property(srna, "ray_type", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_bitflag_sdna(prop, NULL, "mode");
+	RNA_def_property_enum_items(prop, prop_ray_type_items);
+	RNA_def_property_ui_text(prop, "Ray Type", "Toggle collision on material or property");
+	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
 	prop= RNA_def_property(srna, "property", PROP_STRING, PROP_NONE);
 	RNA_def_property_string_sdna(prop, NULL, "propname");
@@ -616,11 +627,6 @@
 	RNA_def_property_ui_text(prop, "Material", "Only look for Objects with this material");
 */
 
-	prop= RNA_def_property(srna, "ray_type", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "mode", SENS_COLLISION_MATERIAL);
-	RNA_def_property_ui_text(prop, "M/P", "Toggle collision on material or property");
-	RNA_def_property_update(prop, NC_LOGIC, NULL);
-
 	prop= RNA_def_property(srna, "x_ray_mode", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "mode", SENS_RAY_XRAY);
 	RNA_def_property_ui_text(prop, "X-Ray Mode", "Toggle X-Ray option (see through objects that don't have the property)");





More information about the Bf-blender-cvs mailing list