diff options
Diffstat (limited to 'source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp index 452c92a77ec..221d531a1c2 100644 --- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp @@ -83,9 +83,11 @@ PyParentObject KX_SCA_ReplaceMeshActuator::Parents[] = { PyMethodDef KX_SCA_ReplaceMeshActuator::Methods[] = { - {"setMesh", (PyCFunction) KX_SCA_ReplaceMeshActuator::sPySetMesh, METH_VARARGS, SetMesh_doc}, - KX_PYMETHODTABLE(KX_SCA_ReplaceMeshActuator, getMesh), - {NULL,NULL} //Sentinel + {"setMesh", (PyCFunction) KX_SCA_ReplaceMeshActuator::sPySetMesh, METH_VARARGS, SetMesh_doc}, + + KX_PYMETHODTABLE(KX_SCA_ReplaceMeshActuator, instantReplaceMesh), + KX_PYMETHODTABLE(KX_SCA_ReplaceMeshActuator, getMesh), + {NULL,NULL} //Sentinel }; @@ -135,6 +137,14 @@ KX_PYMETHODDEF_DOC(KX_SCA_ReplaceMeshActuator, getMesh, return PyString_FromString(const_cast<char *>(m_mesh->GetName().ReadPtr())); } + +KX_PYMETHODDEF_DOC(KX_SCA_ReplaceMeshActuator, instantReplaceMesh, +"instantReplaceMesh() : immediately replace mesh without delay\n") +{ + InstantReplaceMesh(); + Py_Return; +} + /* ------------------------------------------------------------------------- */ /* Native functions */ /* ------------------------------------------------------------------------- */ @@ -191,4 +201,9 @@ CValue* KX_SCA_ReplaceMeshActuator::GetReplica() return replica; }; +void KX_SCA_ReplaceMeshActuator::InstantReplaceMesh() +{ + if (m_mesh) m_scene->ReplaceMesh(GetParent(),m_mesh); +} + /* eof */ |