diff options
Diffstat (limited to 'source/gameengine/Converter/BL_ActionActuator.cpp')
-rw-r--r-- | source/gameengine/Converter/BL_ActionActuator.cpp | 91 |
1 files changed, 47 insertions, 44 deletions
diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index d8b2e063a9d..4d748948c27 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -50,6 +50,7 @@ #include "MT_Matrix4x4.h" #include "BKE_utildefines.h" #include "FloatValue.h" +#include "PyObjectPlus.h" #ifdef HAVE_CONFIG_H #include <config.h> @@ -58,11 +59,11 @@ BL_ActionActuator::~BL_ActionActuator() { if (m_pose) - free_pose(m_pose); + game_free_pose(m_pose); if (m_userpose) - free_pose(m_userpose); + game_free_pose(m_userpose); if (m_blendpose) - free_pose(m_blendpose); + game_free_pose(m_blendpose); } void BL_ActionActuator::ProcessReplica(){ @@ -151,6 +152,8 @@ bool BL_ActionActuator::Update(double curtime, bool frame) bool apply=true; int priority; float newweight; + + curtime -= KX_KetsjiEngine::GetSuspendedDelta(); // result = true if animation has to be continued, false if animation stops // maybe there are events for us in the queue ! @@ -445,28 +448,28 @@ PyParentObject BL_ActionActuator::Parents[] = { }; PyMethodDef BL_ActionActuator::Methods[] = { - {"setAction", (PyCFunction) BL_ActionActuator::sPySetAction, METH_VARARGS, SetAction_doc}, - {"setStart", (PyCFunction) BL_ActionActuator::sPySetStart, METH_VARARGS, SetStart_doc}, - {"setEnd", (PyCFunction) BL_ActionActuator::sPySetEnd, METH_VARARGS, SetEnd_doc}, - {"setBlendin", (PyCFunction) BL_ActionActuator::sPySetBlendin, METH_VARARGS, SetBlendin_doc}, - {"setPriority", (PyCFunction) BL_ActionActuator::sPySetPriority, METH_VARARGS, SetPriority_doc}, - {"setFrame", (PyCFunction) BL_ActionActuator::sPySetFrame, METH_VARARGS, SetFrame_doc}, - {"setProperty", (PyCFunction) BL_ActionActuator::sPySetProperty, METH_VARARGS, SetProperty_doc}, - {"setFrameProperty", (PyCFunction) BL_ActionActuator::sPySetFrameProperty, METH_VARARGS, SetFrameProperty_doc}, - {"setBlendtime", (PyCFunction) BL_ActionActuator::sPySetBlendtime, METH_VARARGS, SetBlendtime_doc}, - - {"getAction", (PyCFunction) BL_ActionActuator::sPyGetAction, METH_VARARGS, GetAction_doc}, - {"getStart", (PyCFunction) BL_ActionActuator::sPyGetStart, METH_VARARGS, GetStart_doc}, - {"getEnd", (PyCFunction) BL_ActionActuator::sPyGetEnd, METH_VARARGS, GetEnd_doc}, - {"getBlendin", (PyCFunction) BL_ActionActuator::sPyGetBlendin, METH_VARARGS, GetBlendin_doc}, - {"getPriority", (PyCFunction) BL_ActionActuator::sPyGetPriority, METH_VARARGS, GetPriority_doc}, - {"getFrame", (PyCFunction) BL_ActionActuator::sPyGetFrame, METH_VARARGS, GetFrame_doc}, - {"getProperty", (PyCFunction) BL_ActionActuator::sPyGetProperty, METH_VARARGS, GetProperty_doc}, - {"getFrameProperty", (PyCFunction) BL_ActionActuator::sPyGetFrameProperty, METH_VARARGS, GetFrameProperty_doc}, - {"setChannel", (PyCFunction) BL_ActionActuator::sPySetChannel, METH_VARARGS, SetChannel_doc}, + {"setAction", (PyCFunction) BL_ActionActuator::sPySetAction, METH_VARARGS, (PY_METHODCHAR)SetAction_doc}, + {"setStart", (PyCFunction) BL_ActionActuator::sPySetStart, METH_VARARGS, (PY_METHODCHAR)SetStart_doc}, + {"setEnd", (PyCFunction) BL_ActionActuator::sPySetEnd, METH_VARARGS, (PY_METHODCHAR)SetEnd_doc}, + {"setBlendin", (PyCFunction) BL_ActionActuator::sPySetBlendin, METH_VARARGS, (PY_METHODCHAR)SetBlendin_doc}, + {"setPriority", (PyCFunction) BL_ActionActuator::sPySetPriority, METH_VARARGS, (PY_METHODCHAR)SetPriority_doc}, + {"setFrame", (PyCFunction) BL_ActionActuator::sPySetFrame, METH_VARARGS, (PY_METHODCHAR)SetFrame_doc}, + {"setProperty", (PyCFunction) BL_ActionActuator::sPySetProperty, METH_VARARGS, (PY_METHODCHAR)SetProperty_doc}, + {"setFrameProperty", (PyCFunction) BL_ActionActuator::sPySetFrameProperty, METH_VARARGS, (PY_METHODCHAR)SetFrameProperty_doc}, + {"setBlendtime", (PyCFunction) BL_ActionActuator::sPySetBlendtime, METH_VARARGS, (PY_METHODCHAR)SetBlendtime_doc}, + + {"getAction", (PyCFunction) BL_ActionActuator::sPyGetAction, METH_VARARGS, (PY_METHODCHAR)GetAction_doc}, + {"getStart", (PyCFunction) BL_ActionActuator::sPyGetStart, METH_VARARGS, (PY_METHODCHAR)GetStart_doc}, + {"getEnd", (PyCFunction) BL_ActionActuator::sPyGetEnd, METH_VARARGS, (PY_METHODCHAR)GetEnd_doc}, + {"getBlendin", (PyCFunction) BL_ActionActuator::sPyGetBlendin, METH_VARARGS, (PY_METHODCHAR)GetBlendin_doc}, + {"getPriority", (PyCFunction) BL_ActionActuator::sPyGetPriority, METH_VARARGS, (PY_METHODCHAR)GetPriority_doc}, + {"getFrame", (PyCFunction) BL_ActionActuator::sPyGetFrame, METH_VARARGS, (PY_METHODCHAR)GetFrame_doc}, + {"getProperty", (PyCFunction) BL_ActionActuator::sPyGetProperty, METH_VARARGS, (PY_METHODCHAR)GetProperty_doc}, + {"getFrameProperty", (PyCFunction) BL_ActionActuator::sPyGetFrameProperty, METH_VARARGS, (PY_METHODCHAR)GetFrameProperty_doc}, + {"setChannel", (PyCFunction) BL_ActionActuator::sPySetChannel, METH_VARARGS, (PY_METHODCHAR)SetChannel_doc}, // {"getChannel", (PyCFunction) BL_ActionActuator::sPyGetChannel, METH_VARARGS}, - {"getType", (PyCFunction) BL_ActionActuator::sPyGetType, METH_VARARGS, GetType_doc}, - {"setType", (PyCFunction) BL_ActionActuator::sPySetType, METH_VARARGS, SetType_doc}, + {"getType", (PyCFunction) BL_ActionActuator::sPyGetType, METH_VARARGS, (PY_METHODCHAR)GetType_doc}, + {"setType", (PyCFunction) BL_ActionActuator::sPySetType, METH_VARARGS, (PY_METHODCHAR)SetType_doc}, {"getContinue", (PyCFunction) BL_ActionActuator::sPyGetContinue, METH_NOARGS, 0}, {"setContinue", (PyCFunction) BL_ActionActuator::sPySetContinue, METH_O, 0}, {NULL,NULL} //Sentinel @@ -477,7 +480,7 @@ PyObject* BL_ActionActuator::_getattr(const STR_String& attr) { } /* setStart */ -char BL_ActionActuator::GetAction_doc[] = +const char BL_ActionActuator::GetAction_doc[] = "getAction()\n" "\tReturns a string containing the name of the current action.\n"; @@ -491,7 +494,7 @@ PyObject* BL_ActionActuator::PyGetAction(PyObject* self, } /* getProperty */ -char BL_ActionActuator::GetProperty_doc[] = +const char BL_ActionActuator::GetProperty_doc[] = "getProperty()\n" "\tReturns the name of the property to be used in FromProp mode.\n"; @@ -506,7 +509,7 @@ PyObject* BL_ActionActuator::PyGetProperty(PyObject* self, } /* getProperty */ -char BL_ActionActuator::GetFrameProperty_doc[] = +const char BL_ActionActuator::GetFrameProperty_doc[] = "getFrameProperty()\n" "\tReturns the name of the property, that is set to the current frame number.\n"; @@ -521,7 +524,7 @@ PyObject* BL_ActionActuator::PyGetFrameProperty(PyObject* self, } /* getFrame */ -char BL_ActionActuator::GetFrame_doc[] = +const char BL_ActionActuator::GetFrame_doc[] = "getFrame()\n" "\tReturns the current frame number.\n"; @@ -536,7 +539,7 @@ PyObject* BL_ActionActuator::PyGetFrame(PyObject* self, } /* getEnd */ -char BL_ActionActuator::GetEnd_doc[] = +const char BL_ActionActuator::GetEnd_doc[] = "getEnd()\n" "\tReturns the last frame of the action.\n"; @@ -551,7 +554,7 @@ PyObject* BL_ActionActuator::PyGetEnd(PyObject* self, } /* getStart */ -char BL_ActionActuator::GetStart_doc[] = +const char BL_ActionActuator::GetStart_doc[] = "getStart()\n" "\tReturns the starting frame of the action.\n"; @@ -566,7 +569,7 @@ PyObject* BL_ActionActuator::PyGetStart(PyObject* self, } /* getBlendin */ -char BL_ActionActuator::GetBlendin_doc[] = +const char BL_ActionActuator::GetBlendin_doc[] = "getBlendin()\n" "\tReturns the number of interpolation animation frames to be\n" "\tgenerated when this actuator is triggered.\n"; @@ -582,7 +585,7 @@ PyObject* BL_ActionActuator::PyGetBlendin(PyObject* self, } /* getPriority */ -char BL_ActionActuator::GetPriority_doc[] = +const char BL_ActionActuator::GetPriority_doc[] = "getPriority()\n" "\tReturns the priority for this actuator. Actuators with lower\n" "\tPriority numbers will override actuators with higher numbers.\n"; @@ -598,7 +601,7 @@ PyObject* BL_ActionActuator::PyGetPriority(PyObject* self, } /* setAction */ -char BL_ActionActuator::SetAction_doc[] = +const char BL_ActionActuator::SetAction_doc[] = "setAction(action, (reset))\n" "\t - action : The name of the action to set as the current action.\n" "\t - reset : Optional parameter indicating whether to reset the\n" @@ -637,7 +640,7 @@ PyObject* BL_ActionActuator::PySetAction(PyObject* self, } /* setStart */ -char BL_ActionActuator::SetStart_doc[] = +const char BL_ActionActuator::SetStart_doc[] = "setStart(start)\n" "\t - start : Specifies the starting frame of the animation.\n"; @@ -658,7 +661,7 @@ PyObject* BL_ActionActuator::PySetStart(PyObject* self, } /* setEnd */ -char BL_ActionActuator::SetEnd_doc[] = +const char BL_ActionActuator::SetEnd_doc[] = "setEnd(end)\n" "\t - end : Specifies the ending frame of the animation.\n"; @@ -679,7 +682,7 @@ PyObject* BL_ActionActuator::PySetEnd(PyObject* self, } /* setBlendin */ -char BL_ActionActuator::SetBlendin_doc[] = +const char BL_ActionActuator::SetBlendin_doc[] = "setBlendin(blendin)\n" "\t - blendin : Specifies the number of frames of animation to generate\n" "\t when making transitions between actions.\n"; @@ -701,7 +704,7 @@ PyObject* BL_ActionActuator::PySetBlendin(PyObject* self, } /* setBlendtime */ -char BL_ActionActuator::SetBlendtime_doc[] = +const char BL_ActionActuator::SetBlendtime_doc[] = "setBlendtime(blendtime)\n" "\t - blendtime : Allows the script to directly modify the internal timer\n" "\t used when generating transitions between actions. This\n" @@ -728,7 +731,7 @@ PyObject* BL_ActionActuator::PySetBlendtime(PyObject* self, } /* setPriority */ -char BL_ActionActuator::SetPriority_doc[] = +const char BL_ActionActuator::SetPriority_doc[] = "setPriority(priority)\n" "\t - priority : Specifies the new priority. Actuators will lower\n" "\t priority numbers will override actuators with higher\n" @@ -751,7 +754,7 @@ PyObject* BL_ActionActuator::PySetPriority(PyObject* self, } /* setFrame */ -char BL_ActionActuator::SetFrame_doc[] = +const char BL_ActionActuator::SetFrame_doc[] = "setFrame(frame)\n" "\t - frame : Specifies the new current frame for the animation\n"; @@ -776,7 +779,7 @@ PyObject* BL_ActionActuator::PySetFrame(PyObject* self, } /* setProperty */ -char BL_ActionActuator::SetProperty_doc[] = +const char BL_ActionActuator::SetProperty_doc[] = "setProperty(prop)\n" "\t - prop : A string specifying the property name to be used in\n" "\t FromProp playback mode.\n"; @@ -798,7 +801,7 @@ PyObject* BL_ActionActuator::PySetProperty(PyObject* self, } /* setFrameProperty */ -char BL_ActionActuator::SetFrameProperty_doc[] = +const char BL_ActionActuator::SetFrameProperty_doc[] = "setFrameProperty(prop)\n" "\t - prop : A string specifying the property of the frame set up update.\n"; @@ -837,7 +840,7 @@ PyObject* BL_ActionActuator::PyGetChannel(PyObject* self, */ /* setChannel */ -char BL_ActionActuator::SetChannel_doc[] = +const char BL_ActionActuator::SetChannel_doc[] = "setChannel(channel, matrix)\n" "\t - channel : A string specifying the name of the bone channel.\n" "\t - matrix : A 4x4 matrix specifying the overriding transformation\n" @@ -921,7 +924,7 @@ PyObject* BL_ActionActuator::PySetChannel(PyObject* self, } /* getType */ -char BL_ActionActuator::GetType_doc[] = +const char BL_ActionActuator::GetType_doc[] = "getType()\n" "\tReturns the operation mode of the actuator.\n"; PyObject* BL_ActionActuator::PyGetType(PyObject* self, @@ -931,7 +934,7 @@ PyObject* BL_ActionActuator::PyGetType(PyObject* self, } /* setType */ -char BL_ActionActuator::SetType_doc[] = +const char BL_ActionActuator::SetType_doc[] = "setType(mode)\n" "\t - mode: Play (0), Flipper (2), LoopStop (3), LoopEnd (4) or Property (6)\n" "\tSet the operation mode of the actuator.\n"; |