Adding ODE to tri-mesh- AssertionError

I’ve run into a problem adding physics to certain tri-mesh models.

I’m using the example code from the famous “bowl-egg” ODE demo:, and have found those classes to be very awesome.

However I’ve noticed when I try and load certain models with ODEtrimesh() Python gets choked up with an Assertion Error:

in __init__
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.

Any ideas? Thanks!

It probably isn’t handling animated models correctly. I can imagine it would be difficult to handle such models properly.

Replace this part :

# 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

with this:

for i in range(0,numface*3,3):
    # refer to the vertex data length list created earlier

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. :laughing: