Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/gameengine/Ketsji/KX_MeshProxy.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_MeshProxy.cpp46
1 files changed, 6 insertions, 40 deletions
diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp
index 5cc102248f2..a0ac9cfd4ff 100644
--- a/source/gameengine/Ketsji/KX_MeshProxy.cpp
+++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp
@@ -35,7 +35,6 @@
#include "RAS_MeshObject.h"
#include "KX_VertexProxy.h"
-#include "KX_PolyProxy.h"
#include "KX_PolygonMaterial.h"
#include "KX_BlenderMaterial.h"
@@ -43,8 +42,6 @@
#include "KX_PyMath.h"
#include "KX_ConvertPhysicsObject.h"
-#include "PyObjectPlus.h"
-
PyTypeObject KX_MeshProxy::Type = {
PyObject_HEAD_INIT(&PyType_Type)
0,
@@ -74,12 +71,10 @@ PyParentObject KX_MeshProxy::Parents[] = {
PyMethodDef KX_MeshProxy::Methods[] = {
{"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},
KX_PYMETHODTABLE(KX_MeshProxy, reinstancePhysicsMesh),
//{"getIndexArrayLength", (PyCFunction)KX_MeshProxy::sPyGetIndexArrayLength,METH_VARARGS},
@@ -98,11 +93,10 @@ KX_MeshProxy::_getattr(const STR_String& attr)
if (attr == "materials")
{
PyObject *materials = PyList_New(0);
- list<RAS_MeshMaterial>::iterator mit = m_meshobj->GetFirstMaterial();
+ RAS_MaterialBucket::Set::iterator mit = m_meshobj->GetFirstMaterial();
for(; mit != m_meshobj->GetLastMaterial(); ++mit)
{
- RAS_IPolyMaterial *polymat = mit->m_bucket->GetPolyMaterial();
-
+ RAS_IPolyMaterial *polymat = (*mit)->GetPolyMaterial();
if(polymat->GetFlag() & RAS_BLENDERMAT)
{
KX_BlenderMaterial *mat = static_cast<KX_BlenderMaterial*>(polymat);
@@ -152,12 +146,6 @@ PyObject* KX_MeshProxy::PyGetNumMaterials(PyObject* self,
return PyInt_FromLong(num);
}
-PyObject* KX_MeshProxy::PyGetNumPolygons(PyObject* self)
-{
- int num = m_meshobj->NumPolygons();
- return PyInt_FromLong(num);
-}
-
PyObject* KX_MeshProxy::PyGetMaterialName(PyObject* self,
PyObject* args,
PyObject* kwds)
@@ -207,11 +195,11 @@ PyObject* KX_MeshProxy::PyGetVertexArrayLength(PyObject* self,
if (PyArg_ParseTuple(args,"i",&matid))
{
- RAS_MeshMaterial *mmat = m_meshobj->GetMeshMaterial(matid);
- RAS_IPolyMaterial* mat = mmat->m_bucket->GetPolyMaterial();
-
+ RAS_IPolyMaterial* mat = m_meshobj->GetMaterialBucket(matid)->GetPolyMaterial();
if (mat)
- length = m_meshobj->NumVertices(mat);
+ {
+ length = m_meshobj->GetVertexArrayLength(mat);
+ }
}
else {
return NULL;
@@ -246,28 +234,6 @@ PyObject* KX_MeshProxy::PyGetVertex(PyObject* self,
}
-PyObject* KX_MeshProxy::PyGetPolygon(PyObject* self,
- PyObject* args,
- PyObject* kwds)
-{
- int polyindex= 1;
- PyObject* polyob = NULL;
-
- if (!PyArg_ParseTuple(args,"i",&polyindex))
- return NULL;
-
- RAS_Polygon* polygon = m_meshobj->GetPolygon(polyindex);
- if (polygon)
- {
- polyob = new KX_PolyProxy(m_meshobj, polygon);
- }
- else
- {
- PyErr_SetString(PyExc_AttributeError, "Invalid polygon index");
- }
- return polyob;
-}
-
KX_PYMETHODDEF_DOC(KX_MeshProxy, reinstancePhysicsMesh,
"Reinstance the physics mesh.")
{