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:
authorDalai Felinto <dfelinto@gmail.com>2010-05-06 23:12:08 +0400
committerDalai Felinto <dfelinto@gmail.com>2010-05-06 23:12:08 +0400
commit6e3812d7bc645b0731cf17a0d7d82d1bdac7d678 (patch)
tree6823cbf5556c438e439ad12f39d7fdd8d7abf66c /source/blender/makesrna/intern/rna_controller.c
parentc9ca41c6f1dd4734ea6c7566ebd61f82bd41633f (diff)
Logic UI: constraint actuator+rna 100% (finally !!!) + other fixes/improvements:
- s/c/a type enum update function replaced by set function - rna_Sensor_type_itemf and rna_Actuators_type_itemf implemented (but not working ... it was working yesterday before I updated the set func, so need further investigation). Matt, if you have any clue on that ... Roadmap: i) I definitively gotta unify the maxloc, minloc rna properties. the way it's right now (based on 2.49 makes the layout code really clunky ii) - actuator missing - State Actuator (I'll probably need help on that). iii) - sensor missing - collision and ray (they are partly implemented, but the enums are a mess there). iv) - get/set funcs missing (not many) and default values (not many) v) - have more lookup functions for properties and material (I'll definitively need help on that). Eventually will fix (iii, iv and v) changing bge and dna code and doing a subversion/do_version.
Diffstat (limited to 'source/blender/makesrna/intern/rna_controller.c')
-rw-r--r--source/blender/makesrna/intern/rna_controller.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/makesrna/intern/rna_controller.c b/source/blender/makesrna/intern/rna_controller.c
index fe68fbc6b7c..3d44730cf76 100644
--- a/source/blender/makesrna/intern/rna_controller.c
+++ b/source/blender/makesrna/intern/rna_controller.c
@@ -71,11 +71,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
@@ -102,11 +105,10 @@ void RNA_def_controller(BlenderRNA *brna)
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");
-
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");