diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-08-31 07:36:02 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-08-31 07:36:02 +0400 |
commit | 6b3351c327771c6572ddfb3677db087b15bf06d1 (patch) | |
tree | ef4f3fc19088d0bb7a58f614e7d617944cb9ea51 /source/gameengine/Ketsji/KX_PolyProxy.cpp | |
parent | ca96a75af49910340540960e7dbc797be9b01caf (diff) |
bugfix [#19254] KX_PolyProxy returns improper VertexIndex with triangles, using .getVertexIndex() and .v1, .v2, etc.
Surprising this wasn't noticed before. Any mix of quads/tris caused the face verts of either quads/tries (whichever comes last).
Tested by exporting the KX_MeshProxy and re-importing as an OBJ.
This fix assumes there are only 2 m_darray's per face array which is currently true, but wont be if edge support is added back.
Diffstat (limited to 'source/gameengine/Ketsji/KX_PolyProxy.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_PolyProxy.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/gameengine/Ketsji/KX_PolyProxy.cpp b/source/gameengine/Ketsji/KX_PolyProxy.cpp index b56b5500c39..66457f46deb 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.cpp +++ b/source/gameengine/Ketsji/KX_PolyProxy.cpp @@ -140,19 +140,19 @@ PyObject* KX_PolyProxy::py_getattro(PyObject *attr) } if (!strcmp(attr_str, "v1")) { - return PyInt_FromLong(m_polygon->GetVertexOffset(0)); + return PyInt_FromLong(m_polygon->GetVertexOffsetAbs(m_mesh, 0)); } if (!strcmp(attr_str, "v2")) { - return PyInt_FromLong(m_polygon->GetVertexOffset(1)); + return PyInt_FromLong(m_polygon->GetVertexOffsetAbs(m_mesh, 1)); } if (!strcmp(attr_str, "v3")) { - return PyInt_FromLong(m_polygon->GetVertexOffset(2)); + return PyInt_FromLong(m_polygon->GetVertexOffsetAbs(m_mesh, 2)); } if (!strcmp(attr_str, "v4")) { - return PyInt_FromLong(((m_polygon->VertexCount()>3)?m_polygon->GetVertexOffset(3):0)); + return PyInt_FromLong(((m_polygon->VertexCount()>3)?m_polygon->GetVertexOffsetAbs(m_mesh, 3):0)); } if (!strcmp(attr_str, "visible")) { @@ -255,7 +255,7 @@ KX_PYMETHODDEF_DOC(KX_PolyProxy, getVertexIndex, } if (index < m_polygon->VertexCount()) { - return PyInt_FromLong(m_polygon->GetVertexOffset(index)); + return PyInt_FromLong(m_polygon->GetVertexOffsetAbs(m_mesh, index)); } return PyInt_FromLong(0); } |