forked from bartvdbraak/blender
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 ;)
This commit is contained in:
parent
05e2e92611
commit
9768796926
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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;}
|
||||
|
Loading…
Reference in New Issue
Block a user