diff options
Diffstat (limited to 'source/gameengine/Ketsji/KX_PyConstraintBinding.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_PyConstraintBinding.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp index f08fc14c29c..bf288e1f1ad 100644 --- a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp +++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp @@ -405,6 +405,7 @@ static PyObject* gPyCreateConstraint(PyObject* self, PyObject* args, PyObject* kwds) { + /* FIXME - physicsid is an int being cast to a pointer, should at least use PyCapsule */ int physicsid=0,physicsid2 = 0,constrainttype=0,extrainfo=0; int len = PyTuple_Size(args); int success = 1; @@ -542,6 +543,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 +607,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 +680,7 @@ PHY_IPhysicsEnvironment* PHY_GetActiveEnvironment() return g_CurrentActivePhysicsEnvironment; } + + #endif // WITH_PYTHON |