From 0a23895f95382a8c6d5c36bc8b36802c4474eb2e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 25 Aug 2009 22:51:18 +0000 Subject: remove all python api functions deprecated in 2.49 --- .../Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp | 85 ------ .../Ketsji/KXNetwork/KX_NetworkMessageActuator.h | 7 - .../Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp | 89 ------ .../Ketsji/KXNetwork/KX_NetworkMessageSensor.h | 8 - source/gameengine/Ketsji/KX_Camera.cpp | 92 ------ source/gameengine/Ketsji/KX_Camera.h | 3 - source/gameengine/Ketsji/KX_CameraActuator.cpp | 157 ---------- source/gameengine/Ketsji/KX_CameraActuator.h | 12 - source/gameengine/Ketsji/KX_ConstraintActuator.cpp | 338 --------------------- source/gameengine/Ketsji/KX_ConstraintActuator.h | 22 -- source/gameengine/Ketsji/KX_GameActuator.cpp | 37 --- source/gameengine/Ketsji/KX_GameActuator.h | 5 - source/gameengine/Ketsji/KX_GameObject.cpp | 163 +--------- source/gameengine/Ketsji/KX_GameObject.h | 12 +- source/gameengine/Ketsji/KX_IpoActuator.cpp | 248 --------------- source/gameengine/Ketsji/KX_IpoActuator.h | 17 -- source/gameengine/Ketsji/KX_MeshProxy.cpp | 20 -- source/gameengine/Ketsji/KX_MouseFocusSensor.cpp | 79 ----- source/gameengine/Ketsji/KX_MouseFocusSensor.h | 8 - source/gameengine/Ketsji/KX_ObjectActuator.cpp | 327 -------------------- source/gameengine/Ketsji/KX_ObjectActuator.h | 23 -- source/gameengine/Ketsji/KX_ParentActuator.cpp | 55 ---- source/gameengine/Ketsji/KX_ParentActuator.h | 5 - source/gameengine/Ketsji/KX_PythonInit.cpp | 2 - source/gameengine/Ketsji/KX_RadarSensor.cpp | 54 +--- source/gameengine/Ketsji/KX_RadarSensor.h | 5 - source/gameengine/Ketsji/KX_RaySensor.cpp | 71 ----- source/gameengine/Ketsji/KX_RaySensor.h | 6 - .../gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp | 209 ------------- .../gameengine/Ketsji/KX_SCA_AddObjectActuator.h | 19 -- .../gameengine/Ketsji/KX_SCA_DynamicActuator.cpp | 39 --- source/gameengine/Ketsji/KX_SCA_DynamicActuator.h | 5 - .../Ketsji/KX_SCA_ReplaceMeshActuator.cpp | 34 --- .../gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h | 7 +- source/gameengine/Ketsji/KX_Scene.cpp | 30 -- source/gameengine/Ketsji/KX_Scene.h | 21 +- source/gameengine/Ketsji/KX_SceneActuator.cpp | 121 -------- source/gameengine/Ketsji/KX_SceneActuator.h | 16 - source/gameengine/Ketsji/KX_SoundActuator.cpp | 117 ------- source/gameengine/Ketsji/KX_SoundActuator.h | 12 - source/gameengine/Ketsji/KX_StateActuator.cpp | 55 ---- source/gameengine/Ketsji/KX_StateActuator.h | 4 +- source/gameengine/Ketsji/KX_TouchSensor.cpp | 105 ------- source/gameengine/Ketsji/KX_TouchSensor.h | 17 -- source/gameengine/Ketsji/KX_TrackToActuator.cpp | 127 -------- source/gameengine/Ketsji/KX_TrackToActuator.h | 13 - source/gameengine/Ketsji/KX_VisibilityActuator.cpp | 27 -- source/gameengine/Ketsji/KX_VisibilityActuator.h | 5 - 48 files changed, 17 insertions(+), 2916 deletions(-) (limited to 'source/gameengine/Ketsji') diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp index 410cf308217..3af8f765251 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp @@ -123,16 +123,6 @@ PyTypeObject KX_NetworkMessageActuator::Type = { }; PyMethodDef KX_NetworkMessageActuator::Methods[] = { - // Deprecated -----> - {"setToPropName", (PyCFunction) - KX_NetworkMessageActuator::sPySetToPropName, METH_VARARGS}, - {"setSubject", (PyCFunction) - KX_NetworkMessageActuator::sPySetSubject, METH_VARARGS}, - {"setBodyType", (PyCFunction) - KX_NetworkMessageActuator::sPySetBodyType, METH_VARARGS}, - {"setBody", (PyCFunction) - KX_NetworkMessageActuator::sPySetBody, METH_VARARGS}, - // <----- {NULL,NULL} // Sentinel }; @@ -143,78 +133,3 @@ PyAttributeDef KX_NetworkMessageActuator::Attributes[] = { KX_PYATTRIBUTE_STRING_RW("body", 0, 16384, false, KX_NetworkMessageActuator, m_body), { NULL } //Sentinel }; - -// Deprecated -----> -// 1. SetToPropName -PyObject* KX_NetworkMessageActuator::PySetToPropName( - PyObject* args, - PyObject* kwds) -{ - ShowDeprecationWarning("setToProp()", "the propName property"); - char* ToPropName; - - if (PyArg_ParseTuple(args, "s:setToPropName", &ToPropName)) { - m_toPropName = ToPropName; - } - else { - return NULL; - } - - Py_RETURN_NONE; -} - -// 2. SetSubject -PyObject* KX_NetworkMessageActuator::PySetSubject( - PyObject* args, - PyObject* kwds) -{ - ShowDeprecationWarning("setSubject()", "the subject property"); - char* Subject; - - if (PyArg_ParseTuple(args, "s:setSubject", &Subject)) { - m_subject = Subject; - } - else { - return NULL; - } - - Py_RETURN_NONE; -} - -// 3. SetBodyType -PyObject* KX_NetworkMessageActuator::PySetBodyType( - PyObject* args, - PyObject* kwds) -{ - ShowDeprecationWarning("setBodyType()", "the usePropBody property"); - int BodyType; - - if (PyArg_ParseTuple(args, "i:setBodyType", &BodyType)) { - m_bPropBody = (BodyType != 0); - } - else { - return NULL; - } - - Py_RETURN_NONE; -} - -// 4. SetBody -PyObject* KX_NetworkMessageActuator::PySetBody( - PyObject* args, - PyObject* kwds) -{ - ShowDeprecationWarning("setBody()", "the body property"); - char* Body; - - if (PyArg_ParseTuple(args, "s:setBody", &Body)) { - m_body = Body; - } - else { - return NULL; - } - - Py_RETURN_NONE; -} - -// <----- Deprecated diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h index b4f55f2a466..fa7a674c250 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h @@ -60,13 +60,6 @@ public: /* Python interface ------------------------------------------- */ /* ------------------------------------------------------------ */ - // Deprecated -----> - KX_PYMETHOD(KX_NetworkMessageActuator, SetToPropName); - KX_PYMETHOD(KX_NetworkMessageActuator, SetSubject); - KX_PYMETHOD(KX_NetworkMessageActuator, SetBodyType); - KX_PYMETHOD(KX_NetworkMessageActuator, SetBody); - // <----- - }; #endif //__KX_NETWORKMESSAGEACTUATOR_H diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp index 779c75b484f..392e9dd9d1b 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp @@ -186,23 +186,6 @@ PyTypeObject KX_NetworkMessageSensor::Type = { }; PyMethodDef KX_NetworkMessageSensor::Methods[] = { - // Deprecated -----> - {"setSubjectFilterText", (PyCFunction) - KX_NetworkMessageSensor::sPySetSubjectFilterText, METH_O, - (const char *)SetSubjectFilterText_doc}, - {"getFrameMessageCount", (PyCFunction) - KX_NetworkMessageSensor::sPyGetFrameMessageCount, METH_NOARGS, - (const char *)GetFrameMessageCount_doc}, - {"getBodies", (PyCFunction) - KX_NetworkMessageSensor::sPyGetBodies, METH_NOARGS, - (const char *)GetBodies_doc}, - {"getSubject", (PyCFunction) - KX_NetworkMessageSensor::sPyGetSubject, METH_NOARGS, - (const char *)GetSubject_doc}, - {"getSubjects", (PyCFunction) - KX_NetworkMessageSensor::sPyGetSubjects, METH_NOARGS, - (const char *)GetSubjects_doc}, - // <----- {NULL,NULL} //Sentinel }; @@ -233,75 +216,3 @@ PyObject* KX_NetworkMessageSensor::pyattr_get_subjects(void *self_v, const KX_PY return (new CListValue())->NewProxy(true); } } - -// Deprecated -----> -// 1. Set the message subject that this sensor listens for -const char KX_NetworkMessageSensor::SetSubjectFilterText_doc[] = -"\tsetSubjectFilterText(value)\n" -"\tChange the message subject text that this sensor is listening to.\n"; - -PyObject* KX_NetworkMessageSensor::PySetSubjectFilterText(PyObject* value) -{ - ShowDeprecationWarning("setSubjectFilterText()", "subject"); - char* Subject = _PyUnicode_AsString(value); - if (Subject==NULL) { - PyErr_SetString(PyExc_TypeError, "sensor.tsetSubjectFilterText(string): KX_NetworkMessageSensor, expected a string message"); - return NULL; - } - - m_subject = Subject; - Py_RETURN_NONE; -} - -// 2. Get the number of messages received since the last frame -const char KX_NetworkMessageSensor::GetFrameMessageCount_doc[] = -"\tgetFrameMessageCount()\n" -"\tGet the number of messages received since the last frame.\n"; - -PyObject* KX_NetworkMessageSensor::PyGetFrameMessageCount() -{ - ShowDeprecationWarning("getFrameMessageCount()", "frameMessageCount"); - return PyLong_FromSsize_t(long(m_frame_message_count)); -} - -// 3. Get the message bodies -const char KX_NetworkMessageSensor::GetBodies_doc[] = -"\tgetBodies()\n" -"\tGet the list of message bodies.\n"; - -PyObject* KX_NetworkMessageSensor::PyGetBodies() -{ - ShowDeprecationWarning("getBodies()", "bodies"); - if (m_BodyList) { - return m_BodyList->GetProxy(); - } else { - return (new CListValue())->NewProxy(true); - } -} - -// 4. Get the message subject: field of the message sensor -const char KX_NetworkMessageSensor::GetSubject_doc[] = -"\tgetSubject()\n" -"\tGet the subject: field of the message sensor.\n"; - -PyObject* KX_NetworkMessageSensor::PyGetSubject() -{ - ShowDeprecationWarning("getSubject()", "subject"); - return PyUnicode_FromString(m_subject ? m_subject : ""); -} - -// 5. Get the message subjects -const char KX_NetworkMessageSensor::GetSubjects_doc[] = -"\tgetSubjects()\n" -"\tGet list of message subjects.\n"; - -PyObject* KX_NetworkMessageSensor::PyGetSubjects() -{ - ShowDeprecationWarning("getSubjects()", "subjects"); - if (m_SubjectList) { - return m_SubjectList->GetProxy(); - } else { - return (new CListValue())->NewProxy(true); - } -} -// <----- Deprecated diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h index c955e560e0a..d8a0651d2f1 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h @@ -70,14 +70,6 @@ public: /* Python interface -------------------------------------------- */ /* ------------------------------------------------------------- */ - // Deprecated -----> - KX_PYMETHOD_DOC_O(KX_NetworkMessageSensor, SetSubjectFilterText); - KX_PYMETHOD_DOC_NOARGS(KX_NetworkMessageSensor, GetFrameMessageCount); - KX_PYMETHOD_DOC_NOARGS(KX_NetworkMessageSensor, GetBodies); - KX_PYMETHOD_DOC_NOARGS(KX_NetworkMessageSensor, GetSubject); - KX_PYMETHOD_DOC_NOARGS(KX_NetworkMessageSensor, GetSubjects); - // <----- - /* attributes */ static PyObject* pyattr_get_bodies(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_subjects(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index fd289a0b55e..0832809772d 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -496,12 +496,6 @@ PyMethodDef KX_Camera::Methods[] = { KX_PYMETHODTABLE_O(KX_Camera, getScreenPosition), KX_PYMETHODTABLE(KX_Camera, getScreenVect), KX_PYMETHODTABLE(KX_Camera, getScreenRay), - - // DEPRECATED - KX_PYMETHODTABLE_O(KX_Camera, enableViewport), - KX_PYMETHODTABLE_NOARGS(KX_Camera, getProjectionMatrix), - KX_PYMETHODTABLE_O(KX_Camera, setProjectionMatrix), - {NULL,NULL} //Sentinel }; @@ -680,92 +674,6 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_Camera, getWorldToCamera, return PyObjectFrom(GetWorldToCamera()); /* new ref */ } -KX_PYMETHODDEF_DOC_NOARGS(KX_Camera, getProjectionMatrix, -"getProjectionMatrix() -> Matrix4x4\n" -"\treturns this camera's projection matrix, as a list of four lists of four values.\n\n" -"\tie: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]])\n" -) -{ - ShowDeprecationWarning("getProjectionMatrix()", "the projection_matrix property"); - return PyObjectFrom(GetProjectionMatrix()); /* new ref */ -} - -KX_PYMETHODDEF_DOC_O(KX_Camera, setProjectionMatrix, -"setProjectionMatrix(MT_Matrix4x4 m) -> None\n" -"\tSets this camera's projection matrix\n" -"\n" -"\tExample:\n" -"\timport GameLogic\n" -"\t# Set a perspective projection matrix\n" -"\tdef Perspective(left, right, bottom, top, near, far):\n" -"\t\tm = MT_Matrix4x4()\n" -"\t\tm[0][0] = m[0][2] = right - left\n" -"\t\tm[1][1] = m[1][2] = top - bottom\n" -"\t\tm[2][2] = m[2][3] = -far - near\n" -"\t\tm[3][2] = -1\n" -"\t\tm[3][3] = 0\n" -"\t\treturn m\n" -"\n" -"\t# Set an orthographic projection matrix\n" -"\tdef Orthographic(left, right, bottom, top, near, far):\n" -"\t\tm = MT_Matrix4x4()\n" -"\t\tm[0][0] = right - left\n" -"\t\tm[0][3] = -right - left\n" -"\t\tm[1][1] = top - bottom\n" -"\t\tm[1][3] = -top - bottom\n" -"\t\tm[2][2] = far - near\n" -"\t\tm[2][3] = -far - near\n" -"\t\tm[3][3] = 1\n" -"\t\treturn m\n" -"\n" -"\t# Set an isometric projection matrix\n" -"\tdef Isometric(left, right, bottom, top, near, far):\n" -"\t\tm = MT_Matrix4x4()\n" -"\t\tm[0][0] = m[0][2] = m[1][1] = 0.8660254037844386\n" -"\t\tm[1][0] = 0.25\n" -"\t\tm[1][2] = -0.25\n" -"\t\tm[3][3] = 1\n" -"\t\treturn m\n" -"\n" -"\t" -"\tco = GameLogic.getCurrentController()\n" -"\tcam = co.getOwner()\n" -"\tcam.setProjectionMatrix(Perspective(-1.0, 1.0, -1.0, 1.0, 0.1, 1))\n") -{ - ShowDeprecationWarning("setProjectionMatrix(mat)", "the projection_matrix property"); - - MT_Matrix4x4 mat; - if (!PyMatTo(value, mat)) - { - PyErr_SetString(PyExc_TypeError, "camera.setProjectionMatrix(matrix): KX_Camera, expected 4x4 list as matrix argument."); - return NULL; - } - - SetProjectionMatrix(mat); - Py_RETURN_NONE; -} - -KX_PYMETHODDEF_DOC_O(KX_Camera, enableViewport, -"enableViewport(viewport)\n" -"Sets this camera's viewport status\n" -) -{ - ShowDeprecationWarning("enableViewport(bool)", "the useViewport property"); - - int viewport = PyObject_IsTrue(value); - if (viewport == -1) { - PyErr_SetString(PyExc_ValueError, "camera.enableViewport(bool): KX_Camera, expected True/False or 0/1"); - return NULL; - } - - if(viewport) - EnableViewport(true); - else - EnableViewport(false); - - Py_RETURN_NONE; -} - KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, setViewport, "setViewport(left, bottom, right, top)\n" "Sets this camera's viewport\n") diff --git a/source/gameengine/Ketsji/KX_Camera.h b/source/gameengine/Ketsji/KX_Camera.h index 74c8e6d4e4f..bf7a39d93c8 100644 --- a/source/gameengine/Ketsji/KX_Camera.h +++ b/source/gameengine/Ketsji/KX_Camera.h @@ -273,10 +273,7 @@ public: KX_PYMETHOD_DOC_NOARGS(KX_Camera, getCameraToWorld); KX_PYMETHOD_DOC_NOARGS(KX_Camera, getWorldToCamera); - KX_PYMETHOD_DOC_NOARGS(KX_Camera, getProjectionMatrix); - KX_PYMETHOD_DOC_O(KX_Camera, setProjectionMatrix); - KX_PYMETHOD_DOC_O(KX_Camera, enableViewport); KX_PYMETHOD_DOC_VARARGS(KX_Camera, setViewport); KX_PYMETHOD_DOC_NOARGS(KX_Camera, setOnTop); diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp index b5a0a63cf68..9c00b5991af 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.cpp +++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp @@ -378,17 +378,6 @@ PyTypeObject KX_CameraActuator::Type = { }; PyMethodDef KX_CameraActuator::Methods[] = { - // ---> deprecated (all) - {"setObject",(PyCFunction) KX_CameraActuator::sPySetObject, METH_O, (const char *)SetObject_doc}, - {"getObject",(PyCFunction) KX_CameraActuator::sPyGetObject, METH_VARARGS, (const char *)GetObject_doc}, - {"setMin" ,(PyCFunction) KX_CameraActuator::sPySetMin, METH_VARARGS, (const char *)SetMin_doc}, - {"getMin" ,(PyCFunction) KX_CameraActuator::sPyGetMin, METH_NOARGS, (const char *)GetMin_doc}, - {"setMax" ,(PyCFunction) KX_CameraActuator::sPySetMax, METH_VARARGS, (const char *)SetMax_doc}, - {"getMax" ,(PyCFunction) KX_CameraActuator::sPyGetMax, METH_NOARGS, (const char *)GetMax_doc}, - {"setHeight",(PyCFunction) KX_CameraActuator::sPySetHeight, METH_VARARGS, (const char *)SetHeight_doc}, - {"getHeight",(PyCFunction) KX_CameraActuator::sPyGetHeight, METH_NOARGS, (const char *)GetHeight_doc}, - {"setXY" ,(PyCFunction) KX_CameraActuator::sPySetXY, METH_VARARGS, (const char *)SetXY_doc}, - {"getXY" ,(PyCFunction) KX_CameraActuator::sPyGetXY, METH_NOARGS, (const char *)GetXY_doc}, {NULL,NULL,NULL,NULL} //Sentinel }; @@ -401,152 +390,6 @@ PyAttributeDef KX_CameraActuator::Attributes[] = { {NULL} }; -/* get obj ---------------------------------------------------------- */ -const char KX_CameraActuator::GetObject_doc[] = -"getObject(name_only = 1)\n" -"name_only - optional arg, when true will return the KX_GameObject rather then its name\n" -"\tReturns the object this sensor reacts to.\n"; -PyObject* KX_CameraActuator::PyGetObject(PyObject* args) -{ - int ret_name_only = 1; - - ShowDeprecationWarning("getObject()", "the object property"); - - if (!PyArg_ParseTuple(args, "|i:getObject", &ret_name_only)) - return NULL; - - if (!m_ob) - Py_RETURN_NONE; - - if (ret_name_only) - return PyUnicode_FromString(m_ob->GetName().ReadPtr()); - else - return m_ob->GetProxy(); -} -/* set obj ---------------------------------------------------------- */ -const char KX_CameraActuator::SetObject_doc[] = -"setObject(object)\n" -"\t- object: KX_GameObject, string or None\n" -"\tSets the object this sensor reacts to.\n"; -PyObject* KX_CameraActuator::PySetObject(PyObject* value) -{ - KX_GameObject *gameobj; - - ShowDeprecationWarning("setObject()", "the object property"); - - if (!ConvertPythonToGameObject(value, &gameobj, true, "actuator.setObject(value): KX_CameraActuator")) - return NULL; // ConvertPythonToGameObject sets the error - - if (m_ob != NULL) - m_ob->UnregisterActuator(this); - - m_ob = (SCA_IObject*)gameobj; - if (m_ob) - m_ob->RegisterActuator(this); - - Py_RETURN_NONE; -} - -/* get min ---------------------------------------------------------- */ -const char KX_CameraActuator::GetMin_doc[] = -"getMin\n" -"\tReturns the minimum value set in the Min: field.\n"; -PyObject* KX_CameraActuator::PyGetMin() -{ - ShowDeprecationWarning("getMin()", "the min property"); - return PyFloat_FromDouble(m_minHeight); -} -/* set min ---------------------------------------------------------- */ -const char KX_CameraActuator::SetMin_doc[] = -"setMin\n" -"\tSets the minimum value.\n"; -PyObject* KX_CameraActuator::PySetMin(PyObject* args) -{ - ShowDeprecationWarning("setMin()", "the min property"); - float min; - if(PyArg_ParseTuple(args,"f:setMin", &min)) - { - m_minHeight = min; - Py_RETURN_NONE; - } - return NULL; -} -/* get min ---------------------------------------------------------- */ -const char KX_CameraActuator::GetMax_doc[] = -"getMax\n" -"\tReturns the maximum value set in the Max: field.\n"; -PyObject* KX_CameraActuator::PyGetMax() -{ - ShowDeprecationWarning("getMax()", "the max property"); - return PyFloat_FromDouble(m_maxHeight); -} -/* set min ---------------------------------------------------------- */ -const char KX_CameraActuator::SetMax_doc[] = -"setMax\n" -"\tSets the maximum value.\n"; -PyObject* KX_CameraActuator::PySetMax(PyObject* args) -{ - ShowDeprecationWarning("getMax()", "the max property"); - float max; - if(PyArg_ParseTuple(args,"f:setMax", &max)) - { - m_maxHeight = max; - Py_RETURN_NONE; - } - return NULL; -} -/* get height ---------------------------------------------------------- */ -const char KX_CameraActuator::GetHeight_doc[] = -"getHeight\n" -"\tReturns the height value set in the height: field.\n"; -PyObject* KX_CameraActuator::PyGetHeight() -{ - ShowDeprecationWarning("getHeight()", "the height property"); - return PyFloat_FromDouble(m_height); -} -/* set height ---------------------------------------------------------- */ -const char KX_CameraActuator::SetHeight_doc[] = -"setHeight\n" -"\tSets the height value.\n"; -PyObject* KX_CameraActuator::PySetHeight(PyObject* args) -{ - ShowDeprecationWarning("getHeight()", "the height property"); - float height; - if(PyArg_ParseTuple(args,"f:setHeight", &height)) - { - m_height = height; - Py_RETURN_NONE; - } - return NULL; -} -/* set XY ---------------------------------------------------------- */ -const char KX_CameraActuator::SetXY_doc[] = -"setXY\n" -"\tSets axis the camera tries to get behind.\n" -"\t1=x, 0=y\n"; -PyObject* KX_CameraActuator::PySetXY(PyObject* args) -{ - ShowDeprecationWarning("setXY()", "the useXY property"); - int value; - if(PyArg_ParseTuple(args,"i:setXY", &value)) - { - m_x = value != 0; - Py_RETURN_NONE; - } - return NULL; -} - -/* get XY -------------------------------------------------------------*/ -const char KX_CameraActuator::GetXY_doc[] = -"getXY\n" -"\tGets the axis the camera tries to get behind.\n" -"\tTrue = X, False = Y\n"; -PyObject* KX_CameraActuator::PyGetXY() -{ - ShowDeprecationWarning("getXY()", "the xy property"); - return PyLong_FromSsize_t(m_x); -} - PyObject* KX_CameraActuator::pyattr_get_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_CameraActuator* self= static_cast(self_v); diff --git a/source/gameengine/Ketsji/KX_CameraActuator.h b/source/gameengine/Ketsji/KX_CameraActuator.h index 057c6fed770..e047e3724ea 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.h +++ b/source/gameengine/Ketsji/KX_CameraActuator.h @@ -119,18 +119,6 @@ private : /* --------------------------------------------------------------------- */ /* set object to look at */ - KX_PYMETHOD_DOC_O(KX_CameraActuator,SetObject); - /* get current object */ - KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,GetObject); - KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,SetMin); - KX_PYMETHOD_DOC_NOARGS(KX_CameraActuator,GetMin); - KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,SetMax); - KX_PYMETHOD_DOC_NOARGS(KX_CameraActuator,GetMax); - KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,SetHeight); - KX_PYMETHOD_DOC_NOARGS(KX_CameraActuator,GetHeight); - KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,SetXY); - KX_PYMETHOD_DOC_NOARGS(KX_CameraActuator,GetXY); - static PyObject* pyattr_get_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp index 5f6244c3ab6..7f1d2c7d53c 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp @@ -587,30 +587,6 @@ PyTypeObject KX_ConstraintActuator::Type = { }; PyMethodDef KX_ConstraintActuator::Methods[] = { - // Deprecated --> - {"setDamp", (PyCFunction) KX_ConstraintActuator::sPySetDamp, METH_VARARGS, (const char *)SetDamp_doc}, - {"getDamp", (PyCFunction) KX_ConstraintActuator::sPyGetDamp, METH_NOARGS, (const char *)GetDamp_doc}, - {"setRotDamp", (PyCFunction) KX_ConstraintActuator::sPySetRotDamp, METH_VARARGS, (const char *)SetRotDamp_doc}, - {"getRotDamp", (PyCFunction) KX_ConstraintActuator::sPyGetRotDamp, METH_NOARGS, (const char *)GetRotDamp_doc}, - {"setDirection", (PyCFunction) KX_ConstraintActuator::sPySetDirection, METH_VARARGS, (const char *)SetDirection_doc}, - {"getDirection", (PyCFunction) KX_ConstraintActuator::sPyGetDirection, METH_NOARGS, (const char *)GetDirection_doc}, - {"setOption", (PyCFunction) KX_ConstraintActuator::sPySetOption, METH_VARARGS, (const char *)SetOption_doc}, - {"getOption", (PyCFunction) KX_ConstraintActuator::sPyGetOption, METH_NOARGS, (const char *)GetOption_doc}, - {"setTime", (PyCFunction) KX_ConstraintActuator::sPySetTime, METH_VARARGS, (const char *)SetTime_doc}, - {"getTime", (PyCFunction) KX_ConstraintActuator::sPyGetTime, METH_NOARGS, (const char *)GetTime_doc}, - {"setProperty", (PyCFunction) KX_ConstraintActuator::sPySetProperty, METH_VARARGS, (const char *)SetProperty_doc}, - {"getProperty", (PyCFunction) KX_ConstraintActuator::sPyGetProperty, METH_NOARGS, (const char *)GetProperty_doc}, - {"setMin", (PyCFunction) KX_ConstraintActuator::sPySetMin, METH_VARARGS, (const char *)SetMin_doc}, - {"getMin", (PyCFunction) KX_ConstraintActuator::sPyGetMin, METH_NOARGS, (const char *)GetMin_doc}, - {"setDistance", (PyCFunction) KX_ConstraintActuator::sPySetMin, METH_VARARGS, (const char *)SetDistance_doc}, - {"getDistance", (PyCFunction) KX_ConstraintActuator::sPyGetMin, METH_NOARGS, (const char *)GetDistance_doc}, - {"setMax", (PyCFunction) KX_ConstraintActuator::sPySetMax, METH_VARARGS, (const char *)SetMax_doc}, - {"getMax", (PyCFunction) KX_ConstraintActuator::sPyGetMax, METH_NOARGS, (const char *)GetMax_doc}, - {"setRayLength", (PyCFunction) KX_ConstraintActuator::sPySetMax, METH_VARARGS, (const char *)SetRayLength_doc}, - {"getRayLength", (PyCFunction) KX_ConstraintActuator::sPyGetMax, METH_NOARGS, (const char *)GetRayLength_doc}, - {"setLimit", (PyCFunction) KX_ConstraintActuator::sPySetLimit, METH_VARARGS, (const char *)SetLimit_doc}, - {"getLimit", (PyCFunction) KX_ConstraintActuator::sPyGetLimit, METH_NOARGS, (const char *)GetLimit_doc}, - // <-- {NULL,NULL} //Sentinel }; @@ -642,318 +618,4 @@ int KX_ConstraintActuator::pyattr_check_direction(void *self, const struct KX_PY return 0; } -/* 2. setDamp */ -const char KX_ConstraintActuator::SetDamp_doc[] = -"setDamp(duration)\n" -"\t- duration: integer\n" -"\tSets the time constant of the orientation and distance constraint.\n" -"\tIf the duration is negative, it is set to 0.\n"; -PyObject* KX_ConstraintActuator::PySetDamp(PyObject* args) { - ShowDeprecationWarning("setDamp()", "the damp property"); - int dampArg; - if(!PyArg_ParseTuple(args, "i:setDamp", &dampArg)) { - return NULL; - } - - m_posDampTime = dampArg; - if (m_posDampTime < 0) m_posDampTime = 0; - - Py_RETURN_NONE; -} -/* 3. getDamp */ -const char KX_ConstraintActuator::GetDamp_doc[] = -"getDamp()\n" -"\tReturns the damping parameter.\n"; -PyObject* KX_ConstraintActuator::PyGetDamp(){ - ShowDeprecationWarning("getDamp()", "the damp property"); - return PyLong_FromSsize_t(m_posDampTime); -} - -/* 2. setRotDamp */ -const char KX_ConstraintActuator::SetRotDamp_doc[] = -"setRotDamp(duration)\n" -"\t- duration: integer\n" -"\tSets the time constant of the orientation constraint.\n" -"\tIf the duration is negative, it is set to 0.\n"; -PyObject* KX_ConstraintActuator::PySetRotDamp(PyObject* args) { - ShowDeprecationWarning("setRotDamp()", "the rotDamp property"); - int dampArg; - if(!PyArg_ParseTuple(args, "i:setRotDamp", &dampArg)) { - return NULL; - } - - m_rotDampTime = dampArg; - if (m_rotDampTime < 0) m_rotDampTime = 0; - - Py_RETURN_NONE; -} -/* 3. getRotDamp */ -const char KX_ConstraintActuator::GetRotDamp_doc[] = -"getRotDamp()\n" -"\tReturns the damping time for application of the constraint.\n"; -PyObject* KX_ConstraintActuator::PyGetRotDamp(){ - ShowDeprecationWarning("getRotDamp()", "the rotDamp property"); - return PyLong_FromSsize_t(m_rotDampTime); -} - -/* 2. setDirection */ -const char KX_ConstraintActuator::SetDirection_doc[] = -"setDirection(vector)\n" -"\t- vector: 3-tuple\n" -"\tSets the reference direction in world coordinate for the orientation constraint.\n"; -PyObject* KX_ConstraintActuator::PySetDirection(PyObject* args) { - ShowDeprecationWarning("setDirection()", "the direction property"); - float x, y, z; - MT_Scalar len; - MT_Vector3 dir; - - if(!PyArg_ParseTuple(args, "(fff):setDirection", &x, &y, &z)) { - return NULL; - } - dir[0] = x; - dir[1] = y; - dir[2] = z; - len = dir.length(); - if (MT_fuzzyZero(len)) { - std::cout << "Invalid direction" << std::endl; - return NULL; - } - m_refDirVector = dir/len; - m_refDirection[0] = x/len; - m_refDirection[1] = y/len; - m_refDirection[2] = z/len; - - Py_RETURN_NONE; -} -/* 3. getDirection */ -const char KX_ConstraintActuator::GetDirection_doc[] = -"getDirection()\n" -"\tReturns the reference direction of the orientation constraint as a 3-tuple.\n"; -PyObject* KX_ConstraintActuator::PyGetDirection(){ - ShowDeprecationWarning("getDirection()", "the direction property"); - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_refDirection[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_refDirection[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_refDirection[2])); - return retVal; -} - -/* 2. setOption */ -const char KX_ConstraintActuator::SetOption_doc[] = -"setOption(option)\n" -"\t- option: integer\n" -"\tSets several options of the distance constraint.\n" -"\tBinary combination of the following values:\n" -"\t\t 64 : Activate alignment to surface\n" -"\t\t128 : Detect material rather than property\n" -"\t\t256 : No deactivation if ray does not hit target\n" -"\t\t512 : Activate distance control\n"; -PyObject* KX_ConstraintActuator::PySetOption(PyObject* args) { - ShowDeprecationWarning("setOption()", "the option property"); - int option; - if(!PyArg_ParseTuple(args, "i:setOption", &option)) { - return NULL; - } - - m_option = option; - - Py_RETURN_NONE; -} -/* 3. getOption */ -const char KX_ConstraintActuator::GetOption_doc[] = -"getOption()\n" -"\tReturns the option parameter.\n"; -PyObject* KX_ConstraintActuator::PyGetOption(){ - ShowDeprecationWarning("getOption()", "the option property"); - return PyLong_FromSsize_t(m_option); -} - -/* 2. setTime */ -const char KX_ConstraintActuator::SetTime_doc[] = -"setTime(duration)\n" -"\t- duration: integer\n" -"\tSets the activation time of the actuator.\n" -"\tThe actuator disables itself after this many frame.\n" -"\tIf set to 0 or negative, the actuator is not limited in time.\n"; -PyObject* KX_ConstraintActuator::PySetTime(PyObject* args) { - ShowDeprecationWarning("setTime()", "the time property"); - int t; - if(!PyArg_ParseTuple(args, "i:setTime", &t)) { - return NULL; - } - - if (t < 0) - t = 0; - m_activeTime = t; - - Py_RETURN_NONE; -} -/* 3. getTime */ -const char KX_ConstraintActuator::GetTime_doc[] = -"getTime()\n" -"\tReturns the time parameter.\n"; -PyObject* KX_ConstraintActuator::PyGetTime(){ - ShowDeprecationWarning("getTime()", "the time property"); - return PyLong_FromSsize_t(m_activeTime); -} - -/* 2. setProperty */ -const char KX_ConstraintActuator::SetProperty_doc[] = -"setProperty(property)\n" -"\t- property: string\n" -"\tSets the name of the property or material for the ray detection of the distance constraint.\n" -"\tIf empty, the ray will detect any collisioning object.\n"; -PyObject* KX_ConstraintActuator::PySetProperty(PyObject* args) { - ShowDeprecationWarning("setProperty()", "the 'property' property"); - char *property; - if (!PyArg_ParseTuple(args, "s:setProperty", &property)) { - return NULL; - } - if (property == NULL) { - m_property = ""; - } else { - m_property = property; - } - - Py_RETURN_NONE; -} -/* 3. getProperty */ -const char KX_ConstraintActuator::GetProperty_doc[] = -"getProperty()\n" -"\tReturns the property parameter.\n"; -PyObject* KX_ConstraintActuator::PyGetProperty(){ - ShowDeprecationWarning("getProperty()", "the 'property' property"); - return PyUnicode_FromString(m_property.Ptr()); -} - -/* 4. setDistance */ -const char KX_ConstraintActuator::SetDistance_doc[] = -"setDistance(distance)\n" -"\t- distance: float\n" -"\tSets the target distance in distance constraint\n"; -/* 4. setMin */ -const char KX_ConstraintActuator::SetMin_doc[] = -"setMin(lower_bound)\n" -"\t- lower_bound: float\n" -"\tSets the lower value of the interval to which the value\n" -"\tis clipped.\n"; -PyObject* KX_ConstraintActuator::PySetMin(PyObject* args) { - ShowDeprecationWarning("setMin() or setDistance()", "the min or distance property"); - float minArg; - if(!PyArg_ParseTuple(args, "f:setMin", &minArg)) { - return NULL; - } - - switch (m_locrot) { - default: - m_minimumBound = minArg; - break; - case KX_ACT_CONSTRAINT_ROTX: - case KX_ACT_CONSTRAINT_ROTY: - case KX_ACT_CONSTRAINT_ROTZ: - m_minimumBound = MT_radians(minArg); - break; - } - - Py_RETURN_NONE; -} -/* 5. getDistance */ -const char KX_ConstraintActuator::GetDistance_doc[] = -"getDistance()\n" -"\tReturns the distance parameter \n"; -/* 5. getMin */ -const char KX_ConstraintActuator::GetMin_doc[] = -"getMin()\n" -"\tReturns the lower value of the interval to which the value\n" -"\tis clipped.\n"; -PyObject* KX_ConstraintActuator::PyGetMin() { - ShowDeprecationWarning("getMin() or getDistance()", "the min or distance property"); - return PyFloat_FromDouble(m_minimumBound); -} - -/* 6. setRayLength */ -const char KX_ConstraintActuator::SetRayLength_doc[] = -"setRayLength(length)\n" -"\t- length: float\n" -"\tSets the maximum ray length of the distance constraint\n"; -/* 6. setMax */ -const char KX_ConstraintActuator::SetMax_doc[] = -"setMax(upper_bound)\n" -"\t- upper_bound: float\n" -"\tSets the upper value of the interval to which the value\n" -"\tis clipped.\n"; -PyObject* KX_ConstraintActuator::PySetMax(PyObject* args){ - ShowDeprecationWarning("setMax() or setRayLength()", "the max or rayLength property"); - float maxArg; - if(!PyArg_ParseTuple(args, "f:setMax", &maxArg)) { - return NULL; - } - - switch (m_locrot) { - default: - m_maximumBound = maxArg; - break; - case KX_ACT_CONSTRAINT_ROTX: - case KX_ACT_CONSTRAINT_ROTY: - case KX_ACT_CONSTRAINT_ROTZ: - m_maximumBound = MT_radians(maxArg); - break; - } - - Py_RETURN_NONE; -} -/* 7. getRayLength */ -const char KX_ConstraintActuator::GetRayLength_doc[] = -"getRayLength()\n" -"\tReturns the length of the ray\n"; -/* 7. getMax */ -const char KX_ConstraintActuator::GetMax_doc[] = -"getMax()\n" -"\tReturns the upper value of the interval to which the value\n" -"\tis clipped.\n"; -PyObject* KX_ConstraintActuator::PyGetMax() { - ShowDeprecationWarning("getMax() or getRayLength()", "the max or rayLength property"); - return PyFloat_FromDouble(m_maximumBound); -} - - -/* This setter/getter probably for the constraint type */ -/* 8. setLimit */ -const char KX_ConstraintActuator::SetLimit_doc[] = -"setLimit(type)\n" -"\t- type: integer\n" -"\t 1 : LocX\n" -"\t 2 : LocY\n" -"\t 3 : LocZ\n" -"\t 7 : Distance along +X axis\n" -"\t 8 : Distance along +Y axis\n" -"\t 9 : Distance along +Z axis\n" -"\t 10 : Distance along -X axis\n" -"\t 11 : Distance along -Y axis\n" -"\t 12 : Distance along -Z axis\n" -"\t 13 : Align X axis\n" -"\t 14 : Align Y axis\n" -"\t 15 : Align Z axis\n" -"\tSets the type of constraint.\n"; -PyObject* KX_ConstraintActuator::PySetLimit(PyObject* args) { - ShowDeprecationWarning("setLimit()", "the limit property"); - int locrotArg; - if(!PyArg_ParseTuple(args, "i:setLimit", &locrotArg)) { - return NULL; - } - - if (IsValidMode((KX_CONSTRAINTTYPE)locrotArg)) m_locrot = locrotArg; - - Py_RETURN_NONE; -} -/* 9. getLimit */ -const char KX_ConstraintActuator::GetLimit_doc[] = -"getLimit()\n" -"\tReturns the type of constraint.\n"; -PyObject* KX_ConstraintActuator::PyGetLimit() { - ShowDeprecationWarning("setLimit()", "the limit property"); - return PyLong_FromSsize_t(m_locrot); -} - /* eof */ diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.h b/source/gameengine/Ketsji/KX_ConstraintActuator.h index 677904aedc9..9b6ed59e75c 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.h +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.h @@ -143,28 +143,6 @@ protected: static int pyattr_check_direction(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_check_min(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); - KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetDamp); - KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetDamp); - KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetRotDamp); - KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetRotDamp); - KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetDirection); - KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetDirection); - KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetOption); - KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetOption); - KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetTime); - KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetTime); - KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetProperty); - KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetProperty); - KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetMin); - KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetMin); - static const char SetDistance_doc[]; - static const char GetDistance_doc[]; - KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetMax); - KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetMax); - static const char SetRayLength_doc[]; - static const char GetRayLength_doc[]; - KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetLimit); - KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetLimit); }; #endif //__KX_CONSTRAINTACTUATOR diff --git a/source/gameengine/Ketsji/KX_GameActuator.cpp b/source/gameengine/Ketsji/KX_GameActuator.cpp index 3f67de1e9a9..42dc4d8fd24 100644 --- a/source/gameengine/Ketsji/KX_GameActuator.cpp +++ b/source/gameengine/Ketsji/KX_GameActuator.cpp @@ -230,10 +230,6 @@ PyTypeObject KX_GameActuator::Type = { PyMethodDef KX_GameActuator::Methods[] = { - // Deprecated -----> - {"getFile", (PyCFunction) KX_GameActuator::sPyGetFile, METH_VARARGS, (const char *)GetFile_doc}, - {"setFile", (PyCFunction) KX_GameActuator::sPySetFile, METH_VARARGS, (const char *)SetFile_doc}, - // <----- {NULL,NULL} //Sentinel }; @@ -242,36 +238,3 @@ PyAttributeDef KX_GameActuator::Attributes[] = { KX_PYATTRIBUTE_INT_RW("mode", KX_GAME_NODEF+1, KX_GAME_MAX-1, true, KX_GameActuator, m_mode), { NULL } //Sentinel }; - -// Deprecated -----> -/* getFile */ -const char KX_GameActuator::GetFile_doc[] = -"getFile()\n" -"get the name of the file to start.\n"; -PyObject* KX_GameActuator::PyGetFile(PyObject* args, PyObject* kwds) -{ - ShowDeprecationWarning("getFile()", "the fileName property"); - return PyUnicode_FromString(m_filename); -} - -/* setFile */ -const char KX_GameActuator::SetFile_doc[] = -"setFile(name)\n" -"set the name of the file to start.\n"; -PyObject* KX_GameActuator::PySetFile(PyObject* args, PyObject* kwds) -{ - char* new_file; - - ShowDeprecationWarning("setFile()", "the fileName property"); - - if (!PyArg_ParseTuple(args, "s:setFile", &new_file)) - { - return NULL; - } - - m_filename = STR_String(new_file); - - Py_RETURN_NONE; - -} -// <----- diff --git a/source/gameengine/Ketsji/KX_GameActuator.h b/source/gameengine/Ketsji/KX_GameActuator.h index cabbf827b40..37d09a5a9fb 100644 --- a/source/gameengine/Ketsji/KX_GameActuator.h +++ b/source/gameengine/Ketsji/KX_GameActuator.h @@ -75,11 +75,6 @@ protected: /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - - // Deprecated functions -----> - KX_PYMETHOD_DOC(KX_GameActuator,GetFile); - KX_PYMETHOD_DOC(KX_GameActuator,SetFile); - // <----- }; /* end of class KX_GameActuator */ diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 3aef41743a7..79b110b11ef 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1383,8 +1383,8 @@ PyMethodDef KX_GameObject::Methods[] = { {"setVisible",(PyCFunction) KX_GameObject::sPySetVisible, METH_VARARGS}, {"setOcclusion",(PyCFunction) KX_GameObject::sPySetOcclusion, METH_VARARGS}, {"removeParent", (PyCFunction)KX_GameObject::sPyRemoveParent,METH_NOARGS}, - {"getChildren", (PyCFunction)KX_GameObject::sPyGetChildren,METH_NOARGS}, - {"getChildrenRecursive", (PyCFunction)KX_GameObject::sPyGetChildrenRecursive,METH_NOARGS}, + + {"getPhysicsId", (PyCFunction)KX_GameObject::sPyGetPhysicsId,METH_NOARGS}, {"getPropertyNames", (PyCFunction)KX_GameObject::sPyGetPropertyNames,METH_NOARGS}, {"replaceMesh",(PyCFunction) KX_GameObject::sPyReplaceMesh, METH_VARARGS}, @@ -1400,18 +1400,6 @@ PyMethodDef KX_GameObject::Methods[] = { // dict style access for props {"get",(PyCFunction) KX_GameObject::sPyget, METH_VARARGS}, - // deprecated - {"getPosition", (PyCFunction) KX_GameObject::sPyGetPosition, METH_NOARGS}, - {"setPosition", (PyCFunction) KX_GameObject::sPySetPosition, METH_O}, - {"setWorldPosition", (PyCFunction) KX_GameObject::sPySetWorldPosition, METH_O}, - {"getOrientation", (PyCFunction) KX_GameObject::sPyGetOrientation, METH_NOARGS}, - {"setOrientation", (PyCFunction) KX_GameObject::sPySetOrientation, METH_O}, - {"getState",(PyCFunction) KX_GameObject::sPyGetState, METH_NOARGS}, - {"setState",(PyCFunction) KX_GameObject::sPySetState, METH_O}, - {"getParent", (PyCFunction)KX_GameObject::sPyGetParent,METH_NOARGS}, - {"getVisible",(PyCFunction) KX_GameObject::sPyGetVisible, METH_NOARGS}, - {"getMass", (PyCFunction) KX_GameObject::sPyGetMass, METH_NOARGS}, - {"getMesh", (PyCFunction)KX_GameObject::sPyGetMesh,METH_VARARGS}, {NULL,NULL} //Sentinel }; @@ -1514,13 +1502,6 @@ PyObject* KX_GameObject::PyReinstancePhysicsMesh(PyObject* args) Py_RETURN_FALSE; } - -PyObject* KX_GameObject::PyGetPosition() -{ - ShowDeprecationWarning("getPosition()", "the position property"); - return PyObjectFrom(NodeGetWorldPosition()); -} - static PyObject *Map_GetItem(PyObject *self_v, PyObject *item) { KX_GameObject* self= static_castBGE_PROXY_REF(self_v); @@ -2200,41 +2181,6 @@ PyObject* KX_GameObject::PySetOcclusion(PyObject* args) Py_RETURN_NONE; } -PyObject* KX_GameObject::PyGetVisible() -{ - ShowDeprecationWarning("getVisible()", "the visible property"); - return PyLong_FromSsize_t(m_bVisible); -} - -PyObject* KX_GameObject::PyGetState() -{ - ShowDeprecationWarning("getState()", "the state property"); - int state = 0; - state |= GetState(); - return PyLong_FromSsize_t(state); -} - -PyObject* KX_GameObject::PySetState(PyObject* value) -{ - ShowDeprecationWarning("setState()", "the state property"); - int state_i = PyLong_AsSsize_t(value); - unsigned int state = 0; - - if (state_i == -1 && PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, "expected an int bit field"); - return NULL; - } - - state |= state_i; - if ((state & ((1<<30)-1)) == 0) { - PyErr_SetString(PyExc_AttributeError, "The state bitfield was not between 0 and 30 (1<<0 and 1<<29)"); - return NULL; - } - SetState(state); - - Py_RETURN_NONE; -} - PyObject* KX_GameObject::PyGetVelocity(PyObject* args) { // only can get the velocity if we have a physics object connected to us... @@ -2253,14 +2199,6 @@ PyObject* KX_GameObject::PyGetVelocity(PyObject* args) } } - - -PyObject* KX_GameObject::PyGetMass() -{ - ShowDeprecationWarning("getMass()", "the mass property"); - return PyFloat_FromDouble((GetPhysicsController() != NULL) ? GetPhysicsController()->GetMass() : 0.0f); -} - PyObject* KX_GameObject::PyGetReactionForce() { // only can get the velocity if we have a physics object connected to us... @@ -2297,18 +2235,6 @@ PyObject* KX_GameObject::PyDisableRigidBody() } - -PyObject* KX_GameObject::PyGetParent() -{ - ShowDeprecationWarning("getParent()", "the parent property"); - KX_GameObject* parent = this->GetParent(); - if (parent) { - parent->Release(); /* self->GetParent() AddRef's */ - return parent->GetProxy(); - } - Py_RETURN_NONE; -} - PyObject* KX_GameObject::PySetParent(PyObject* args) { KX_Scene *scene = KX_GetActiveScene(); @@ -2334,41 +2260,6 @@ PyObject* KX_GameObject::PyRemoveParent() Py_RETURN_NONE; } -PyObject* KX_GameObject::PyGetChildren() -{ - ShowDeprecationWarning("getChildren()", "the children property"); - - return GetChildren()->NewProxy(true); -} - -PyObject* KX_GameObject::PyGetChildrenRecursive() -{ - ShowDeprecationWarning("getChildrenRecursive()", "the childrenRecursive property"); - - return GetChildrenRecursive()->NewProxy(true); -} - -PyObject* KX_GameObject::PyGetMesh(PyObject* args) -{ - ShowDeprecationWarning("getMesh()", "the meshes property (now a list of meshes)"); - - int mesh = 0; - - if (!PyArg_ParseTuple(args, "|i:getMesh", &mesh)) - return NULL; // python sets a simple error - - if (((unsigned int)mesh < m_meshes.size()) && mesh >= 0) - { - KX_MeshProxy* meshproxy = new KX_MeshProxy(m_meshes[mesh]); - return meshproxy->NewProxy(true); // XXX Todo Python own. - } - - Py_RETURN_NONE; -} - - - - PyObject* KX_GameObject::PySetCollisionMargin(PyObject* value) { @@ -2432,29 +2323,6 @@ PyObject* KX_GameObject::PyRestoreDynamics() } - -PyObject* KX_GameObject::PyGetOrientation() //keywords -{ - ShowDeprecationWarning("getOrientation()", "the orientation property"); - return PyObjectFrom(NodeGetWorldOrientation()); -} - - - -PyObject* KX_GameObject::PySetOrientation(PyObject* value) -{ - ShowDeprecationWarning("setOrientation()", "the orientation property"); - MT_Matrix3x3 rot; - - /* if value is not a sequence PyOrientationTo makes an error */ - if (!PyOrientationTo(value, rot, "gameOb.setOrientation(sequence): KX_GameObject, ")) - return NULL; - - NodeSetLocalOrientation(rot); - NodeUpdateGS(0.f); - Py_RETURN_NONE; -} - PyObject* KX_GameObject::PyAlignAxisToVect(PyObject* args) { PyObject* pyvect; @@ -2487,33 +2355,6 @@ PyObject* KX_GameObject::PyGetAxisVect(PyObject* value) return NULL; } -PyObject* KX_GameObject::PySetPosition(PyObject* value) -{ - ShowDeprecationWarning("setPosition()", "the localPosition property"); - MT_Point3 pos; - if (PyVecTo(value, pos)) - { - NodeSetLocalPosition(pos); - NodeUpdateGS(0.f); - Py_RETURN_NONE; - } - - return NULL; -} - -PyObject* KX_GameObject::PySetWorldPosition(PyObject* value) -{ - ShowDeprecationWarning("setWorldPosition()", "the worldPosition property"); - MT_Point3 pos; - if (PyVecTo(value, pos)) - { - NodeSetWorldPosition(pos); - NodeUpdateGS(0.f); - Py_RETURN_NONE; - } - - return NULL; -} PyObject* KX_GameObject::PyGetPhysicsId() { diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index a5cd084b4d4..845cead1cdb 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -795,9 +795,7 @@ public: { return PyUnicode_FromString(GetName().ReadPtr()); } - - KX_PYMETHOD_NOARGS(KX_GameObject,GetPosition); - KX_PYMETHOD_O(KX_GameObject,SetPosition); + KX_PYMETHOD_O(KX_GameObject,SetWorldPosition); KX_PYMETHOD_VARARGS(KX_GameObject, ApplyForce); KX_PYMETHOD_VARARGS(KX_GameObject, ApplyTorque); @@ -808,10 +806,10 @@ public: KX_PYMETHOD_VARARGS(KX_GameObject,GetAngularVelocity); KX_PYMETHOD_VARARGS(KX_GameObject,SetAngularVelocity); KX_PYMETHOD_VARARGS(KX_GameObject,GetVelocity); - KX_PYMETHOD_NOARGS(KX_GameObject,GetMass); + KX_PYMETHOD_NOARGS(KX_GameObject,GetReactionForce); - KX_PYMETHOD_NOARGS(KX_GameObject,GetOrientation); - KX_PYMETHOD_O(KX_GameObject,SetOrientation); + + KX_PYMETHOD_NOARGS(KX_GameObject,GetVisible); KX_PYMETHOD_VARARGS(KX_GameObject,SetVisible); KX_PYMETHOD_VARARGS(KX_GameObject,SetOcclusion); @@ -828,7 +826,7 @@ public: KX_PYMETHOD_NOARGS(KX_GameObject,GetParent); KX_PYMETHOD_VARARGS(KX_GameObject,SetParent); KX_PYMETHOD_NOARGS(KX_GameObject,RemoveParent); - KX_PYMETHOD_NOARGS(KX_GameObject,GetChildren); + KX_PYMETHOD_NOARGS(KX_GameObject,GetChildren); KX_PYMETHOD_NOARGS(KX_GameObject,GetChildrenRecursive); KX_PYMETHOD_VARARGS(KX_GameObject,GetMesh); KX_PYMETHOD_NOARGS(KX_GameObject,GetPhysicsId); diff --git a/source/gameengine/Ketsji/KX_IpoActuator.cpp b/source/gameengine/Ketsji/KX_IpoActuator.cpp index 3f241e90836..b71907be961 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.cpp +++ b/source/gameengine/Ketsji/KX_IpoActuator.cpp @@ -434,21 +434,6 @@ PyTypeObject KX_IpoActuator::Type = { }; PyMethodDef KX_IpoActuator::Methods[] = { - // deprecated - {"set", (PyCFunction) KX_IpoActuator::sPySet, METH_VARARGS, (const char *)Set_doc}, - {"setProperty", (PyCFunction) KX_IpoActuator::sPySetProperty, METH_VARARGS, (const char *)SetProperty_doc}, - {"setStart", (PyCFunction) KX_IpoActuator::sPySetStart, METH_VARARGS, (const char *)SetStart_doc}, - {"getStart", (PyCFunction) KX_IpoActuator::sPyGetStart, METH_NOARGS, (const char *)GetStart_doc}, - {"setEnd", (PyCFunction) KX_IpoActuator::sPySetEnd, METH_VARARGS, (const char *)SetEnd_doc}, - {"getEnd", (PyCFunction) KX_IpoActuator::sPyGetEnd, METH_NOARGS, (const char *)GetEnd_doc}, - {"setIpoAsForce", (PyCFunction) KX_IpoActuator::sPySetIpoAsForce, METH_VARARGS, (const char *)SetIpoAsForce_doc}, - {"getIpoAsForce", (PyCFunction) KX_IpoActuator::sPyGetIpoAsForce, METH_NOARGS, (const char *)GetIpoAsForce_doc}, - {"setIpoAdd", (PyCFunction) KX_IpoActuator::sPySetIpoAdd, METH_VARARGS, (const char *)SetIpoAdd_doc}, - {"getIpoAdd", (PyCFunction) KX_IpoActuator::sPyGetIpoAdd, METH_NOARGS, (const char *)GetIpoAdd_doc}, - {"setForceIpoActsLocal", (PyCFunction) KX_IpoActuator::sPySetForceIpoActsLocal, METH_VARARGS, (const char *)SetForceIpoActsLocal_doc}, - {"getForceIpoActsLocal", (PyCFunction) KX_IpoActuator::sPyGetForceIpoActsLocal, METH_NOARGS, (const char *)GetForceIpoActsLocal_doc}, - {"setType", (PyCFunction) KX_IpoActuator::sPySetType, METH_VARARGS, (const char *)SetType_doc}, - {"getType", (PyCFunction) KX_IpoActuator::sPyGetType, METH_NOARGS, (const char *)GetType_doc}, {NULL,NULL} //Sentinel }; @@ -466,237 +451,4 @@ PyAttributeDef KX_IpoActuator::Attributes[] = { { NULL } //Sentinel }; - -/* set --------------------------------------------------------------------- */ -const char KX_IpoActuator::Set_doc[] = -"set(type, startframe, endframe, mode?)\n" -"\t - type: Play, PingPong, Flipper, LoopStop, LoopEnd or FromProp (string)\n" -"\t - startframe: first frame to use (int)\n" -"\t - endframe : last frame to use (int)\n" -"\t - mode? : special mode (0=normal, 1=interpret location as force, 2=additive)" -"\tSet the properties of the actuator.\n"; -PyObject* KX_IpoActuator::PySet(PyObject* args) { - - ShowDeprecationWarning("set()", "a range properties"); - - /* sets modes PLAY, PINGPONG, FLIPPER, LOOPSTOP, LOOPEND */ - /* arg 1 = mode string, arg 2 = startframe, arg3 = stopframe, */ - /* arg4 = force toggle */ - char* mode; - int forceToggle; - int modenum; - int startFrame, stopFrame; - if(!PyArg_ParseTuple(args, "siii:set", &mode, &startFrame, - &stopFrame, &forceToggle)) { - return NULL; - } - modenum = string2mode(mode); - - switch (modenum) { - case KX_ACT_IPO_PLAY: - case KX_ACT_IPO_PINGPONG: - case KX_ACT_IPO_FLIPPER: - case KX_ACT_IPO_LOOPSTOP: - case KX_ACT_IPO_LOOPEND: - m_type = modenum; - m_startframe = startFrame; - m_endframe = stopFrame; - m_ipo_as_force = forceToggle == 1; - m_ipo_add = forceToggle == 2; - break; - default: - ; /* error */ - } - - Py_RETURN_NONE; -} - -/* set property ----------------------------------------------------------- */ -const char KX_IpoActuator::SetProperty_doc[] = -"setProperty(propname)\n" -"\t - propname: name of the property (string)\n" -"\tSet the property to be used in FromProp mode.\n"; -PyObject* KX_IpoActuator::PySetProperty(PyObject* args) { - - ShowDeprecationWarning("setProperty()", "the propName property"); - - /* mode is implicit here, but not supported yet... */ - /* args: property */ - char *propertyName; - if(!PyArg_ParseTuple(args, "s:setProperty", &propertyName)) { - return NULL; - } - - m_propname = propertyName; - - Py_RETURN_NONE; -} - -/* 4. setStart: */ -const char KX_IpoActuator::SetStart_doc[] = -"setStart(frame)\n" -"\t - frame: first frame to use (int)\n" -"\tSet the frame from which the ipo starts playing.\n"; -PyObject* KX_IpoActuator::PySetStart(PyObject* args) { - - ShowDeprecationWarning("setStart()", "the frameStart property"); - - float startArg; - if(!PyArg_ParseTuple(args, "f:setStart", &startArg)) { - return NULL; - } - - m_startframe = startArg; - - Py_RETURN_NONE; -} -/* 5. getStart: */ -const char KX_IpoActuator::GetStart_doc[] = -"getStart()\n" -"\tReturns the frame from which the ipo starts playing.\n"; -PyObject* KX_IpoActuator::PyGetStart() { - ShowDeprecationWarning("getStart()", "the frameStart property"); - return PyFloat_FromDouble(m_startframe); -} - -/* 6. setEnd: */ -const char KX_IpoActuator::SetEnd_doc[] = -"setEnd(frame)\n" -"\t - frame: last frame to use (int)\n" -"\tSet the frame at which the ipo stops playing.\n"; -PyObject* KX_IpoActuator::PySetEnd(PyObject* args) { - ShowDeprecationWarning("setEnd()", "the frameEnd property"); - float endArg; - if(!PyArg_ParseTuple(args, "f:setEnd", &endArg)) { - return NULL; - } - - m_endframe = endArg; - - Py_RETURN_NONE; -} -/* 7. getEnd: */ -const char KX_IpoActuator::GetEnd_doc[] = -"getEnd()\n" -"\tReturns the frame at which the ipo stops playing.\n"; -PyObject* KX_IpoActuator::PyGetEnd() { - ShowDeprecationWarning("getEnd()", "the frameEnd property"); - return PyFloat_FromDouble(m_endframe); -} - -/* 6. setIpoAsForce: */ -const char KX_IpoActuator::SetIpoAsForce_doc[] = -"setIpoAsForce(force?)\n" -"\t - force? : interpret this ipo as a force? (KX_TRUE, KX_FALSE)\n" -"\tSet whether to interpret the ipo as a force rather than a displacement.\n"; -PyObject* KX_IpoActuator::PySetIpoAsForce(PyObject* args) { - ShowDeprecationWarning("setIpoAsForce()", "the useIpoAsForce property"); - int boolArg; - - if (!PyArg_ParseTuple(args, "i:setIpoAsForce", &boolArg)) { - return NULL; - } - - m_ipo_as_force = PyArgToBool(boolArg); - if (m_ipo_as_force) - m_ipo_add = false; - - Py_RETURN_NONE; -} -/* 7. getIpoAsForce: */ -const char KX_IpoActuator::GetIpoAsForce_doc[] = -"getIpoAsForce()\n" -"\tReturns whether to interpret the ipo as a force rather than a displacement.\n"; -PyObject* KX_IpoActuator::PyGetIpoAsForce() { - ShowDeprecationWarning("getIpoAsForce()", "the useIpoAsForce property"); - return BoolToPyArg(m_ipo_as_force); -} - -/* 6. setIpoAsForce: */ -const char KX_IpoActuator::SetIpoAdd_doc[] = -"setIpoAdd(add?)\n" -"\t - add? : add flag (KX_TRUE, KX_FALSE)\n" -"\tSet whether to interpret the ipo as additive rather than absolute.\n"; -PyObject* KX_IpoActuator::PySetIpoAdd(PyObject* args) { - ShowDeprecationWarning("setIpoAdd()", "the useIpoAdd property"); - int boolArg; - - if (!PyArg_ParseTuple(args, "i:setIpoAdd", &boolArg)) { - return NULL; - } - - m_ipo_add = PyArgToBool(boolArg); - if (m_ipo_add) - m_ipo_as_force = false; - - Py_RETURN_NONE; -} -/* 7. getIpoAsForce: */ -const char KX_IpoActuator::GetIpoAdd_doc[] = -"getIpoAsAdd()\n" -"\tReturns whether to interpret the ipo as additive rather than absolute.\n"; -PyObject* KX_IpoActuator::PyGetIpoAdd() { - ShowDeprecationWarning("getIpoAdd()", "the useIpoAdd property"); - return BoolToPyArg(m_ipo_add); -} - -/* 8. setType: */ -const char KX_IpoActuator::SetType_doc[] = -"setType(mode)\n" -"\t - mode: Play, PingPong, Flipper, LoopStop, LoopEnd or FromProp (string)\n" -"\tSet the operation mode of the actuator.\n"; -PyObject* KX_IpoActuator::PySetType(PyObject* args) { - ShowDeprecationWarning("setType()", "the mode property"); - int typeArg; - - if (!PyArg_ParseTuple(args, "i:setType", &typeArg)) { - return NULL; - } - - if ( (typeArg > KX_ACT_IPO_NODEF) - && (typeArg < KX_ACT_IPO_MAX) ) { - m_type = typeArg; - } - - Py_RETURN_NONE; -} -/* 9. getType: */ -const char KX_IpoActuator::GetType_doc[] = -"getType()\n" -"\tReturns the operation mode of the actuator.\n"; -PyObject* KX_IpoActuator::PyGetType() { - ShowDeprecationWarning("getType()", "the mode property"); - return PyLong_FromSsize_t(m_type); -} - -/* 10. setForceIpoActsLocal: */ -const char KX_IpoActuator::SetForceIpoActsLocal_doc[] = -"setForceIpoActsLocal(local?)\n" -"\t - local? : Apply the ipo-as-force in the object's local\n" -"\t coordinates? (KX_TRUE, KX_FALSE)\n" -"\tSet whether to apply the force in the object's local\n" -"\tcoordinates rather than the world global coordinates.\n"; -PyObject* KX_IpoActuator::PySetForceIpoActsLocal(PyObject* args) { - ShowDeprecationWarning("setForceIpoActsLocal()", "the useIpoLocal property"); - int boolArg; - - if (!PyArg_ParseTuple(args, "i:setForceIpoActsLocal", &boolArg)) { - return NULL; - } - - m_ipo_local = PyArgToBool(boolArg); - - Py_RETURN_NONE; -} -/* 11. getForceIpoActsLocal: */ -const char KX_IpoActuator::GetForceIpoActsLocal_doc[] = -"getForceIpoActsLocal()\n" -"\tReturn whether to apply the force in the object's local\n" -"\tcoordinates rather than the world global coordinates.\n"; -PyObject* KX_IpoActuator::PyGetForceIpoActsLocal() { - ShowDeprecationWarning("getForceIpoActsLocal()", "the useIpoLocal property"); - return BoolToPyArg(m_ipo_local); -} - - /* eof */ diff --git a/source/gameengine/Ketsji/KX_IpoActuator.h b/source/gameengine/Ketsji/KX_IpoActuator.h index 0581d1644ee..72fe812f98e 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.h +++ b/source/gameengine/Ketsji/KX_IpoActuator.h @@ -138,23 +138,6 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - //KX_PYMETHOD_DOC - KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,Set); - KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetProperty); -/* KX_PYMETHOD_DOC(KX_IpoActuator,SetKey2Key); */ - KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetStart); - KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetStart); - KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetEnd); - KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetEnd); - KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetIpoAsForce); - KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetIpoAsForce); - KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetIpoAdd); - KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetIpoAdd); - KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetType); - KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetType); - KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetForceIpoActsLocal); - KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetForceIpoActsLocal); - }; #endif //__KX_IPOACTUATOR diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp index e15847fe6c6..744fdb75796 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.cpp +++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp @@ -68,18 +68,12 @@ PyTypeObject KX_MeshProxy::Type = { }; PyMethodDef KX_MeshProxy::Methods[] = { -// Deprecated -----> -{"getNumMaterials", (PyCFunction)KX_MeshProxy::sPyGetNumMaterials,METH_VARARGS}, -{"getNumPolygons", (PyCFunction)KX_MeshProxy::sPyGetNumPolygons,METH_NOARGS}, -// <----- - {"getMaterialName", (PyCFunction)KX_MeshProxy::sPyGetMaterialName,METH_VARARGS}, {"getTextureName", (PyCFunction)KX_MeshProxy::sPyGetTextureName,METH_VARARGS}, {"getVertexArrayLength", (PyCFunction)KX_MeshProxy::sPyGetVertexArrayLength,METH_VARARGS}, {"getVertex", (PyCFunction)KX_MeshProxy::sPyGetVertex,METH_VARARGS}, {"getPolygon", (PyCFunction)KX_MeshProxy::sPyGetPolygon,METH_VARARGS}, //{"getIndexArrayLength", (PyCFunction)KX_MeshProxy::sPyGetIndexArrayLength,METH_VARARGS}, - {NULL,NULL} //Sentinel }; @@ -119,20 +113,6 @@ CValue* KX_MeshProxy::GetReplica() { return NULL;} // stuff for python integration - -PyObject* KX_MeshProxy::PyGetNumMaterials(PyObject* args, PyObject* kwds) -{ - int num = m_meshobj->NumMaterials(); - ShowDeprecationWarning("getNumMaterials()", "the numMaterials property"); - return PyLong_FromSsize_t(num); -} - -PyObject* KX_MeshProxy::PyGetNumPolygons() -{ - int num = m_meshobj->NumPolygons(); - ShowDeprecationWarning("getNumPolygons()", "the numPolygons property"); - return PyLong_FromSsize_t(num); -} PyObject* KX_MeshProxy::PyGetMaterialName(PyObject* args, PyObject* kwds) { diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp index 881747edff2..8abc4f6b897 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp @@ -368,13 +368,6 @@ PyTypeObject KX_MouseFocusSensor::Type = { }; PyMethodDef KX_MouseFocusSensor::Methods[] = { - {"getRayTarget", (PyCFunction) KX_MouseFocusSensor::sPyGetRayTarget, METH_NOARGS, (const char *)GetRayTarget_doc}, - {"getRaySource", (PyCFunction) KX_MouseFocusSensor::sPyGetRaySource, METH_NOARGS, (const char *)GetRaySource_doc}, - {"getHitObject",(PyCFunction) KX_MouseFocusSensor::sPyGetHitObject,METH_NOARGS, (const char *)GetHitObject_doc}, - {"getHitPosition",(PyCFunction) KX_MouseFocusSensor::sPyGetHitPosition,METH_NOARGS, (const char *)GetHitPosition_doc}, - {"getHitNormal",(PyCFunction) KX_MouseFocusSensor::sPyGetHitNormal,METH_NOARGS, (const char *)GetHitNormal_doc}, - {"getRayDirection",(PyCFunction) KX_MouseFocusSensor::sPyGetRayDirection,METH_NOARGS, (const char *)GetRayDirection_doc}, - {NULL,NULL} //Sentinel }; @@ -389,78 +382,6 @@ PyAttributeDef KX_MouseFocusSensor::Attributes[] = { { NULL } //Sentinel }; -const char KX_MouseFocusSensor::GetHitObject_doc[] = -"getHitObject()\n" -"\tReturns the object that was hit by this ray.\n"; -PyObject* KX_MouseFocusSensor::PyGetHitObject() -{ - ShowDeprecationWarning("GetHitObject()", "the hitObject property"); - - if (m_hitObject) - return m_hitObject->GetProxy(); - - Py_RETURN_NONE; -} - - -const char KX_MouseFocusSensor::GetHitPosition_doc[] = -"getHitPosition()\n" -"\tReturns the position (in worldcoordinates) where the object was hit by this ray.\n"; -PyObject* KX_MouseFocusSensor::PyGetHitPosition() -{ - ShowDeprecationWarning("getHitPosition()", "the hitPosition property"); - - return PyObjectFrom(m_hitPosition); -} - -const char KX_MouseFocusSensor::GetRayDirection_doc[] = -"getRayDirection()\n" -"\tReturns the direction from the ray (in worldcoordinates) .\n"; -PyObject* KX_MouseFocusSensor::PyGetRayDirection() -{ - ShowDeprecationWarning("getRayDirection()", "the rayDirection property"); - - MT_Vector3 dir = m_prevTargetPoint - m_prevSourcePoint; - if(MT_fuzzyZero(dir)) dir.setValue(0,0,0); - else dir.normalize(); - return PyObjectFrom(dir); -} - -const char KX_MouseFocusSensor::GetHitNormal_doc[] = -"getHitNormal()\n" -"\tReturns the normal (in worldcoordinates) at the point of collision where the object was hit by this ray.\n"; -PyObject* KX_MouseFocusSensor::PyGetHitNormal() -{ - ShowDeprecationWarning("getHitNormal()", "the hitNormal property"); - - return PyObjectFrom(m_hitNormal); -} - - -/* getRayTarget */ -const char KX_MouseFocusSensor::GetRayTarget_doc[] = -"getRayTarget()\n" -"\tReturns the target of the ray that seeks the focus object,\n" -"\tin worldcoordinates."; -PyObject* KX_MouseFocusSensor::PyGetRayTarget() -{ - ShowDeprecationWarning("getRayTarget()", "the rayTarget property"); - - return PyObjectFrom(m_prevTargetPoint); -} - -/* getRayTarget */ -const char KX_MouseFocusSensor::GetRaySource_doc[] = -"getRaySource()\n" -"\tReturns the source of the ray that seeks the focus object,\n" -"\tin worldcoordinates."; -PyObject* KX_MouseFocusSensor::PyGetRaySource() -{ - ShowDeprecationWarning("getRaySource()", "the raySource property"); - - return PyObjectFrom(m_prevSourcePoint); -} - /* Attributes */ PyObject* KX_MouseFocusSensor::pyattr_get_ray_source(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.h b/source/gameengine/Ketsji/KX_MouseFocusSensor.h index 89ac012c068..7b53557467f 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.h +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.h @@ -90,14 +90,6 @@ class KX_MouseFocusSensor : public SCA_MouseSensor /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetRayTarget); - KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetRaySource); - - KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetHitObject); - KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetHitPosition); - KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetHitNormal); - KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetRayDirection); - /* attributes */ static PyObject* pyattr_get_ray_source(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_ray_target(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp index 2ee30ee0bfa..99179c5ed96 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp @@ -347,32 +347,6 @@ PyTypeObject KX_ObjectActuator::Type = { }; PyMethodDef KX_ObjectActuator::Methods[] = { - // Deprecated -----> - {"getForce", (PyCFunction) KX_ObjectActuator::sPyGetForce, METH_NOARGS}, - {"setForce", (PyCFunction) KX_ObjectActuator::sPySetForce, METH_VARARGS}, - {"getTorque", (PyCFunction) KX_ObjectActuator::sPyGetTorque, METH_NOARGS}, - {"setTorque", (PyCFunction) KX_ObjectActuator::sPySetTorque, METH_VARARGS}, - {"getDLoc", (PyCFunction) KX_ObjectActuator::sPyGetDLoc, METH_NOARGS}, - {"setDLoc", (PyCFunction) KX_ObjectActuator::sPySetDLoc, METH_VARARGS}, - {"getDRot", (PyCFunction) KX_ObjectActuator::sPyGetDRot, METH_NOARGS}, - {"setDRot", (PyCFunction) KX_ObjectActuator::sPySetDRot, METH_VARARGS}, - {"getLinearVelocity", (PyCFunction) KX_ObjectActuator::sPyGetLinearVelocity, METH_NOARGS}, - {"setLinearVelocity", (PyCFunction) KX_ObjectActuator::sPySetLinearVelocity, METH_VARARGS}, - {"getAngularVelocity", (PyCFunction) KX_ObjectActuator::sPyGetAngularVelocity, METH_NOARGS}, - {"setAngularVelocity", (PyCFunction) KX_ObjectActuator::sPySetAngularVelocity, METH_VARARGS}, - {"setDamping", (PyCFunction) KX_ObjectActuator::sPySetDamping, METH_VARARGS}, - {"getDamping", (PyCFunction) KX_ObjectActuator::sPyGetDamping, METH_NOARGS}, - {"setForceLimitX", (PyCFunction) KX_ObjectActuator::sPySetForceLimitX, METH_VARARGS}, - {"getForceLimitX", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitX, METH_NOARGS}, - {"setForceLimitY", (PyCFunction) KX_ObjectActuator::sPySetForceLimitY, METH_VARARGS}, - {"getForceLimitY", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitY, METH_NOARGS}, - {"setForceLimitZ", (PyCFunction) KX_ObjectActuator::sPySetForceLimitZ, METH_VARARGS}, - {"getForceLimitZ", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitZ, METH_NOARGS}, - {"setPID", (PyCFunction) KX_ObjectActuator::sPyGetPID, METH_NOARGS}, - {"getPID", (PyCFunction) KX_ObjectActuator::sPySetPID, METH_VARARGS}, - - // <----- Deprecated - {NULL,NULL} //Sentinel }; @@ -667,305 +641,4 @@ int KX_ObjectActuator::pyattr_set_reference(void *self, const struct KX_PYATTRIB return PY_SET_ATTR_SUCCESS; } - -/* 1. set ------------------------------------------------------------------ */ -/* Removed! */ - -/* 2. getForce */ -PyObject* KX_ObjectActuator::PyGetForce() -{ - ShowDeprecationWarning("getForce()", "the force and the useLocalForce properties"); - PyObject *retVal = PyList_New(4); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_force[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_force[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_force[2])); - PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.Force)); - - return retVal; -} -/* 3. setForce */ -PyObject* KX_ObjectActuator::PySetForce(PyObject* args) -{ - ShowDeprecationWarning("setForce()", "the force and the useLocalForce properties"); - float vecArg[3]; - int bToggle = 0; - if (!PyArg_ParseTuple(args, "fffi:setForce", &vecArg[0], &vecArg[1], - &vecArg[2], &bToggle)) { - return NULL; - } - m_force.setValue(vecArg); - m_bitLocalFlag.Force = PyArgToBool(bToggle); - UpdateFuzzyFlags(); - Py_RETURN_NONE; -} - -/* 4. getTorque */ -PyObject* KX_ObjectActuator::PyGetTorque() -{ - ShowDeprecationWarning("getTorque()", "the torque and the useLocalTorque properties"); - PyObject *retVal = PyList_New(4); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_torque[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_torque[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_torque[2])); - PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.Torque)); - - return retVal; -} -/* 5. setTorque */ -PyObject* KX_ObjectActuator::PySetTorque(PyObject* args) -{ - ShowDeprecationWarning("setTorque()", "the torque and the useLocalTorque properties"); - float vecArg[3]; - int bToggle = 0; - if (!PyArg_ParseTuple(args, "fffi:setTorque", &vecArg[0], &vecArg[1], - &vecArg[2], &bToggle)) { - return NULL; - } - m_torque.setValue(vecArg); - m_bitLocalFlag.Torque = PyArgToBool(bToggle); - UpdateFuzzyFlags(); - Py_RETURN_NONE; -} - -/* 6. getDLoc */ -PyObject* KX_ObjectActuator::PyGetDLoc() -{ - ShowDeprecationWarning("getDLoc()", "the dLoc and the useLocalDLoc properties"); - PyObject *retVal = PyList_New(4); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_dloc[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_dloc[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_dloc[2])); - PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.DLoc)); - - return retVal; -} -/* 7. setDLoc */ -PyObject* KX_ObjectActuator::PySetDLoc(PyObject* args) -{ - ShowDeprecationWarning("setDLoc()", "the dLoc and the useLocalDLoc properties"); - float vecArg[3]; - int bToggle = 0; - if(!PyArg_ParseTuple(args, "fffi:setDLoc", &vecArg[0], &vecArg[1], - &vecArg[2], &bToggle)) { - return NULL; - } - m_dloc.setValue(vecArg); - m_bitLocalFlag.DLoc = PyArgToBool(bToggle); - UpdateFuzzyFlags(); - Py_RETURN_NONE; -} - -/* 8. getDRot */ -PyObject* KX_ObjectActuator::PyGetDRot() -{ - ShowDeprecationWarning("getDRot()", "the dRot and the useLocalDRot properties"); - PyObject *retVal = PyList_New(4); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_drot[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_drot[2])); - PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.DRot)); - - return retVal; -} -/* 9. setDRot */ -PyObject* KX_ObjectActuator::PySetDRot(PyObject* args) -{ - ShowDeprecationWarning("setDRot()", "the dRot and the useLocalDRot properties"); - float vecArg[3]; - int bToggle = 0; - if (!PyArg_ParseTuple(args, "fffi:setDRot", &vecArg[0], &vecArg[1], - &vecArg[2], &bToggle)) { - return NULL; - } - m_drot.setValue(vecArg); - m_bitLocalFlag.DRot = PyArgToBool(bToggle); - UpdateFuzzyFlags(); - Py_RETURN_NONE; -} - -/* 10. getLinearVelocity */ -PyObject* KX_ObjectActuator::PyGetLinearVelocity() { - ShowDeprecationWarning("getLinearVelocity()", "the linV and the useLocalLinV properties"); - PyObject *retVal = PyList_New(4); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_linear_velocity[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_linear_velocity[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_linear_velocity[2])); - PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.LinearVelocity)); - - return retVal; -} - -/* 11. setLinearVelocity */ -PyObject* KX_ObjectActuator::PySetLinearVelocity(PyObject* args) { - ShowDeprecationWarning("setLinearVelocity()", "the linV and the useLocalLinV properties"); - float vecArg[3]; - int bToggle = 0; - if (!PyArg_ParseTuple(args, "fffi:setLinearVelocity", &vecArg[0], &vecArg[1], - &vecArg[2], &bToggle)) { - return NULL; - } - m_linear_velocity.setValue(vecArg); - m_bitLocalFlag.LinearVelocity = PyArgToBool(bToggle); - UpdateFuzzyFlags(); - Py_RETURN_NONE; -} - - -/* 12. getAngularVelocity */ -PyObject* KX_ObjectActuator::PyGetAngularVelocity() { - ShowDeprecationWarning("getAngularVelocity()", "the angV and the useLocalAngV properties"); - PyObject *retVal = PyList_New(4); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_angular_velocity[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_angular_velocity[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_angular_velocity[2])); - PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.AngularVelocity)); - - return retVal; -} -/* 13. setAngularVelocity */ -PyObject* KX_ObjectActuator::PySetAngularVelocity(PyObject* args) { - ShowDeprecationWarning("setAngularVelocity()", "the angV and the useLocalAngV properties"); - float vecArg[3]; - int bToggle = 0; - if (!PyArg_ParseTuple(args, "fffi:setAngularVelocity", &vecArg[0], &vecArg[1], - &vecArg[2], &bToggle)) { - return NULL; - } - m_angular_velocity.setValue(vecArg); - m_bitLocalFlag.AngularVelocity = PyArgToBool(bToggle); - UpdateFuzzyFlags(); - Py_RETURN_NONE; -} - -/* 13. setDamping */ -PyObject* KX_ObjectActuator::PySetDamping(PyObject* args) { - ShowDeprecationWarning("setDamping()", "the damping property"); - int damping = 0; - if (!PyArg_ParseTuple(args, "i:setDamping", &damping) || damping < 0 || damping > 1000) { - return NULL; - } - m_damping = damping; - Py_RETURN_NONE; -} - -/* 13. getVelocityDamping */ -PyObject* KX_ObjectActuator::PyGetDamping() { - ShowDeprecationWarning("getDamping()", "the damping property"); - return Py_BuildValue("i",m_damping); -} -/* 6. getForceLimitX */ -PyObject* KX_ObjectActuator::PyGetForceLimitX() -{ - ShowDeprecationWarning("getForceLimitX()", "the forceLimitX property"); - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_dloc[0])); - PyList_SET_ITEM(retVal, 2, BoolToPyArg(m_bitLocalFlag.Torque)); - - return retVal; -} -/* 7. setForceLimitX */ -PyObject* KX_ObjectActuator::PySetForceLimitX(PyObject* args) -{ - ShowDeprecationWarning("setForceLimitX()", "the forceLimitX property"); - float vecArg[2]; - int bToggle = 0; - if(!PyArg_ParseTuple(args, "ffi:setForceLimitX", &vecArg[0], &vecArg[1], &bToggle)) { - return NULL; - } - m_drot[0] = vecArg[0]; - m_dloc[0] = vecArg[1]; - m_bitLocalFlag.Torque = PyArgToBool(bToggle); - Py_RETURN_NONE; -} - -/* 6. getForceLimitY */ -PyObject* KX_ObjectActuator::PyGetForceLimitY() -{ - ShowDeprecationWarning("getForceLimitY()", "the forceLimitY property"); - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[1])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_dloc[1])); - PyList_SET_ITEM(retVal, 2, BoolToPyArg(m_bitLocalFlag.DLoc)); - - return retVal; -} -/* 7. setForceLimitY */ -PyObject* KX_ObjectActuator::PySetForceLimitY(PyObject* args) -{ - ShowDeprecationWarning("setForceLimitY()", "the forceLimitY property"); - float vecArg[2]; - int bToggle = 0; - if(!PyArg_ParseTuple(args, "ffi:setForceLimitY", &vecArg[0], &vecArg[1], &bToggle)) { - return NULL; - } - m_drot[1] = vecArg[0]; - m_dloc[1] = vecArg[1]; - m_bitLocalFlag.DLoc = PyArgToBool(bToggle); - Py_RETURN_NONE; -} - -/* 6. getForceLimitZ */ -PyObject* KX_ObjectActuator::PyGetForceLimitZ() -{ - ShowDeprecationWarning("getForceLimitZ()", "the forceLimitZ property"); - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[2])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_dloc[2])); - PyList_SET_ITEM(retVal, 2, BoolToPyArg(m_bitLocalFlag.DRot)); - - return retVal; -} -/* 7. setForceLimitZ */ -PyObject* KX_ObjectActuator::PySetForceLimitZ(PyObject* args) -{ - ShowDeprecationWarning("setForceLimitZ()", "the forceLimitZ property"); - float vecArg[2]; - int bToggle = 0; - if(!PyArg_ParseTuple(args, "ffi:setForceLimitZ", &vecArg[0], &vecArg[1], &bToggle)) { - return NULL; - } - m_drot[2] = vecArg[0]; - m_dloc[2] = vecArg[1]; - m_bitLocalFlag.DRot = PyArgToBool(bToggle); - Py_RETURN_NONE; -} - -/* 4. getPID */ -PyObject* KX_ObjectActuator::PyGetPID() -{ - ShowDeprecationWarning("getPID()", "the pid property"); - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_pid[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_pid[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_pid[2])); - - return retVal; -} -/* 5. setPID */ -PyObject* KX_ObjectActuator::PySetPID(PyObject* args) -{ - ShowDeprecationWarning("setPID()", "the pid property"); - float vecArg[3]; - if (!PyArg_ParseTuple(args, "fff:setPID", &vecArg[0], &vecArg[1], &vecArg[2])) { - return NULL; - } - m_pid.setValue(vecArg); - Py_RETURN_NONE; -} - - - - - /* eof */ diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.h b/source/gameengine/Ketsji/KX_ObjectActuator.h index 20aec9e0e86..7a8c7de16b1 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.h +++ b/source/gameengine/Ketsji/KX_ObjectActuator.h @@ -163,29 +163,6 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForce); - KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetForce); - KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetTorque); - KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetTorque); - KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetDLoc); - KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetDLoc); - KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetDRot); - KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetDRot); - KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetLinearVelocity); - KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetLinearVelocity); - KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetAngularVelocity); - KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetAngularVelocity); - KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetDamping); - KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetDamping); - KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForceLimitX); - KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetForceLimitX); - KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForceLimitY); - KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetForceLimitY); - KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForceLimitZ); - KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetForceLimitZ); - KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetPID); - KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetPID); - /* Attributes */ static PyObject* pyattr_get_forceLimitX(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_forceLimitX(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); diff --git a/source/gameengine/Ketsji/KX_ParentActuator.cpp b/source/gameengine/Ketsji/KX_ParentActuator.cpp index 621aeea87be..20e982f03e0 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.cpp +++ b/source/gameengine/Ketsji/KX_ParentActuator.cpp @@ -162,10 +162,6 @@ PyTypeObject KX_ParentActuator::Type = { }; PyMethodDef KX_ParentActuator::Methods[] = { - // Deprecated -----> - {"setObject", (PyCFunction) KX_ParentActuator::sPySetObject, METH_O, (const char *)SetObject_doc}, - {"getObject", (PyCFunction) KX_ParentActuator::sPyGetObject, METH_VARARGS, (const char *)GetObject_doc}, - // <----- {NULL,NULL} //Sentinel }; @@ -205,55 +201,4 @@ int KX_ParentActuator::pyattr_set_object(void *self, const struct KX_PYATTRIBUTE return PY_SET_ATTR_SUCCESS; } - -/* Deprecated -----> */ -/* 1. setObject */ -const char KX_ParentActuator::SetObject_doc[] = -"setObject(object)\n" -"\t- object: KX_GameObject, string or None\n" -"\tSet the object to set as parent.\n"; -PyObject* KX_ParentActuator::PySetObject(PyObject* value) { - KX_GameObject *gameobj; - - ShowDeprecationWarning("setObject()", "the object property"); - - if (!ConvertPythonToGameObject(value, &gameobj, true, "actuator.setObject(value): KX_ParentActuator")) - return NULL; // ConvertPythonToGameObject sets the error - - if (m_ob != NULL) - m_ob->UnregisterActuator(this); - - m_ob = (SCA_IObject*)gameobj; - if (m_ob) - m_ob->RegisterActuator(this); - - Py_RETURN_NONE; -} - -/* 2. getObject */ - -/* get obj ---------------------------------------------------------- */ -const char KX_ParentActuator::GetObject_doc[] = -"getObject(name_only = 1)\n" -"name_only - optional arg, when true will return the KX_GameObject rather then its name\n" -"\tReturns the object that is set to.\n"; -PyObject* KX_ParentActuator::PyGetObject(PyObject* args) -{ - int ret_name_only = 1; - - ShowDeprecationWarning("getObject()", "the object property"); - - if (!PyArg_ParseTuple(args, "|i:getObject", &ret_name_only)) - return NULL; - - if (!m_ob) - Py_RETURN_NONE; - - if (ret_name_only) - return PyUnicode_FromString(m_ob->GetName().ReadPtr()); - else - return m_ob->GetProxy(); -} -/* <----- */ - /* eof */ diff --git a/source/gameengine/Ketsji/KX_ParentActuator.h b/source/gameengine/Ketsji/KX_ParentActuator.h index aeb39eabf89..f750affc8a1 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.h +++ b/source/gameengine/Ketsji/KX_ParentActuator.h @@ -84,11 +84,6 @@ class KX_ParentActuator : public SCA_IActuator /* These are used to get and set m_ob */ static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); - - // Deprecated -----> - KX_PYMETHOD_DOC_O(KX_ParentActuator,SetObject); - KX_PYMETHOD_DOC_VARARGS(KX_ParentActuator,GetObject); - // <----- }; /* end of class KX_ParentActuator : public SCA_PropertyActuator */ diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 49cf895af17..5afaf61dee2 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -484,8 +484,6 @@ static struct PyMethodDef game_methods[] = { METH_NOARGS, gPyGetCurrentScene_doc}, {"getSceneList", (PyCFunction) gPyGetSceneList, METH_NOARGS, (const char *)gPyGetSceneList_doc}, - {"addActiveActuator",(PyCFunction) SCA_PythonController::sPyAddActiveActuator, - METH_VARARGS, (const char *)SCA_PythonController::sPyAddActiveActuator__doc__}, {"getRandomFloat",(PyCFunction) gPyGetRandomFloat, METH_NOARGS, (const char *)gPyGetRandomFloat_doc}, {"setGravity",(PyCFunction) gPySetGravity, METH_O, (const char *)"set Gravitation"}, diff --git a/source/gameengine/Ketsji/KX_RadarSensor.cpp b/source/gameengine/Ketsji/KX_RadarSensor.cpp index d020a2544d2..eb127be8044 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.cpp +++ b/source/gameengine/Ketsji/KX_RadarSensor.cpp @@ -176,51 +176,7 @@ void KX_RadarSensor::SynchronizeTransform() /* Python Functions */ /* ------------------------------------------------------------------------- */ -//Deprecated -----> -/* getConeOrigin */ -const char KX_RadarSensor::GetConeOrigin_doc[] = -"getConeOrigin()\n" -"\tReturns the origin of the cone with which to test. The origin\n" -"\tis in the middle of the cone."; -PyObject* KX_RadarSensor::PyGetConeOrigin() { - ShowDeprecationWarning("getConeOrigin()", "the coneOrigin property"); - - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_cone_origin[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_cone_origin[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_cone_origin[2])); - - return retVal; -} - -/* getConeOrigin */ -const char KX_RadarSensor::GetConeTarget_doc[] = -"getConeTarget()\n" -"\tReturns the center of the bottom face of the cone with which to test.\n"; -PyObject* KX_RadarSensor::PyGetConeTarget() { - ShowDeprecationWarning("getConeTarget()", "the coneTarget property"); - - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_cone_target[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_cone_target[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_cone_target[2])); - - return retVal; -} - -/* getConeHeight */ -const char KX_RadarSensor::GetConeHeight_doc[] = -"getConeHeight()\n" -"\tReturns the height of the cone with which to test.\n"; -PyObject* KX_RadarSensor::PyGetConeHeight() { - - ShowDeprecationWarning("getConeHeight()", "the distance property"); - - return PyFloat_FromDouble(m_coneheight); -} -//<----- Deprecated +/* none */ /* ------------------------------------------------------------------------- */ /* Python Integration Hooks */ @@ -248,14 +204,6 @@ PyTypeObject KX_RadarSensor::Type = { }; PyMethodDef KX_RadarSensor::Methods[] = { - //Deprecated -----> - {"getConeOrigin", (PyCFunction) KX_RadarSensor::sPyGetConeOrigin, - METH_VARARGS, (const char *)GetConeOrigin_doc}, - {"getConeTarget", (PyCFunction) KX_RadarSensor::sPyGetConeTarget, - METH_VARARGS, (const char *)GetConeTarget_doc}, - {"getConeHeight", (PyCFunction) KX_RadarSensor::sPyGetConeHeight, - METH_VARARGS, (const char *)GetConeHeight_doc}, - //<----- {NULL} //Sentinel }; diff --git a/source/gameengine/Ketsji/KX_RadarSensor.h b/source/gameengine/Ketsji/KX_RadarSensor.h index 9f38d75abc4..487e9f1aaa7 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.h +++ b/source/gameengine/Ketsji/KX_RadarSensor.h @@ -90,11 +90,6 @@ public: /* python */ virtual sensortype GetSensorType() { return ST_RADAR; } - //Deprecated -----> - KX_PYMETHOD_DOC_NOARGS(KX_RadarSensor,GetConeOrigin); - KX_PYMETHOD_DOC_NOARGS(KX_RadarSensor,GetConeTarget); - KX_PYMETHOD_DOC_NOARGS(KX_RadarSensor,GetConeHeight); - //<----- }; #endif //__KX_RADAR_SENSOR_H diff --git a/source/gameengine/Ketsji/KX_RaySensor.cpp b/source/gameengine/Ketsji/KX_RaySensor.cpp index 8616145d709..1f36945ccaa 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.cpp +++ b/source/gameengine/Ketsji/KX_RaySensor.cpp @@ -342,12 +342,6 @@ PyTypeObject KX_RaySensor::Type = { }; PyMethodDef KX_RaySensor::Methods[] = { - // Deprecated -----> - {"getHitObject",(PyCFunction) KX_RaySensor::sPyGetHitObject,METH_NOARGS, (const char *)GetHitObject_doc}, - {"getHitPosition",(PyCFunction) KX_RaySensor::sPyGetHitPosition,METH_NOARGS, (const char *)GetHitPosition_doc}, - {"getHitNormal",(PyCFunction) KX_RaySensor::sPyGetHitNormal,METH_NOARGS, (const char *)GetHitNormal_doc}, - {"getRayDirection",(PyCFunction) KX_RaySensor::sPyGetRayDirection,METH_NOARGS, (const char *)GetRayDirection_doc}, - // <----- {NULL,NULL} //Sentinel }; @@ -372,68 +366,3 @@ PyObject* KX_RaySensor::pyattr_get_hitobject(void *self_v, const KX_PYATTRIBUTE_ Py_RETURN_NONE; } - -// Deprecated -----> -const char KX_RaySensor::GetHitObject_doc[] = -"getHitObject()\n" -"\tReturns the name of the object that was hit by this ray.\n"; -PyObject* KX_RaySensor::PyGetHitObject() -{ - ShowDeprecationWarning("getHitObject()", "the hitObject property"); - if (m_hitObject) - { - return m_hitObject->GetProxy(); - } - Py_RETURN_NONE; -} - - -const char KX_RaySensor::GetHitPosition_doc[] = -"getHitPosition()\n" -"\tReturns the position (in worldcoordinates) where the object was hit by this ray.\n"; -PyObject* KX_RaySensor::PyGetHitPosition() -{ - ShowDeprecationWarning("getHitPosition()", "the hitPosition property"); - - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_hitPosition[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_hitPosition[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_hitPosition[2])); - - return retVal; -} - -const char KX_RaySensor::GetRayDirection_doc[] = -"getRayDirection()\n" -"\tReturns the direction from the ray (in worldcoordinates) .\n"; -PyObject* KX_RaySensor::PyGetRayDirection() -{ - ShowDeprecationWarning("getRayDirection()", "the rayDirection property"); - - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_rayDirection[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_rayDirection[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_rayDirection[2])); - - return retVal; -} - -const char KX_RaySensor::GetHitNormal_doc[] = -"getHitNormal()\n" -"\tReturns the normal (in worldcoordinates) of the object at the location where the object was hit by this ray.\n"; -PyObject* KX_RaySensor::PyGetHitNormal() -{ - ShowDeprecationWarning("getHitNormal()", "the hitNormal property"); - - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_hitNormal[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_hitNormal[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_hitNormal[2])); - - return retVal; -} - -// <----- Deprecated diff --git a/source/gameengine/Ketsji/KX_RaySensor.h b/source/gameengine/Ketsji/KX_RaySensor.h index 530c8ce54e5..d3e92a14214 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.h +++ b/source/gameengine/Ketsji/KX_RaySensor.h @@ -84,12 +84,6 @@ public: KX_RAY_AXIS_NEG_Z }; - // Deprecated -----> - KX_PYMETHOD_DOC_NOARGS(KX_RaySensor,GetHitObject); - KX_PYMETHOD_DOC_NOARGS(KX_RaySensor,GetHitPosition); - KX_PYMETHOD_DOC_NOARGS(KX_RaySensor,GetHitNormal); - KX_PYMETHOD_DOC_NOARGS(KX_RaySensor,GetRayDirection); - // <----- /* Attributes */ static PyObject* pyattr_get_hitobject(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp index fffb0ac1220..099403fc28d 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp @@ -192,18 +192,7 @@ PyTypeObject KX_SCA_AddObjectActuator::Type = { }; PyMethodDef KX_SCA_AddObjectActuator::Methods[] = { - // ---> deprecated - {"setTime", (PyCFunction) KX_SCA_AddObjectActuator::sPySetTime, METH_O, (const char *)SetTime_doc}, - {"getTime", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetTime, METH_NOARGS, (const char *)GetTime_doc}, - {"getLinearVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetLinearVelocity, METH_NOARGS, (const char *)GetLinearVelocity_doc}, - {"setLinearVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPySetLinearVelocity, METH_VARARGS, (const char *)SetLinearVelocity_doc}, - {"getAngularVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetAngularVelocity, METH_NOARGS, (const char *)GetAngularVelocity_doc}, - {"setAngularVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPySetAngularVelocity, METH_VARARGS, (const char *)SetAngularVelocity_doc}, - {"getLastCreatedObject", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetLastCreatedObject, METH_NOARGS,"getLastCreatedObject() : get the object handle to the last created object\n"}, {"instantAddObject", (PyCFunction) KX_SCA_AddObjectActuator::sPyInstantAddObject, METH_NOARGS,"instantAddObject() : immediately add object without delay\n"}, - {"setObject", (PyCFunction) KX_SCA_AddObjectActuator::sPySetObject, METH_O, (const char *)SetObject_doc}, - {"getObject", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetObject, METH_VARARGS, (const char *)GetObject_doc}, - {NULL,NULL} //Sentinel }; @@ -253,181 +242,6 @@ PyObject* KX_SCA_AddObjectActuator::pyattr_get_objectLastCreated(void *self, con return actuator->m_lastCreatedObject->GetProxy(); } -/* 1. setObject */ -const char KX_SCA_AddObjectActuator::SetObject_doc[] = -"setObject(object)\n" -"\t- object: KX_GameObject, string or None\n" -"\tSets the object that will be added. There has to be an object\n" -"\tof this name. If not, this function does nothing.\n"; -PyObject* KX_SCA_AddObjectActuator::PySetObject(PyObject* value) -{ - KX_GameObject *gameobj; - - ShowDeprecationWarning("setObject()", "the object property"); - - if (!ConvertPythonToGameObject(value, &gameobj, true, "actuator.setObject(value): KX_SCA_AddObjectActuator")) - return NULL; // ConvertPythonToGameObject sets the error - - if (m_OriginalObject != NULL) - m_OriginalObject->UnregisterActuator(this); - - m_OriginalObject = (SCA_IObject*)gameobj; - if (m_OriginalObject) - m_OriginalObject->RegisterActuator(this); - - Py_RETURN_NONE; -} - - - -/* 2. setTime */ -const char KX_SCA_AddObjectActuator::SetTime_doc[] = -"setTime(duration)\n" -"\t- duration: integer\n" -"\tSets the lifetime of the object that will be added, in frames. \n" -"\tIf the duration is negative, it is set to 0.\n"; - - -PyObject* KX_SCA_AddObjectActuator::PySetTime(PyObject* value) -{ - ShowDeprecationWarning("setTime()", "the time property"); - int deltatime = PyLong_AsSsize_t(value); - if (deltatime==-1 && PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, "expected an int"); - return NULL; - } - - m_timeProp = deltatime; - if (m_timeProp < 0) m_timeProp = 0; - - Py_RETURN_NONE; -} - - - -/* 3. getTime */ -const char KX_SCA_AddObjectActuator::GetTime_doc[] = -"getTime()\n" -"\tReturns the lifetime of the object that will be added.\n"; - - -PyObject* KX_SCA_AddObjectActuator::PyGetTime() -{ - ShowDeprecationWarning("getTime()", "the time property"); - return PyLong_FromSsize_t(m_timeProp); -} - - -/* 4. getObject */ -const char KX_SCA_AddObjectActuator::GetObject_doc[] = -"getObject(name_only = 1)\n" -"name_only - optional arg, when true will return the KX_GameObject rather then its name\n" -"\tReturns the name of the object that will be added.\n"; -PyObject* KX_SCA_AddObjectActuator::PyGetObject(PyObject* args) -{ - int ret_name_only = 1; - - ShowDeprecationWarning("getObject()", "the object property"); - - if (!PyArg_ParseTuple(args, "|i:getObject", &ret_name_only)) - return NULL; - - if (!m_OriginalObject) - Py_RETURN_NONE; - - if (ret_name_only) - return PyUnicode_FromString(m_OriginalObject->GetName().ReadPtr()); - else - return m_OriginalObject->GetProxy(); -} - - - -/* 5. getLinearVelocity */ -const char KX_SCA_AddObjectActuator::GetLinearVelocity_doc[] = -"GetLinearVelocity()\n" -"\tReturns the linear velocity that will be assigned to \n" -"\tthe created object.\n"; - -PyObject* KX_SCA_AddObjectActuator::PyGetLinearVelocity() -{ - ShowDeprecationWarning("getLinearVelocity()", "the linearVelocity property"); - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_linear_velocity[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_linear_velocity[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_linear_velocity[2])); - - return retVal; -} - - - -/* 6. setLinearVelocity */ -const char KX_SCA_AddObjectActuator::SetLinearVelocity_doc[] = -"setLinearVelocity(vx, vy, vz)\n" -"\t- vx: float\n" -"\t- vy: float\n" -"\t- vz: float\n" -"\t- local: bool\n" -"\tAssign this velocity to the created object. \n"; - -PyObject* KX_SCA_AddObjectActuator::PySetLinearVelocity(PyObject* args) -{ - ShowDeprecationWarning("setLinearVelocity()", "the linearVelocity property"); - - float vecArg[3]; - if (!PyArg_ParseTuple(args, "fff:setLinearVelocity", &vecArg[0], &vecArg[1], &vecArg[2])) - return NULL; - - m_linear_velocity[0] = vecArg[0]; - m_linear_velocity[1] = vecArg[1]; - m_linear_velocity[2] = vecArg[2]; - Py_RETURN_NONE; -} - -/* 7. getAngularVelocity */ -const char KX_SCA_AddObjectActuator::GetAngularVelocity_doc[] = -"GetAngularVelocity()\n" -"\tReturns the angular velocity that will be assigned to \n" -"\tthe created object.\n"; - -PyObject* KX_SCA_AddObjectActuator::PyGetAngularVelocity() -{ - ShowDeprecationWarning("getAngularVelocity()", "the angularVelocity property"); - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_angular_velocity[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_angular_velocity[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_angular_velocity[2])); - - return retVal; -} - - - -/* 8. setAngularVelocity */ -const char KX_SCA_AddObjectActuator::SetAngularVelocity_doc[] = -"setAngularVelocity(vx, vy, vz)\n" -"\t- vx: float\n" -"\t- vy: float\n" -"\t- vz: float\n" -"\t- local: bool\n" -"\tAssign this angular velocity to the created object. \n"; - -PyObject* KX_SCA_AddObjectActuator::PySetAngularVelocity(PyObject* args) -{ - ShowDeprecationWarning("setAngularVelocity()", "the angularVelocity property"); - - float vecArg[3]; - if (!PyArg_ParseTuple(args, "fff:setAngularVelocity", &vecArg[0], &vecArg[1], &vecArg[2])) - return NULL; - - m_angular_velocity[0] = vecArg[0]; - m_angular_velocity[1] = vecArg[1]; - m_angular_velocity[2] = vecArg[2]; - Py_RETURN_NONE; -} void KX_SCA_AddObjectActuator::InstantAddObject() { @@ -470,26 +284,3 @@ PyObject* KX_SCA_AddObjectActuator::PyInstantAddObject() Py_RETURN_NONE; } - - - -/* 7. GetLastCreatedObject */ -const char KX_SCA_AddObjectActuator::GetLastCreatedObject_doc[] = -"getLastCreatedObject()\n" -"\tReturn the last created object. \n"; - - -PyObject* KX_SCA_AddObjectActuator::PyGetLastCreatedObject() -{ - ShowDeprecationWarning("getLastCreatedObject()", "the objectLastCreated property"); - SCA_IObject* result = this->GetLastCreatedObject(); - - // if result->GetSGNode() is NULL - // it means the object has ended, The BGE python api crashes in many places if the object is returned. - if (result && (static_cast(result))->GetSGNode()) - { - return result->GetProxy(); - } - // don't return NULL to python anymore, it gives trouble in the scripts - Py_RETURN_NONE; -} diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h index 3151e7a89ca..7137ba5209e 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h @@ -115,25 +115,6 @@ public: void InstantAddObject(); - /* 1. setObject */ - KX_PYMETHOD_DOC_O(KX_SCA_AddObjectActuator,SetObject); - /* 2. setTime */ - KX_PYMETHOD_DOC_O(KX_SCA_AddObjectActuator,SetTime); - /* 3. getTime */ - KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,GetTime); - /* 4. getObject */ - KX_PYMETHOD_DOC_VARARGS(KX_SCA_AddObjectActuator,GetObject); - /* 5. getLinearVelocity */ - KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,GetLinearVelocity); - /* 6. setLinearVelocity */ - KX_PYMETHOD_DOC_VARARGS(KX_SCA_AddObjectActuator,SetLinearVelocity); - /* 7. getAngularVelocity */ - KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,GetAngularVelocity); - /* 8. setAngularVelocity */ - KX_PYMETHOD_DOC_VARARGS(KX_SCA_AddObjectActuator,SetAngularVelocity); - /* 9. getLastCreatedObject */ - KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,GetLastCreatedObject); - /* 10. instantAddObject*/ KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,InstantAddObject); static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp index 196c1915f72..646cfb7219f 100644 --- a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp @@ -70,9 +70,6 @@ PyTypeObject KX_SCA_DynamicActuator::Type = { }; PyMethodDef KX_SCA_DynamicActuator::Methods[] = { - // ---> deprecated - KX_PYMETHODTABLE(KX_SCA_DynamicActuator, setOperation), - KX_PYMETHODTABLE(KX_SCA_DynamicActuator, getOperation), {NULL,NULL} //Sentinel }; @@ -82,42 +79,6 @@ PyAttributeDef KX_SCA_DynamicActuator::Attributes[] = { { NULL } //Sentinel }; - -/* 1. setOperation */ -KX_PYMETHODDEF_DOC(KX_SCA_DynamicActuator, setOperation, -"setOperation(operation?)\n" -"\t - operation? : type of dynamic operation\n" -"\t 0 = restore dynamics\n" -"\t 1 = disable dynamics\n" -"\t 2 = enable rigid body\n" -"\t 3 = disable rigid body\n" -"Change the dynamic status of the parent object.\n") -{ - ShowDeprecationWarning("setOperation()", "the mode property"); - int dyn_operation; - - if (!PyArg_ParseTuple(args, "i:setOperation", &dyn_operation)) - { - return NULL; - } - if (dyn_operation <0 || dyn_operation>3) { - PyErr_SetString(PyExc_IndexError, "Dynamic Actuator's setOperation() range must be between 0 and 3"); - return NULL; - } - m_dyn_operation= dyn_operation; - Py_RETURN_NONE; -} - -KX_PYMETHODDEF_DOC(KX_SCA_DynamicActuator, getOperation, -"getOperation() -> integer\n" -"Returns the operation type of this actuator.\n" -) -{ - ShowDeprecationWarning("getOperation()", "the mode property"); - return PyLong_FromSsize_t((long)m_dyn_operation); -} - - /* ------------------------------------------------------------------------- */ /* Native functions */ /* ------------------------------------------------------------------------- */ diff --git a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h index 8b598c9ecfa..58b28654eca 100644 --- a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h @@ -71,11 +71,6 @@ class KX_SCA_DynamicActuator : public SCA_IActuator KX_DYN_DISABLE_RIGID_BODY, KX_DYN_SET_MASS, }; - - /* 1. setOperation */ - KX_PYMETHOD_DOC(KX_SCA_DynamicActuator,setOperation); - KX_PYMETHOD_DOC(KX_SCA_DynamicActuator,getOperation); - }; #endif diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp index 0819ad99633..e85b8a32798 100644 --- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp @@ -74,9 +74,6 @@ PyTypeObject KX_SCA_ReplaceMeshActuator::Type = { PyMethodDef KX_SCA_ReplaceMeshActuator::Methods[] = { KX_PYMETHODTABLE(KX_SCA_ReplaceMeshActuator, instantReplaceMesh), - // Deprecated -----> - {"setMesh", (PyCFunction) KX_SCA_ReplaceMeshActuator::sPySetMesh, METH_O, (const char *)SetMesh_doc}, - KX_PYMETHODTABLE(KX_SCA_ReplaceMeshActuator, getMesh), {NULL,NULL} //Sentinel }; @@ -108,37 +105,6 @@ int KX_SCA_ReplaceMeshActuator::pyattr_set_mesh(void *self, const struct KX_PYAT return PY_SET_ATTR_SUCCESS; } -/* 1. setMesh */ -const char KX_SCA_ReplaceMeshActuator::SetMesh_doc[] = - "setMesh(name)\n" - "\t- name: string or None\n" - "\tSet the mesh that will be substituted for the current one.\n"; - -PyObject* KX_SCA_ReplaceMeshActuator::PySetMesh(PyObject* value) -{ - ShowDeprecationWarning("setMesh()", "the mesh property"); - RAS_MeshObject* new_mesh; - - if (!ConvertPythonToMesh(value, &new_mesh, true, "actuator.mesh = value: KX_SCA_ReplaceMeshActuator")) - return NULL; - - m_mesh = new_mesh; - Py_RETURN_NONE; -} - -KX_PYMETHODDEF_DOC(KX_SCA_ReplaceMeshActuator, getMesh, -"getMesh() -> string\n" -"Returns the name of the mesh to be substituted.\n" -) -{ - ShowDeprecationWarning("getMesh()", "the mesh property"); - if (!m_mesh) - Py_RETURN_NONE; - - return PyUnicode_FromString(const_cast(m_mesh->GetName().ReadPtr())); -} - - KX_PYMETHODDEF_DOC(KX_SCA_ReplaceMeshActuator, instantReplaceMesh, "instantReplaceMesh() : immediately replace mesh without delay\n") { diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h index 1e258420836..e5482c29aa7 100644 --- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h @@ -74,12 +74,13 @@ class KX_SCA_ReplaceMeshActuator : public SCA_IActuator void InstantReplaceMesh(); + /* --------------------------------------------------------------------- */ + /* Python interface ---------------------------------------------------- */ + /* --------------------------------------------------------------------- */ + static PyObject* pyattr_get_mesh(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_mesh(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); - /* 1. setMesh */ - KX_PYMETHOD_DOC_O(KX_SCA_ReplaceMeshActuator,SetMesh); - KX_PYMETHOD_DOC(KX_SCA_ReplaceMeshActuator,getMesh); KX_PYMETHOD_DOC(KX_SCA_ReplaceMeshActuator,instantReplaceMesh); }; diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index a9bb583bba7..3483496c3a6 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -1630,9 +1630,6 @@ PyTypeObject KX_Scene::Type = { }; PyMethodDef KX_Scene::Methods[] = { - KX_PYMETHODTABLE_NOARGS(KX_Scene, getLightList), - KX_PYMETHODTABLE_NOARGS(KX_Scene, getObjectList), - KX_PYMETHODTABLE_NOARGS(KX_Scene, getName), KX_PYMETHODTABLE(KX_Scene, addObject), /* dict style access */ @@ -1824,33 +1821,6 @@ PyAttributeDef KX_Scene::Attributes[] = { { NULL } //Sentinel }; -KX_PYMETHODDEF_DOC_NOARGS(KX_Scene, getLightList, -"getLightList() -> list [KX_Light]\n" -"Returns a list of all lights in the scene.\n" -) -{ - ShowDeprecationWarning("getLightList()", "the lights property"); - return m_lightlist->GetProxy(); -} - -KX_PYMETHODDEF_DOC_NOARGS(KX_Scene, getObjectList, -"getObjectList() -> list [KX_GameObject]\n" -"Returns a list of all game objects in the scene.\n" -) -{ - ShowDeprecationWarning("getObjectList()", "the objects property"); - return m_objectlist->GetProxy(); -} - -KX_PYMETHODDEF_DOC_NOARGS(KX_Scene, getName, -"getName() -> string\n" -"Returns the name of the scene.\n" -) -{ - ShowDeprecationWarning("getName()", "the name property"); - return PyUnicode_FromString(GetName()); -} - KX_PYMETHODDEF_DOC(KX_Scene, addObject, "addObject(object, other, time=0)\n" "Returns the added object.\n") diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h index 8d7c0ad8dec..3e0dc303d72 100644 --- a/source/gameengine/Ketsji/KX_Scene.h +++ b/source/gameengine/Ketsji/KX_Scene.h @@ -517,25 +517,12 @@ public: */ void SetNodeTree(SG_Tree* root); - KX_PYMETHOD_DOC_NOARGS(KX_Scene, getLightList); - KX_PYMETHOD_DOC_NOARGS(KX_Scene, getObjectList); - KX_PYMETHOD_DOC_NOARGS(KX_Scene, getName); + /* --------------------------------------------------------------------- */ + /* Python interface ---------------------------------------------------- */ + /* --------------------------------------------------------------------- */ + KX_PYMETHOD_DOC(KX_Scene, addObject); KX_PYMETHOD_DOC(KX_Scene, get); - -/* - KX_PYMETHOD_DOC(KX_Scene, getActiveCamera); - KX_PYMETHOD_DOC(KX_Scene, getActiveCamera); - KX_PYMETHOD_DOC(KX_Scene, findCamera); - - KX_PYMETHOD_DOC(KX_Scene, getGravity); - - KX_PYMETHOD_DOC(KX_Scene, setActivityCulling); - KX_PYMETHOD_DOC(KX_Scene, setActivityCullingRadius); - - KX_PYMETHOD_DOC(KX_Scene, setSceneViewport); - KX_PYMETHOD_DOC(KX_Scene, setSceneViewport); - */ /* attributes */ static PyObject* pyattr_get_name(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_SceneActuator.cpp b/source/gameengine/Ketsji/KX_SceneActuator.cpp index a0b7664d63a..ea1be7bca6c 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.cpp +++ b/source/gameengine/Ketsji/KX_SceneActuator.cpp @@ -245,14 +245,6 @@ PyTypeObject KX_SceneActuator::Type = { PyMethodDef KX_SceneActuator::Methods[] = { - //Deprecated functions ------> - {"setUseRestart", (PyCFunction) KX_SceneActuator::sPySetUseRestart, METH_VARARGS, (const char *)SetUseRestart_doc}, - {"setScene", (PyCFunction) KX_SceneActuator::sPySetScene, METH_VARARGS, (const char *)SetScene_doc}, - {"setCamera", (PyCFunction) KX_SceneActuator::sPySetCamera, METH_O, (const char *)SetCamera_doc}, - {"getUseRestart", (PyCFunction) KX_SceneActuator::sPyGetUseRestart, METH_NOARGS, (const char *)GetUseRestart_doc}, - {"getScene", (PyCFunction) KX_SceneActuator::sPyGetScene, METH_NOARGS, (const char *)GetScene_doc}, - {"getCamera", (PyCFunction) KX_SceneActuator::sPyGetCamera, METH_NOARGS, (const char *)GetCamera_doc}, - //<----- Deprecated {NULL,NULL} //Sentinel }; @@ -295,117 +287,4 @@ int KX_SceneActuator::pyattr_set_camera(void *self, const struct KX_PYATTRIBUTE_ return PY_SET_ATTR_SUCCESS; } - -/* 2. setUseRestart--------------------------------------------------------- */ -const char KX_SceneActuator::SetUseRestart_doc[] = -"setUseRestart(flag)\n" -"\t- flag: 0 or 1.\n" -"\tSet flag to 1 to restart the scene.\n" ; -PyObject* KX_SceneActuator::PySetUseRestart(PyObject* args) -{ - ShowDeprecationWarning("setUseRestart()", "the useRestart property"); - int boolArg; - - if (!PyArg_ParseTuple(args, "i:setUseRestart", &boolArg)) - { - return NULL; - } - - m_restart = boolArg != 0; - - Py_RETURN_NONE; -} - - - -/* 3. getUseRestart: */ -const char KX_SceneActuator::GetUseRestart_doc[] = -"getUseRestart()\n" -"\tReturn whether the scene will be restarted.\n" ; -PyObject* KX_SceneActuator::PyGetUseRestart() -{ - ShowDeprecationWarning("getUseRestart()", "the useRestart property"); - return PyLong_FromSsize_t(!(m_restart == 0)); -} - - - -/* 4. set scene------------------------------------------------------------- */ -const char KX_SceneActuator::SetScene_doc[] = -"setScene(scene)\n" -"\t- scene: string\n" -"\tSet the name of scene the actuator will switch to.\n" ; -PyObject* KX_SceneActuator::PySetScene(PyObject* args) -{ - ShowDeprecationWarning("setScene()", "the scene property"); - /* one argument: a scene, ignore the rest */ - char *scene_name; - - if(!PyArg_ParseTuple(args, "s:setScene", &scene_name)) - { - return NULL; - } - - /* Scene switch is done by name. */ - m_nextSceneName = scene_name; - - Py_RETURN_NONE; -} - - - -/* 5. getScene: */ -const char KX_SceneActuator::GetScene_doc[] = -"getScene()\n" -"\tReturn the name of the scene the actuator wants to switch to.\n" ; -PyObject* KX_SceneActuator::PyGetScene() -{ - ShowDeprecationWarning("getScene()", "the scene property"); - return PyUnicode_FromString(m_nextSceneName); -} - - - -/* 6. set camera------------------------------------------------------------ */ -const char KX_SceneActuator::SetCamera_doc[] = -"setCamera(camera)\n" -"\t- camera: string\n" -"\tSet the camera to switch to.\n" ; -PyObject* KX_SceneActuator::PySetCamera(PyObject* value) -{ - ShowDeprecationWarning("setCamera()", "the camera property"); - KX_Camera *camOb; - - if (!ConvertPythonToCamera(value, &camOb, true, "actu.setCamera(value): KX_SceneActuator")) - return NULL; - - if (m_camera) - m_camera->UnregisterActuator(this); - - if(camOb==NULL) { - m_camera= NULL; - } - else { - m_camera = camOb; - m_camera->RegisterActuator(this); - } - Py_RETURN_NONE; -} - - - -/* 7. getCamera: */ -const char KX_SceneActuator::GetCamera_doc[] = -"getCamera()\n" -"\tReturn the name of the camera to switch to.\n" ; -PyObject* KX_SceneActuator::PyGetCamera() -{ - ShowDeprecationWarning("getCamera()", "the camera property"); - if (m_camera) { - return PyUnicode_FromString(m_camera->GetName()); - } - else { - Py_RETURN_NONE; - } -} /* eof */ diff --git a/source/gameengine/Ketsji/KX_SceneActuator.h b/source/gameengine/Ketsji/KX_SceneActuator.h index 86de3395d1e..e979a8ce559 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.h +++ b/source/gameengine/Ketsji/KX_SceneActuator.h @@ -90,22 +90,6 @@ class KX_SceneActuator : public SCA_IActuator /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - - /* 1. set */ - /* Removed */ - - /* 2. setUseRestart: */ - KX_PYMETHOD_DOC_VARARGS(KX_SceneActuator,SetUseRestart); - /* 3. getUseRestart: */ - KX_PYMETHOD_DOC_NOARGS(KX_SceneActuator,GetUseRestart); - /* 4. setScene: */ - KX_PYMETHOD_DOC_VARARGS(KX_SceneActuator,SetScene); - /* 5. getScene: */ - KX_PYMETHOD_DOC_NOARGS(KX_SceneActuator,GetScene); - /* 6. setCamera: */ - KX_PYMETHOD_DOC_O(KX_SceneActuator,SetCamera); - /* 7. getCamera: */ - KX_PYMETHOD_DOC_NOARGS(KX_SceneActuator,GetCamera); static PyObject* pyattr_get_camera(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_camera(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp index 024c51cabc1..e2b4022a312 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.cpp +++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp @@ -296,17 +296,6 @@ PyTypeObject KX_SoundActuator::Type = { }; PyMethodDef KX_SoundActuator::Methods[] = { - // Deprecated -----> - {"setGain",(PyCFunction) KX_SoundActuator::sPySetGain,METH_VARARGS,NULL}, - {"getGain",(PyCFunction) KX_SoundActuator::sPyGetGain,METH_NOARGS,NULL}, - {"setPitch",(PyCFunction) KX_SoundActuator::sPySetPitch,METH_VARARGS,NULL}, - {"getPitch",(PyCFunction) KX_SoundActuator::sPyGetPitch,METH_NOARGS,NULL}, - {"setRollOffFactor",(PyCFunction) KX_SoundActuator::sPySetRollOffFactor,METH_VARARGS,NULL}, - {"getRollOffFactor",(PyCFunction) KX_SoundActuator::sPyGetRollOffFactor,METH_NOARGS,NULL}, - {"setType",(PyCFunction) KX_SoundActuator::sPySetType,METH_VARARGS,NULL}, - {"getType",(PyCFunction) KX_SoundActuator::sPyGetType,METH_NOARGS,NULL}, - // <----- - KX_PYMETHODTABLE_NOARGS(KX_SoundActuator, startSound), KX_PYMETHODTABLE_NOARGS(KX_SoundActuator, pauseSound), KX_PYMETHODTABLE_NOARGS(KX_SoundActuator, stopSound), @@ -427,109 +416,3 @@ int KX_SoundActuator::pyattr_set_rollOffFactor(void *self, const struct KX_PYATT return PY_SET_ATTR_SUCCESS; } - -PyObject* KX_SoundActuator::PySetGain(PyObject* args) -{ - ShowDeprecationWarning("setGain()", "the volume property"); - float gain = 1.0; - if (!PyArg_ParseTuple(args, "f:setGain", &gain)) - return NULL; - - m_volume = gain; - if(m_handle) - AUD_setSoundVolume(m_handle, gain); - - Py_RETURN_NONE; -} - - - -PyObject* KX_SoundActuator::PyGetGain() -{ - ShowDeprecationWarning("getGain()", "the volume property"); - float gain = m_volume; - PyObject* result = PyFloat_FromDouble(gain); - - return result; -} - - - -PyObject* KX_SoundActuator::PySetPitch(PyObject* args) -{ - ShowDeprecationWarning("setPitch()", "the pitch property"); - float pitch = 1.0; - if (!PyArg_ParseTuple(args, "f:setPitch", &pitch)) - return NULL; - - m_pitch = pitch; - if(m_handle) - AUD_setSoundPitch(m_handle, pitch); - - Py_RETURN_NONE; -} - - - -PyObject* KX_SoundActuator::PyGetPitch() -{ - ShowDeprecationWarning("getPitch()", "the pitch property"); - float pitch = m_pitch; - PyObject* result = PyFloat_FromDouble(pitch); - - return result; -} - - - -PyObject* KX_SoundActuator::PySetRollOffFactor(PyObject* args) -{ - ShowDeprecationWarning("setRollOffFactor()", "the rollOffFactor property"); - float rollofffactor = 1.0; - if (!PyArg_ParseTuple(args, "f:setRollOffFactor", &rollofffactor)) - return NULL; - - m_3d.rolloff_factor = rollofffactor; - if(m_handle) - AUD_set3DSourceSetting(m_handle, AUD_3DSS_ROLLOFF_FACTOR, rollofffactor); - - Py_RETURN_NONE; -} - - - -PyObject* KX_SoundActuator::PyGetRollOffFactor() -{ - ShowDeprecationWarning("getRollOffFactor()", "the rollOffFactor property"); - float rollofffactor = m_3d.rolloff_factor; - PyObject* result = PyFloat_FromDouble(rollofffactor); - - return result; -} - - - -PyObject* KX_SoundActuator::PySetType(PyObject* args) -{ - int typeArg; - ShowDeprecationWarning("setType()", "the mode property"); - - if (!PyArg_ParseTuple(args, "i:setType", &typeArg)) { - return NULL; - } - - if ( (typeArg > KX_SOUNDACT_NODEF) - && (typeArg < KX_SOUNDACT_MAX) ) { - m_type = (KX_SOUNDACT_TYPE) typeArg; - } - - Py_RETURN_NONE; -} - -PyObject* KX_SoundActuator::PyGetType() -{ - ShowDeprecationWarning("getType()", "the mode property"); - return PyLong_FromSsize_t(m_type); -} -// <----- - diff --git a/source/gameengine/Ketsji/KX_SoundActuator.h b/source/gameengine/Ketsji/KX_SoundActuator.h index bc0293ed2b4..43198f1a253 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.h +++ b/source/gameengine/Ketsji/KX_SoundActuator.h @@ -110,18 +110,6 @@ public: static PyObject* pyattr_get_pitch(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_rollOffFactor(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_type(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); - - // Deprecated -----> - KX_PYMETHOD_VARARGS(KX_SoundActuator,SetGain); - KX_PYMETHOD_NOARGS(KX_SoundActuator,GetGain); - KX_PYMETHOD_VARARGS(KX_SoundActuator,SetPitch); - KX_PYMETHOD_NOARGS(KX_SoundActuator,GetPitch); - KX_PYMETHOD_VARARGS(KX_SoundActuator,SetRollOffFactor); - KX_PYMETHOD_NOARGS(KX_SoundActuator,GetRollOffFactor); - KX_PYMETHOD_VARARGS(KX_SoundActuator,SetType); - KX_PYMETHOD_NOARGS(KX_SoundActuator,GetType); - // <----- - }; #endif //__KX_SOUNDACTUATOR diff --git a/source/gameengine/Ketsji/KX_StateActuator.cpp b/source/gameengine/Ketsji/KX_StateActuator.cpp index 09d95612cbb..4159e9c373d 100644 --- a/source/gameengine/Ketsji/KX_StateActuator.cpp +++ b/source/gameengine/Ketsji/KX_StateActuator.cpp @@ -159,12 +159,6 @@ PyTypeObject KX_StateActuator::Type = { }; PyMethodDef KX_StateActuator::Methods[] = { - // deprecated --> - {"setOperation", (PyCFunction) KX_StateActuator::sPySetOperation, - METH_VARARGS, (const char *)SetOperation_doc}, - {"setMask", (PyCFunction) KX_StateActuator::sPySetMask, - METH_VARARGS, (const char *)SetMask_doc}, - // <-- {NULL,NULL} //Sentinel }; @@ -173,52 +167,3 @@ PyAttributeDef KX_StateActuator::Attributes[] = { KX_PYATTRIBUTE_INT_RW("mask",0,0x3FFFFFFF,false,KX_StateActuator,m_mask), { NULL } //Sentinel }; - - -/* set operation ---------------------------------------------------------- */ -const char -KX_StateActuator::SetOperation_doc[] = -"setOperation(op)\n" -"\t - op : bit operation (0=Copy, 1=Set, 2=Clear, 3=Negate)" -"\tSet the type of bit operation to be applied on object state mask.\n" -"\tUse setMask() to specify the bits that will be modified.\n"; -PyObject* - -KX_StateActuator::PySetOperation(PyObject* args) { - ShowDeprecationWarning("setOperation()", "the operation property"); - int oper; - - if(!PyArg_ParseTuple(args, "i:setOperation", &oper)) { - return NULL; - } - - m_operation = oper; - - Py_RETURN_NONE; -} - -/* set mask ---------------------------------------------------------- */ -const char -KX_StateActuator::SetMask_doc[] = -"setMask(mask)\n" -"\t - mask : bits that will be modified" -"\tSet the value that defines the bits that will be modified by the operation.\n" -"\tThe bits that are 1 in the value will be updated in the object state,\n" -"\tthe bits that are 0 are will be left unmodified expect for the Copy operation\n" -"\twhich copies the value to the object state.\n"; -PyObject* - -KX_StateActuator::PySetMask(PyObject* args) { - ShowDeprecationWarning("setMask()", "the mask property"); - int mask; - - if(!PyArg_ParseTuple(args, "i:setMask", &mask)) { - return NULL; - } - - m_mask = mask; - - Py_RETURN_NONE; -} - - diff --git a/source/gameengine/Ketsji/KX_StateActuator.h b/source/gameengine/Ketsji/KX_StateActuator.h index ce86c4b44fe..4cf84f74287 100644 --- a/source/gameengine/Ketsji/KX_StateActuator.h +++ b/source/gameengine/Ketsji/KX_StateActuator.h @@ -88,9 +88,7 @@ class KX_StateActuator : public SCA_IActuator /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - //KX_PYMETHOD_DOC - KX_PYMETHOD_DOC_VARARGS(KX_StateActuator,SetOperation); - KX_PYMETHOD_DOC_VARARGS(KX_StateActuator,SetMask); + }; #endif diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp index 26e414c5b47..cde67787e2f 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.cpp +++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp @@ -315,16 +315,6 @@ PyTypeObject KX_TouchSensor::Type = { }; PyMethodDef KX_TouchSensor::Methods[] = { - //Deprecated -----> - {"setProperty", - (PyCFunction) KX_TouchSensor::sPySetProperty, METH_O, (const char *)SetProperty_doc}, - {"getProperty", - (PyCFunction) KX_TouchSensor::sPyGetProperty, METH_NOARGS, (const char *)GetProperty_doc}, - {"getHitObject", - (PyCFunction) KX_TouchSensor::sPyGetHitObject, METH_NOARGS, (const char *)GetHitObject_doc}, - {"getHitObjectList", - (PyCFunction) KX_TouchSensor::sPyGetHitObjectList, METH_NOARGS, (const char *)GetHitObjectList_doc}, - //<----- {NULL,NULL} //Sentinel }; @@ -339,101 +329,6 @@ PyAttributeDef KX_TouchSensor::Attributes[] = { /* Python API */ -/* 1. setProperty */ -const char KX_TouchSensor::SetProperty_doc[] = -"setProperty(name)\n" -"\t- name: string\n" -"\tSet the property or material to collide with. Use\n" -"\tsetTouchMaterial() to switch between properties and\n" -"\tmaterials."; -PyObject* KX_TouchSensor::PySetProperty(PyObject* value) -{ - ShowDeprecationWarning("setProperty()", "the propName property"); - char *nameArg= _PyUnicode_AsString(value); - if (nameArg==NULL) { - PyErr_SetString(PyExc_ValueError, "expected a "); - return NULL; - } - - m_touchedpropname = nameArg; - Py_RETURN_NONE; -} -/* 2. getProperty */ -const char KX_TouchSensor::GetProperty_doc[] = -"getProperty(name)\n" -"\tReturns the property or material to collide with. Use\n" -"\tgetTouchMaterial() to find out whether this sensor\n" -"\tlooks for properties or materials."; -PyObject* KX_TouchSensor::PyGetProperty() { - ShowDeprecationWarning("getProperty()", "the propName property"); - - return PyUnicode_FromString(m_touchedpropname); -} - -const char KX_TouchSensor::GetHitObject_doc[] = -"getHitObject()\n" -; -PyObject* KX_TouchSensor::PyGetHitObject() -{ - ShowDeprecationWarning("getHitObject()", "the hitObject property"); - /* to do: do Py_IncRef if the object is already known in Python */ - /* otherwise, this leaks memory */ - if (m_hitObject) - { - return m_hitObject->GetProxy(); - } - Py_RETURN_NONE; -} - -const char KX_TouchSensor::GetHitObjectList_doc[] = -"getHitObjectList()\n" -"\tReturn a list of the objects this object collided with,\n" -"\tbut only those matching the property/material condition.\n"; -PyObject* KX_TouchSensor::PyGetHitObjectList() -{ - ShowDeprecationWarning("getHitObjectList()", "the hitObjectList property"); - /* to do: do Py_IncRef if the object is already known in Python */ - /* otherwise, this leaks memory */ /* Edit, this seems ok and not to leak memory - Campbell */ - return m_colliders->GetProxy(); -} - -/*getTouchMaterial and setTouchMaterial were never added to the api, -they can probably be removed with out anyone noticing*/ - -/* 5. getTouchMaterial */ -const char KX_TouchSensor::GetTouchMaterial_doc[] = -"getTouchMaterial()\n" -"\tReturns KX_TRUE if this sensor looks for a specific material,\n" -"\tKX_FALSE if it looks for a specific property.\n" ; -PyObject* KX_TouchSensor::PyGetTouchMaterial() -{ - ShowDeprecationWarning("getTouchMaterial()", "the useMaterial property"); - return PyLong_FromSsize_t(m_bFindMaterial); -} - -/* 6. setTouchMaterial */ -#if 0 -const char KX_TouchSensor::SetTouchMaterial_doc[] = -"setTouchMaterial(flag)\n" -"\t- flag: KX_TRUE or KX_FALSE.\n" -"\tSet flag to KX_TRUE to switch on positive pulse mode,\n" -"\tKX_FALSE to switch off positive pulse mode.\n" ; -PyObject* KX_TouchSensor::PySetTouchMaterial(PyObject *value) -{ - ShowDeprecationWarning("setTouchMaterial()", "the useMaterial property"); - int pulseArg = PyLong_AsSsize_t(value); - - if(pulseArg ==-1 && PyErr_Occurred()) { - PyErr_SetString(PyExc_ValueError, "expected a bool"); - return NULL; - } - - m_bFindMaterial = pulseArg != 0; - - Py_RETURN_NONE; -} -#endif - PyObject* KX_TouchSensor::pyattr_get_object_hit(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_TouchSensor* self= static_cast(self_v); diff --git a/source/gameengine/Ketsji/KX_TouchSensor.h b/source/gameengine/Ketsji/KX_TouchSensor.h index 5f571614b06..ad1830e05c9 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.h +++ b/source/gameengine/Ketsji/KX_TouchSensor.h @@ -119,23 +119,6 @@ public: /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - - //Deprecated -----> - /* 1. setProperty */ - KX_PYMETHOD_DOC_O(KX_TouchSensor,SetProperty); - /* 2. getProperty */ - KX_PYMETHOD_DOC_NOARGS(KX_TouchSensor,GetProperty); - /* 3. getHitObject */ - KX_PYMETHOD_DOC_NOARGS(KX_TouchSensor,GetHitObject); - /* 4. getHitObject */ - KX_PYMETHOD_DOC_NOARGS(KX_TouchSensor,GetHitObjectList); - /* 5. getTouchMaterial */ - KX_PYMETHOD_DOC_NOARGS(KX_TouchSensor,GetTouchMaterial); -#if 0 - /* 6. setTouchMaterial */ - KX_PYMETHOD_DOC_O(KX_TouchSensor,SetTouchMaterial); -#endif - //<----- static PyObject* pyattr_get_object_hit(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_object_hit_list(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.cpp b/source/gameengine/Ketsji/KX_TrackToActuator.cpp index b5b7e9de444..e6c2f86bbce 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.cpp +++ b/source/gameengine/Ketsji/KX_TrackToActuator.cpp @@ -453,14 +453,6 @@ PyTypeObject KX_TrackToActuator::Type = { }; PyMethodDef KX_TrackToActuator::Methods[] = { - // ---> deprecated - {"setTime", (PyCFunction) KX_TrackToActuator::sPySetTime, METH_VARARGS, (const char *)SetTime_doc}, - {"getTime", (PyCFunction) KX_TrackToActuator::sPyGetTime, METH_NOARGS, (const char *)GetTime_doc}, - {"setUse3D", (PyCFunction) KX_TrackToActuator::sPySetUse3D, METH_VARARGS, (const char *)SetUse3D_doc}, - {"getUse3D", (PyCFunction) KX_TrackToActuator::sPyGetUse3D, METH_NOARGS, (const char *)GetUse3D_doc}, - {"setObject", (PyCFunction) KX_TrackToActuator::sPySetObject, METH_O, (const char *)SetObject_doc}, - {"getObject", (PyCFunction) KX_TrackToActuator::sPyGetObject, METH_VARARGS, (const char *)GetObject_doc}, - {NULL,NULL} //Sentinel }; @@ -500,123 +492,4 @@ int KX_TrackToActuator::pyattr_set_object(void *self, const struct KX_PYATTRIBUT return PY_SET_ATTR_SUCCESS; } - -/* 1. setObject */ -const char KX_TrackToActuator::SetObject_doc[] = -"setObject(object)\n" -"\t- object: KX_GameObject, string or None\n" -"\tSet the object to track with the parent of this actuator.\n"; -PyObject* KX_TrackToActuator::PySetObject(PyObject* value) -{ - KX_GameObject *gameobj; - - ShowDeprecationWarning("setObject()", "the object property"); - - if (!ConvertPythonToGameObject(value, &gameobj, true, "actuator.setObject(value): KX_TrackToActuator")) - return NULL; // ConvertPythonToGameObject sets the error - - if (m_object != NULL) - m_object->UnregisterActuator(this); - - m_object = (SCA_IObject*)gameobj; - if (m_object) - m_object->RegisterActuator(this); - - Py_RETURN_NONE; -} - - - -/* 2. getObject */ -const char KX_TrackToActuator::GetObject_doc[] = -"getObject(name_only = 1)\n" -"name_only - optional arg, when true will return the KX_GameObject rather then its name\n" -"\tReturns the object to track with the parent of this actuator\n"; -PyObject* KX_TrackToActuator::PyGetObject(PyObject* args) -{ - int ret_name_only = 1; - - ShowDeprecationWarning("getObject()", "the object property"); - - if (!PyArg_ParseTuple(args, "|i:getObject", &ret_name_only)) - return NULL; - - if (!m_object) - Py_RETURN_NONE; - - if (ret_name_only) - return PyUnicode_FromString(m_object->GetName()); - else - return m_object->GetProxy(); -} - - - -/* 3. setTime */ -const char KX_TrackToActuator::SetTime_doc[] = -"setTime(time)\n" -"\t- time: integer\n" -"\tSet the time in frames with which to delay the tracking motion.\n"; -PyObject* KX_TrackToActuator::PySetTime(PyObject* args) -{ - ShowDeprecationWarning("setTime()", "the timer property"); - int timeArg; - - if (!PyArg_ParseTuple(args, "i:setTime", &timeArg)) - { - return NULL; - } - - m_time= timeArg; - - Py_RETURN_NONE; -} - - - -/* 4.getTime */ -const char KX_TrackToActuator::GetTime_doc[] = -"getTime()\n" -"\t- time: integer\n" -"\tReturn the time in frames with which the tracking motion is delayed.\n"; -PyObject* KX_TrackToActuator::PyGetTime() -{ - ShowDeprecationWarning("getTime()", "the timer property"); - return PyLong_FromSsize_t(m_time); -} - - - -/* 5. getUse3D */ -const char KX_TrackToActuator::GetUse3D_doc[] = -"getUse3D()\n" -"\tReturns 1 if the motion is allowed to extend in the z-direction.\n"; -PyObject* KX_TrackToActuator::PyGetUse3D() -{ - ShowDeprecationWarning("setTime()", "the use3D property"); - return PyLong_FromSsize_t(!(m_allow3D == 0)); -} - - - -/* 6. setUse3D */ -const char KX_TrackToActuator::SetUse3D_doc[] = -"setUse3D(value)\n" -"\t- value: 0 or 1\n" -"\tSet to 1 to allow the tracking motion to extend in the z-direction,\n" -"\tset to 0 to lock the tracking motion to the x-y plane.\n"; -PyObject* KX_TrackToActuator::PySetUse3D(PyObject* args) -{ - ShowDeprecationWarning("setTime()", "the use3D property"); - int boolArg; - - if (!PyArg_ParseTuple(args, "i:setUse3D", &boolArg)) { - return NULL; - } - - m_allow3D = !(boolArg == 0); - - Py_RETURN_NONE; -} - /* eof */ diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.h b/source/gameengine/Ketsji/KX_TrackToActuator.h index 801e695bb9b..bbfc1d17576 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.h +++ b/source/gameengine/Ketsji/KX_TrackToActuator.h @@ -74,19 +74,6 @@ class KX_TrackToActuator : public SCA_IActuator /* These are used to get and set m_ob */ static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); - - /* 1. setObject */ - KX_PYMETHOD_DOC_O(KX_TrackToActuator,SetObject); - /* 2. getObject */ - KX_PYMETHOD_DOC_VARARGS(KX_TrackToActuator,GetObject); - /* 3. setTime */ - KX_PYMETHOD_DOC_VARARGS(KX_TrackToActuator,SetTime); - /* 4. getTime */ - KX_PYMETHOD_DOC_NOARGS(KX_TrackToActuator,GetTime); - /* 5. getUse3D */ - KX_PYMETHOD_DOC_NOARGS(KX_TrackToActuator,GetUse3D); - /* 6. setUse3D */ - KX_PYMETHOD_DOC_VARARGS(KX_TrackToActuator,SetUse3D); }; /* end of class KX_TrackToActuator : public KX_EditObjectActuator */ diff --git a/source/gameengine/Ketsji/KX_VisibilityActuator.cpp b/source/gameengine/Ketsji/KX_VisibilityActuator.cpp index 97c893c6caa..184e127209f 100644 --- a/source/gameengine/Ketsji/KX_VisibilityActuator.cpp +++ b/source/gameengine/Ketsji/KX_VisibilityActuator.cpp @@ -113,10 +113,6 @@ PyTypeObject KX_VisibilityActuator::Type = { }; PyMethodDef KX_VisibilityActuator::Methods[] = { - // Deprecated -----> - {"set", (PyCFunction) KX_VisibilityActuator::sPySetVisible, METH_VARARGS, - (const char *) SetVisible_doc}, - // <----- {NULL,NULL} //Sentinel }; @@ -126,26 +122,3 @@ PyAttributeDef KX_VisibilityActuator::Attributes[] = { KX_PYATTRIBUTE_BOOL_RW("useRecursion", KX_VisibilityActuator, m_recursive), { NULL } //Sentinel }; - -/* set visibility ---------------------------------------------------------- */ -const char -KX_VisibilityActuator::SetVisible_doc[] = -"setVisible(visible?)\n" -"\t - visible? : Make the object visible? (KX_TRUE, KX_FALSE)" -"\tSet the properties of the actuator.\n"; -PyObject* - -KX_VisibilityActuator::PySetVisible(PyObject* args) { - int vis; - ShowDeprecationWarning("SetVisible()", "the visible property"); - - if(!PyArg_ParseTuple(args, "i:setVisible", &vis)) { - return NULL; - } - - m_visible = PyArgToBool(vis); - - Py_RETURN_NONE; -} - - diff --git a/source/gameengine/Ketsji/KX_VisibilityActuator.h b/source/gameengine/Ketsji/KX_VisibilityActuator.h index 3ad50c6cea2..e75551644a4 100644 --- a/source/gameengine/Ketsji/KX_VisibilityActuator.h +++ b/source/gameengine/Ketsji/KX_VisibilityActuator.h @@ -67,11 +67,6 @@ class KX_VisibilityActuator : public SCA_IActuator /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - // Deprecated -----> - KX_PYMETHOD_DOC_VARARGS(KX_VisibilityActuator,SetVisible); - // <----- - - }; #endif -- cgit v1.2.3