Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/gameengine/Converter/BL_ActionActuator.cpp')
-rw-r--r--source/gameengine/Converter/BL_ActionActuator.cpp55
1 files changed, 27 insertions, 28 deletions
diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp
index 662d6b7a63e..e4dd588f06a 100644
--- a/source/gameengine/Converter/BL_ActionActuator.cpp
+++ b/source/gameengine/Converter/BL_ActionActuator.cpp
@@ -66,9 +66,9 @@ BL_ActionActuator::~BL_ActionActuator()
game_free_pose(m_blendpose);
}
-void BL_ActionActuator::ProcessReplica(){
-// bPose *oldpose = m_pose;
-// bPose *oldbpose = m_blendpose;
+void BL_ActionActuator::ProcessReplica()
+{
+ SCA_IActuator::ProcessReplica();
m_pose = NULL;
m_blendpose = NULL;
@@ -84,9 +84,6 @@ void BL_ActionActuator::SetBlendTime (float newtime){
CValue* BL_ActionActuator::GetReplica() {
BL_ActionActuator* replica = new BL_ActionActuator(*this);//m_float,GetName());
replica->ProcessReplica();
-
- // this will copy properties and so on...
- CValue::AddDataToReplica(replica);
return replica;
}
@@ -159,16 +156,9 @@ bool BL_ActionActuator::Update(double curtime, bool frame)
// maybe there are events for us in the queue !
if (frame)
{
- for (vector<CValue*>::iterator i=m_events.begin(); !(i==m_events.end());i++)
- {
- if ((*i)->GetNumber() == 0.0f)
- bNegativeEvent = true;
- else
- bPositiveEvent= true;
- (*i)->Release();
-
- }
- m_events.clear();
+ bNegativeEvent = m_negevent;
+ bPositiveEvent = m_posevent;
+ RemoveAllEvents();
if (bPositiveEvent)
m_flag |= ACT_FLAG_ACTIVE;
@@ -945,8 +935,13 @@ KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel,
/* ------------------------------------------------------------------------- */
PyTypeObject BL_ActionActuator::Type = {
- PyObject_HEAD_INIT(NULL)
- 0,
+#if (PY_VERSION_HEX >= 0x02060000)
+ PyVarObject_HEAD_INIT(NULL, 0)
+#else
+ /* python 2.5 and below */
+ PyObject_HEAD_INIT( NULL ) /* required py macro */
+ 0, /* ob_size */
+#endif
"BL_ActionActuator",
sizeof(PyObjectPlus_Proxy),
0,
@@ -1002,17 +997,17 @@ PyMethodDef BL_ActionActuator::Methods[] = {
};
PyAttributeDef BL_ActionActuator::Attributes[] = {
- KX_PYATTRIBUTE_FLOAT_RW("start", 0, MAXFRAMEF, BL_ActionActuator, m_startframe),
- KX_PYATTRIBUTE_FLOAT_RW("end", 0, MAXFRAMEF, BL_ActionActuator, m_endframe),
- KX_PYATTRIBUTE_FLOAT_RW("blendin", 0, MAXFRAMEF, BL_ActionActuator, m_blendin),
+ KX_PYATTRIBUTE_FLOAT_RW("frameStart", 0, MAXFRAMEF, BL_ActionActuator, m_startframe),
+ KX_PYATTRIBUTE_FLOAT_RW("frameEnd", 0, MAXFRAMEF, BL_ActionActuator, m_endframe),
+ KX_PYATTRIBUTE_FLOAT_RW("blendIn", 0, MAXFRAMEF, BL_ActionActuator, m_blendin),
KX_PYATTRIBUTE_RW_FUNCTION("action", BL_ActionActuator, pyattr_get_action, pyattr_set_action),
KX_PYATTRIBUTE_SHORT_RW("priority", 0, 100, false, BL_ActionActuator, m_priority),
KX_PYATTRIBUTE_FLOAT_RW_CHECK("frame", 0, MAXFRAMEF, BL_ActionActuator, m_localtime, CheckFrame),
- KX_PYATTRIBUTE_STRING_RW("property", 0, 31, false, BL_ActionActuator, m_propname),
- KX_PYATTRIBUTE_STRING_RW("frameProperty", 0, 31, false, BL_ActionActuator, m_framepropname),
- KX_PYATTRIBUTE_BOOL_RW("continue", BL_ActionActuator, m_end_reset),
+ KX_PYATTRIBUTE_STRING_RW("propName", 0, 31, false, BL_ActionActuator, m_propname),
+ KX_PYATTRIBUTE_STRING_RW("framePropName", 0, 31, false, BL_ActionActuator, m_framepropname),
+ KX_PYATTRIBUTE_BOOL_RW("useContinue", BL_ActionActuator, m_end_reset),
KX_PYATTRIBUTE_FLOAT_RW_CHECK("blendTime", 0, MAXFRAMEF, BL_ActionActuator, m_blendframe, CheckBlendTime),
- KX_PYATTRIBUTE_SHORT_RW_CHECK("type",0,100,false,BL_ActionActuator,m_playtype,CheckType),
+ KX_PYATTRIBUTE_SHORT_RW_CHECK("mode",0,100,false,BL_ActionActuator,m_playtype,CheckType),
{ NULL } //Sentinel
};
@@ -1020,6 +1015,10 @@ PyObject* BL_ActionActuator::py_getattro(PyObject *attr) {
py_getattro_up(SCA_IActuator);
}
+PyObject* BL_ActionActuator::py_getattro_dict() {
+ py_getattro_dict_up(SCA_IActuator);
+}
+
int BL_ActionActuator::py_setattro(PyObject *attr, PyObject* value) {
py_setattro_up(SCA_IActuator);
}
@@ -1038,7 +1037,7 @@ int BL_ActionActuator::pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF
if (!PyString_Check(value))
{
PyErr_SetString(PyExc_ValueError, "actuator.action = val: Action Actuator, expected the string name of the action");
- return -1;
+ return PY_SET_ATTR_FAIL;
}
bAction *action= NULL;
@@ -1050,11 +1049,11 @@ int BL_ActionActuator::pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF
if (!action)
{
PyErr_SetString(PyExc_ValueError, "actuator.action = val: Action Actuator, action not found!");
- return 1;
+ return PY_SET_ATTR_FAIL;
}
}
self->SetAction(action);
- return 0;
+ return PY_SET_ATTR_SUCCESS;
}