When put in playaction a incorrect name the console show “Failed to load action: Action”, (Action=name our action). So I look source code and I am coming to search “Falied to load” for to know where is done the comprobation if action is correct but I don’t find result
And I found this that seem the playaction function
KX_PYMETHODDEF_DOC(KX_GameObject, playAction,
"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)
"
"Plays an action
")
{
const char* name;
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;
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|hhfhfhf:playAction", const_cast<char**>(kwlist),
&name, &start, &end, &layer, &priority, &blendin, &play_mode, &layer_weight, &ipo_flags, &speed))
return NULL;
layer_check(layer, "playAction");
if (play_mode < 0 || play_mode > BL_Action::ACT_MODE_MAX)
{
printf("KX_GameObject.playAction(): given play_mode (%d) is out of range (0 - %d), setting to ACT_MODE_PLAY", play_mode, BL_Action::ACT_MODE_MAX-1);
play_mode = BL_Action::ACT_MODE_MAX;
}
if (layer_weight < 0.f || layer_weight > 1.f)
{
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, layer_weight, ipo_flags, speed);
Py_RETURN_NONE;
}
I believe that
layer_check(layer, "playAction");
is the function, but “playAction” isn’t variable. Maybe this function is that I search, but I don’t know where is his code
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;
Maybe if I find where it’s done the comprobation I can add a function to KX_GameObject