From 2909a4988b2895d067a3626b47a68aaa9b61c737 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Sat, 8 May 2010 19:52:13 +0000 Subject: Logic UI: add notifiers for sensors and controllers (so the ui updates if you change the value through script) + some layout adjusments. --- source/blender/makesrna/intern/rna_controller.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source/blender/makesrna/intern/rna_controller.c') diff --git a/source/blender/makesrna/intern/rna_controller.c b/source/blender/makesrna/intern/rna_controller.c index 3d44730cf76..dd174c668f2 100644 --- a/source/blender/makesrna/intern/rna_controller.c +++ b/source/blender/makesrna/intern/rna_controller.c @@ -24,6 +24,7 @@ #include +#include "WM_types.h" #include "RNA_define.h" #include "rna_internal.h" @@ -102,22 +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, 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"); @@ -128,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" ); @@ -137,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"); -- cgit v1.2.3