diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2010-05-07 05:30:12 +0400 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2010-05-07 05:30:12 +0400 |
commit | 97687969266c5df6ec0d797692dd13576db4bf70 (patch) | |
tree | db11b90e94767a97431f490a8cd7905b0d81ac48 /source | |
parent | 05e2e92611970689cd224715f594b817c69beae0 (diff) |
Logic UI: State Actuator done :) all actuators are there now. [and stubs update]
(it's a small commit, but couldn't help not doing it ;)
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_logic/logic_window.c | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_actuator.c | 34 | ||||
-rw-r--r-- | source/blenderplayer/bad_level_call_stubs/stubs.c | 1 |
3 files changed, 32 insertions, 9 deletions
diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 9bc8a944fe1..91a0dd9ee4f 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -4170,7 +4170,11 @@ static void draw_actuator_sound(uiLayout *layout, PointerRNA *ptr, bContext *C) static void draw_actuator_state(uiLayout *layout, PointerRNA *ptr) { - //XXXACTUATOR + uiLayout *split; + split = uiLayoutSplit(layout, 0.35, 0); + uiItemR(split, ptr, "operation", 0, NULL, 0); + + uiTemplateLayers(split, ptr, "state", NULL, NULL, 0); } static void draw_actuator_visibility(uiLayout *layout, PointerRNA *ptr) diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c index ab2999129c0..ff735d35ade 100644 --- a/source/blender/makesrna/intern/rna_actuator.c +++ b/source/blender/makesrna/intern/rna_actuator.c @@ -131,6 +131,27 @@ static void rna_ObjectActuator_integralcoefficient_set(struct PointerRNA *ptr, f oa->forcerot[0] = 60.0f*oa->forcerot[1]; } +static void rna_StateActuator_state_set(PointerRNA *ptr, const int *values) +{ + bActuator *act = (bActuator*)ptr->data; + bStateActuator *sa = act->data; + + int i, tot= 0; + + /* ensure we always have some state selected */ + for(i=0; i<OB_MAX_STATES; i++) + if(values[i]) + tot++; + + if(tot==0) + return; + + for(i=0; i<OB_MAX_STATES; i++) { + if(values[i]) sa->mask |= (1<<i); + else sa->mask &= ~(1<<i); + } +} + static EnumPropertyItem *rna_EditObjectActuator_mode_itemf(bContext *C, PointerRNA *ptr, int *free) { EnumPropertyItem *item= NULL; @@ -1597,14 +1618,11 @@ static void rna_def_state_actuator(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Operation", "Select the bit operation on object state mask"); RNA_def_property_update(prop, NC_LOGIC, NULL); -/* - XXX mask needs a template or to use RNA layer type - prop= RNA_def_property(srna, "mask", PROP_BOOLEAN, PROP_LAYER); - RNA_def_property_array(prop, 20); -*/ - prop= RNA_def_property(srna, "mask", PROP_INT, PROP_NONE); - RNA_def_property_ui_text(prop, "Mask", ""); - RNA_def_property_update(prop, NC_LOGIC, NULL); + prop= RNA_def_property(srna, "state", PROP_BOOLEAN, PROP_LAYER_MEMBER); + RNA_def_property_boolean_sdna(prop, NULL, "mask", 1); + RNA_def_property_array(prop, OB_MAX_STATES); + RNA_def_property_ui_text(prop, "State", ""); + RNA_def_property_boolean_funcs(prop, NULL, "rna_StateActuator_state_set"); } static void rna_def_armature_actuator(BlenderRNA *brna) diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index ee892a39ef0..3bfdcdb5aef 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -188,6 +188,7 @@ int WM_keymap_item_compare(struct wmKeyMapItem *k1, struct wmKeyMapItem *k2){ret /* rna editors */ +struct FCurve *verify_fcurve (struct bAction *act, const char group[], const char rna_path[], const int array_index, short add){return (struct FCurve *) NULL;} int insert_vert_fcurve(struct FCurve *fcu, float x, float y, short flag){return 0;} void delete_fcurve_key(struct FCurve *fcu, int index, short do_recalc){} struct KeyingSetInfo *ANIM_keyingset_info_find_named (const char name[]){return (struct KeyingSetInfo *) NULL;} |