diff options
Diffstat (limited to 'source/gameengine/Ketsji/KX_GameObject.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_GameObject.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 35fe956b0e8..334868d283a 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -367,11 +367,11 @@ bool KX_GameObject::PlayAction(const char* name, short priority, float blendin, short play_mode, - short blend_mode, + float layer_weight, short ipo_flags, float playback_speed) { - return GetActionManager()->PlayAction(name, start, end, layer, priority, blendin, play_mode, blend_mode, ipo_flags, playback_speed); + return GetActionManager()->PlayAction(name, start, end, layer, priority, blendin, play_mode, layer_weight, ipo_flags, playback_speed); } void KX_GameObject::StopAction(short layer) @@ -3037,19 +3037,19 @@ KX_PYMETHODDEF_DOC_VARARGS(KX_GameObject, sendMessage, } KX_PYMETHODDEF_DOC(KX_GameObject, playAction, - "playAction(name, start_frame, end_frame, layer=0, priority=0 blendin=0, play_mode=ACT_MODE_PLAY, blend_mode=ACT_BLEND_NONE, ipo_flags=0, speed=1.0)\n" + "playAction(name, start_frame, end_frame, layer=0, priority=0 blendin=0, play_mode=ACT_MODE_PLAY, layer_weight=0.0, ipo_flags=0, speed=1.0)\n" "plays an action\n") { const char* name; - float start, end, blendin=0.f, speed=1.f; + float start, end, blendin=0.f, speed=1.f, layer_weight=0.f; short layer=0, priority=0; short ipo_flags=0; - short play_mode=0, blend_mode=0; + short play_mode=0; - static const char *kwlist[] = {"name", "start_frame", "end_frame", "layer", "priority", "blendin", "play_mode", "blend_mode", "ipo_flags", "speed", NULL}; + static const char *kwlist[] = {"name", "start_frame", "end_frame", "layer", "priority", "blendin", "play_mode", "layer_weight", "ipo_flags", "speed", NULL}; - if (!PyArg_ParseTupleAndKeywords(args, kwds, "sff|hhfhhhf:playAction", const_cast<char**>(kwlist), - &name, &start, &end, &layer, &priority, &blendin, &play_mode, &blend_mode, &ipo_flags, &speed)) + if (!PyArg_ParseTupleAndKeywords(args, kwds, "sff|hhfhfhf:playAction", const_cast<char**>(kwlist), + &name, &start, &end, &layer, &priority, &blendin, &play_mode, &layer_weight, &ipo_flags, &speed)) return NULL; if (layer < 0 || layer > MAX_ACTION_LAYERS) @@ -3064,13 +3064,13 @@ KX_PYMETHODDEF_DOC(KX_GameObject, playAction, play_mode = BL_Action::ACT_MODE_MAX; } - if (blend_mode < 0 || blend_mode > BL_Action::ACT_BLEND_MAX) + if (layer_weight < 0.f || layer_weight > 1.f) { - printf("KX_GameObject.playAction(): given blend_mode (%d) is out of range (0 - %d), setting to ACT_BLEND_NONE", blend_mode, BL_Action::ACT_BLEND_MAX-1); - blend_mode = BL_Action::ACT_BLEND_NONE; + printf("KX_GameObject.playAction(): given layer_weight (%f) is out of range (0.0 - 1.0), setting to 0.0", layer_weight); + layer_weight = 0.f; } - PlayAction(name, start, end, layer, priority, blendin, play_mode, blend_mode, ipo_flags, speed); + PlayAction(name, start, end, layer, priority, blendin, play_mode, layer_weight, ipo_flags, speed); Py_RETURN_NONE; } |