BGE Animations: Removing guards that prevent the action actuator from being used on non-armatures. Object animation works through this actuator now too. :)

This commit is contained in:
Mitchell Stokes 2011-06-01 06:43:10 +00:00
parent 23888be423
commit 6394261e54
3 changed files with 21 additions and 29 deletions

@ -3679,10 +3679,6 @@ static void draw_actuator_action(uiLayout *layout, PointerRNA *ptr)
PointerRNA settings_ptr; PointerRNA settings_ptr;
uiLayout *row; uiLayout *row;
if(ob->type != OB_ARMATURE){
uiItemL(layout, "Actuator only available for armatures", ICON_NONE);
return;
}
RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob, &settings_ptr); RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob, &settings_ptr);
row= uiLayoutRow(layout, 0); row= uiLayoutRow(layout, 0);

@ -426,11 +426,11 @@ EnumPropertyItem *rna_Actuator_type_itemf(bContext *C, PointerRNA *ptr, Property
if (ob != NULL) { if (ob != NULL) {
if (ob->type==OB_ARMATURE) { if (ob->type==OB_ARMATURE) {
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_ACTION);
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_ARMATURE); RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_ARMATURE);
} }
} }
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_ACTION);
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_CAMERA); RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_CAMERA);
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_CONSTRAINT); RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_CONSTRAINT);
RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_EDIT_OBJECT); RNA_enum_items_add_value(&item, &totitem, actuator_type_items, ACT_EDIT_OBJECT);

@ -191,30 +191,26 @@ void BL_ConvertActuators(char* maggiename,
} }
case ACT_ACTION: case ACT_ACTION:
{ {
if (blenderobject->type==OB_ARMATURE){ bActionActuator* actact = (bActionActuator*) bact->data;
bActionActuator* actact = (bActionActuator*) bact->data; STR_String propname = (actact->name ? actact->name : "");
STR_String propname = (actact->name ? actact->name : ""); STR_String propframe = (actact->frameProp ? actact->frameProp : "");
STR_String propframe = (actact->frameProp ? actact->frameProp : "");
BL_ActionActuator* tmpbaseact = new BL_ActionActuator( BL_ActionActuator* tmpbaseact = new BL_ActionActuator(
gameobj, gameobj,
propname, propname,
propframe, propframe,
actact->sta, actact->sta,
actact->end, actact->end,
actact->act, actact->act,
actact->type, // + 1, because Blender starts to count at zero, actact->type, // + 1, because Blender starts to count at zero,
actact->blendin, actact->blendin,
actact->priority, actact->priority,
actact->end_reset, actact->end_reset,
actact->stridelength actact->stridelength
// Ketsji at 1, because zero is reserved for "NoDef" // Ketsji at 1, because zero is reserved for "NoDef"
); );
baseact= tmpbaseact; baseact= tmpbaseact;
break; break;
}
else
printf ("Discarded action actuator from non-armature object [%s]\n", blenderobject->id.name+2);
} }
case ACT_SHAPEACTION: case ACT_SHAPEACTION:
{ {