diff options
Diffstat (limited to 'source/gameengine/Ketsji/KX_PyConstraintBinding.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_PyConstraintBinding.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp index f08fc14c29c..8776bf6fe88 100644 --- a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp +++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp @@ -542,6 +542,18 @@ static PyObject* gPyRemoveConstraint(PyObject* self, Py_RETURN_NONE; } +static PyObject* gPyExportBulletFile(PyObject*, PyObject* args) +{ + char* filename; + if (!PyArg_ParseTuple(args,"s:exportBulletFile",&filename)) + return NULL; + + if (PHY_GetActiveEnvironment()) + { + PHY_GetActiveEnvironment()->exportFile(filename); + } + Py_RETURN_NONE; +} static struct PyMethodDef physicsconstraints_methods[] = { {"setGravity",(PyCFunction) gPySetGravity, @@ -594,6 +606,9 @@ static struct PyMethodDef physicsconstraints_methods[] = { {"getAppliedImpulse",(PyCFunction) gPyGetAppliedImpulse, METH_VARARGS, (const char *)gPyGetAppliedImpulse__doc__}, + {"exportBulletFile",(PyCFunction)gPyExportBulletFile, + METH_VARARGS, "export a .bullet file"}, + //sentinel { NULL, (PyCFunction) NULL, 0, NULL } @@ -664,5 +679,7 @@ PHY_IPhysicsEnvironment* PHY_GetActiveEnvironment() return g_CurrentActivePhysicsEnvironment; } + + #endif // WITH_PYTHON |