[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54136] trunk/blender/source/blender/ editors/space_logic/logic_ops.c: fix annoyance noticed at the global-game-jam, adding controllers would remember previous name.

Campbell Barton ideasman42 at gmail.com
Mon Jan 28 07:07:10 CET 2013


Revision: 54136
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54136
Author:   campbellbarton
Date:     2013-01-28 06:06:55 +0000 (Mon, 28 Jan 2013)
Log Message:
-----------
fix annoyance noticed at the global-game-jam, adding controllers would remember previous name. Would add 'And' controllers and name them 'Python1' for eg.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_logic/logic_ops.c

Modified: trunk/blender/source/blender/editors/space_logic/logic_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_logic/logic_ops.c	2013-01-28 04:10:47 UTC (rev 54135)
+++ trunk/blender/source/blender/editors/space_logic/logic_ops.c	2013-01-28 06:06:55 UTC (rev 54136)
@@ -330,8 +330,10 @@
 	/* properties */
 	ot->prop = prop = RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, SENS_ALWAYS, "Type", "Type of sensor to add");
 	RNA_def_enum_funcs(prop, rna_Sensor_type_itemf);
-	RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Sensor to add");
-	RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Sensor to");
+	prop = RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Sensor to add");
+	RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+	prop = RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Sensor to");
+	RNA_def_property_flag(prop, PROP_SKIP_SAVE);
 }
 
 /* ************* Add/Remove Controller Operator ************* */
@@ -433,6 +435,8 @@
 
 static void LOGIC_OT_controller_add(wmOperatorType *ot)
 {
+	PropertyRNA *prop;
+
 	/* identifiers */
 	ot->name = "Add Controller";
 	ot->description = "Add a controller to the active object";
@@ -448,8 +452,10 @@
 	
 	/* properties */
 	ot->prop = RNA_def_enum(ot->srna, "type", controller_type_items, CONT_LOGIC_AND, "Type", "Type of controller to add");
-	RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Controller to add");
-	RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Controller to");
+	prop = RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Controller to add");
+	RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+	prop = RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Controller to");
+	RNA_def_property_flag(prop, PROP_SKIP_SAVE);
 }
 
 /* ************* Add/Remove Actuator Operator ************* */
@@ -551,8 +557,10 @@
 	/* properties */
 	ot->prop = prop = RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, CONT_LOGIC_AND, "Type", "Type of actuator to add");
 	RNA_def_enum_funcs(prop, rna_Actuator_type_itemf);
-	RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Actuator to add");
-	RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Actuator to");
+	prop = RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Actuator to add");
+	RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+	prop = RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Actuator to");
+	RNA_def_property_flag(prop, PROP_SKIP_SAVE);
 }
 
 /* ************* Move Logic Bricks Operator ************* */




More information about the Bf-blender-cvs mailing list