diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2008-12-29 19:36:58 +0300 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2008-12-29 19:36:58 +0300 |
commit | 1c663bbc7e53cda1fe35579302574b0d98aa8db3 (patch) | |
tree | 4c0d3be6453932c01a9dc0fee0f820275cd6701d /source/gameengine/Ketsji | |
parent | d91daaa5f690645153adf647c371262c9c6cb009 (diff) |
First batch of GE API cleanup.
The principle is to replace most get/set methods of logic bricks by direct property access.
To make porting of game code easier, the properties have usually the same type and use than
the return values/parameters of the get/set methods.
More details on http://wiki.blender.org/index.php/GameEngineDev/Python_API_Clean_Up
Old methods are still available but will produce deprecation warnings on the console:
"<method> is deprecated, use the <property> property instead"
You can avoid these messages by turning on the "Ignore deprecation warnings" option in Game menu.
PyDoc is updated to include the new properties and display a deprecation warning
for the get/set methods that are being deprecated.
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r-- | source/gameengine/Ketsji/KX_PolyProxy.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/source/gameengine/Ketsji/KX_PolyProxy.cpp b/source/gameengine/Ketsji/KX_PolyProxy.cpp index c6f6bc2db01..bb9072b34dc 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.cpp +++ b/source/gameengine/Ketsji/KX_PolyProxy.cpp @@ -65,15 +65,15 @@ PyParentObject KX_PolyProxy::Parents[] = { }; PyMethodDef KX_PolyProxy::Methods[] = { - KX_PYMETHODTABLE_NOARG(KX_PolyProxy,getMaterialIndex), - KX_PYMETHODTABLE_NOARG(KX_PolyProxy,getNumVertex), - KX_PYMETHODTABLE_NOARG(KX_PolyProxy,isVisible), - KX_PYMETHODTABLE_NOARG(KX_PolyProxy,isCollider), - KX_PYMETHODTABLE_NOARG(KX_PolyProxy,getMaterialName), - KX_PYMETHODTABLE_NOARG(KX_PolyProxy,getTextureName), + KX_PYMETHODTABLE_NOARGS(KX_PolyProxy,getMaterialIndex), + KX_PYMETHODTABLE_NOARGS(KX_PolyProxy,getNumVertex), + KX_PYMETHODTABLE_NOARGS(KX_PolyProxy,isVisible), + KX_PYMETHODTABLE_NOARGS(KX_PolyProxy,isCollider), + KX_PYMETHODTABLE_NOARGS(KX_PolyProxy,getMaterialName), + KX_PYMETHODTABLE_NOARGS(KX_PolyProxy,getTextureName), KX_PYMETHODTABLE(KX_PolyProxy,getVertexIndex), - KX_PYMETHODTABLE_NOARG(KX_PolyProxy,getMesh), - KX_PYMETHODTABLE_NOARG(KX_PolyProxy,getMaterial), + KX_PYMETHODTABLE_NOARGS(KX_PolyProxy,getMesh), + KX_PYMETHODTABLE_NOARGS(KX_PolyProxy,getMaterial), {NULL,NULL} //Sentinel }; @@ -171,7 +171,7 @@ void KX_PolyProxy::ReplicaSetName(STR_String) {}; // stuff for python integration -KX_PYMETHODDEF_DOC_NOARG(KX_PolyProxy, getMaterialIndex, +KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getMaterialIndex, "getMaterialIndex() : return the material index of the polygon in the mesh\n") { RAS_MaterialBucket* polyBucket = m_polygon->GetMaterial(); @@ -186,31 +186,31 @@ KX_PYMETHODDEF_DOC_NOARG(KX_PolyProxy, getMaterialIndex, return PyInt_FromLong(matid); } -KX_PYMETHODDEF_DOC_NOARG(KX_PolyProxy, getNumVertex, +KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getNumVertex, "getNumVertex() : returns the number of vertex of the polygon, 3 or 4\n") { return PyInt_FromLong(m_polygon->VertexCount()); } -KX_PYMETHODDEF_DOC_NOARG(KX_PolyProxy, isVisible, +KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, isVisible, "isVisible() : returns whether the polygon is visible or not\n") { return PyInt_FromLong(m_polygon->IsVisible()); } -KX_PYMETHODDEF_DOC_NOARG(KX_PolyProxy, isCollider, +KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, isCollider, "isCollider() : returns whether the polygon is receives collision or not\n") { return PyInt_FromLong(m_polygon->IsCollider()); } -KX_PYMETHODDEF_DOC_NOARG(KX_PolyProxy, getMaterialName, +KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getMaterialName, "getMaterialName() : returns the polygon material name, \"NoMaterial\" if no material\n") { return PyString_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetMaterialName()); } -KX_PYMETHODDEF_DOC_NOARG(KX_PolyProxy, getTextureName, +KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getTextureName, "getTexturelName() : returns the polygon texture name, \"NULL\" if no texture\n") { return PyString_FromString(m_polygon->GetMaterial()->GetPolyMaterial()->GetTextureName()); @@ -239,14 +239,14 @@ KX_PYMETHODDEF_DOC(KX_PolyProxy, getVertexIndex, return PyInt_FromLong(0); } -KX_PYMETHODDEF_DOC_NOARG(KX_PolyProxy, getMesh, +KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getMesh, "getMesh() : returns a mesh proxy\n") { KX_MeshProxy* meshproxy = new KX_MeshProxy((RAS_MeshObject*)m_mesh); return meshproxy; } -KX_PYMETHODDEF_DOC_NOARG(KX_PolyProxy, getMaterial, +KX_PYMETHODDEF_DOC_NOARGS(KX_PolyProxy, getMaterial, "getMaterial() : returns a material\n") { RAS_IPolyMaterial *polymat = m_polygon->GetMaterial()->GetPolyMaterial(); |