From 388a364bc90480d32a04968f4a2d09d99840a131 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 28 Jan 2013 06:06:55 +0000 Subject: fix annoyance noticed at the global-game-jam, adding controllers would remember previous name. Would add 'And' controllers and name them 'Python1' for eg. --- source/blender/editors/space_logic/logic_ops.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'source/blender/editors/space_logic') diff --git a/source/blender/editors/space_logic/logic_ops.c b/source/blender/editors/space_logic/logic_ops.c index f28757bb431..47029d800c0 100644 --- a/source/blender/editors/space_logic/logic_ops.c +++ b/source/blender/editors/space_logic/logic_ops.c @@ -330,8 +330,10 @@ static void LOGIC_OT_sensor_add(wmOperatorType *ot) /* 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 int controller_add_exec(bContext *C, wmOperator *op) 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 @@ static void LOGIC_OT_controller_add(wmOperatorType *ot) /* 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 @@ static void LOGIC_OT_actuator_add(wmOperatorType *ot) /* 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 ************* */ -- cgit v1.2.3