Crash trying to print submesh

esteban

30-10-2005 12:37:32

When I try to iterate over the submeshes of an object and print them, I get a Win32 error popup.


for i in xrange(entity.mesh.getNumSubMeshes()):
submesh = entity.mesh.getSubMesh(i)
print submesh # BANG!!


If I comment out the print line, I get no crash. I'll try to build a debug version of PyOgre and see what's wrong here, but I thought I'd point it out just in case someone has a good guess of what's going on...

esteban

30-10-2005 13:39:45

The problem disappeared when I added a simple wrapper to SubMesh in the PyOgre project:


%{
#include "OgreSubMesh.h"
%}

%include OgreSubMesh.h


Regards,

Esteban.

Clay

30-10-2005 17:04:54

Thanks, added to the bug list.

Clay

05-11-2005 21:59:23

ok this is fixed, but note I've added a property for getNumSubMeshes(), this now works:

for i in xrange(entity.mesh.getNumSubMeshes()):
submesh = entity.mesh.getSubMesh(i)
print submesh # works!