Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/makesrna/intern/rna_controller.c')
-rw-r--r--source/blender/makesrna/intern/rna_controller.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/source/blender/makesrna/intern/rna_controller.c b/source/blender/makesrna/intern/rna_controller.c
index fe68fbc6b7c..dd174c668f2 100644
--- a/source/blender/makesrna/intern/rna_controller.c
+++ b/source/blender/makesrna/intern/rna_controller.c
@@ -24,6 +24,7 @@
#include <stdlib.h>
+#include "WM_types.h"
#include "RNA_define.h"
#include "rna_internal.h"
@@ -71,11 +72,14 @@ static struct StructRNA* rna_Controller_refine(struct PointerRNA *ptr)
}
}
-static void rna_Controller_type_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_Controller_type_set(struct PointerRNA *ptr, int value)
{
bController *cont= (bController *)ptr->data;
-
- init_controller(cont);
+ if (value != cont->type)
+ {
+ cont->type = value;
+ init_controller(cont);
+ }
}
#else
@@ -99,23 +103,26 @@ void RNA_def_controller(BlenderRNA *brna)
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ RNA_def_property_enum_funcs(prop, NULL, "rna_Controller_type_set", NULL);
RNA_def_property_enum_items(prop, controller_type_items);
RNA_def_property_ui_text(prop, "Type", "");
-
- RNA_def_property_update(prop, 0, "rna_Controller_type_update");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONT_SHOW);
RNA_def_property_ui_text(prop, "Expanded", "Set controller expanded in the user interface");
RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "priority", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONT_PRIO);
RNA_def_property_ui_text(prop, "Priority", "Mark controller for execution before all non-marked controllers (good for startup scripts)");
RNA_def_property_ui_icon(prop, ICON_BOOKMARKS, 1);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
/* Expression Controller */
srna= RNA_def_struct(brna, "ExpressionController", "Controller");
@@ -126,6 +133,7 @@ void RNA_def_controller(BlenderRNA *brna)
RNA_def_property_string_sdna(prop, NULL, "str");
RNA_def_property_string_maxlength(prop, 127);
RNA_def_property_ui_text(prop, "Expression", "");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
/* Python Controller */
srna= RNA_def_struct(brna, "PythonController", "Controller" );
@@ -135,19 +143,23 @@ void RNA_def_controller(BlenderRNA *brna)
prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, python_controller_modes);
RNA_def_property_ui_text(prop, "Execution Method", "Python script type (textblock or module - faster)");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "Text");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Text", "Text datablock with the python script");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "module", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Module", "Module name and function to run e.g. \"someModule.main\". Internal texts and external python files can be used");
RNA_def_struct_name_property(srna, prop);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
prop= RNA_def_property(srna, "debug", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CONT_PY_DEBUG);
RNA_def_property_ui_text(prop, "D", "Continuously reload the module from disk for editing external modules without restarting");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
/* Other Controllers */
srna= RNA_def_struct(brna, "AndController", "Controller");