However I’ve noticed when I try and load certain models with ODEtrimesh() Python gets choked up with an Assertion Error:
in __init__
vtx1=vDataBegin+collFaceData.getVertex(s+i*3)
AssertionError: i >= 0 && i < _vertices_reader->get_num_rows() at line 1876 of c:\temp\mkpr\panda\src\gobj\geomPrimitive.cxx
Loading the ‘teapot’, ‘box’, and ‘bowl’ models all work fine; but when you switch out a more complex one like ‘panda’ or ‘ralph’ the problem arises.
# get the start index of current primitive at geom's vertex data
s = collFaceData.getPrimitiveStart(prim)
for i in range(numface):
# refer to the vertex data length list created earlier
vtx1=vDataBegin+collFaceData.getVertex(s+i*3)
vtx2=vDataBegin+collFaceData.getVertex(s+i*3+1)
vtx3=vDataBegin+collFaceData.getVertex(s+i*3+2)
collFaces.append((vtx1,vtx2,vtx3))
with this:
for i in range(0,numface*3,3):
# refer to the vertex data length list created earlier
vtx1=vDataBegin+collFaceData.getVertex(i)
vtx2=vDataBegin+collFaceData.getVertex(i+1)
vtx3=vDataBegin+collFaceData.getVertex(i+2)
collFaces.append((vtx1,vtx2,vtx3))
Though I still don’t know what the return value of getPrimitiveStart() is useful for. Obviously it works well without it. It looks like a little liar to me.