From 6e3812d7bc645b0731cf17a0d7d82d1bdac7d678 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Thu, 6 May 2010 19:12:08 +0000 Subject: 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. --- source/blender/makesrna/intern/rna_controller.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (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 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"); -- cgit v1.2.3