pycollada / meshtool

Tool for manipulating mesh data using pycollada
Other
65 stars 13 forks source link

IndexError during triangulate #4

Open andyli opened 7 years ago

andyli commented 7 years ago

I tried to convert my obj file to collada, with the triangulate filter, it fails with error:

$ meshtool --load_obj wall_and_door.obj --save_collada wall_and_door.dae --triangulate
Warning: filter 'viewer' disabled because of ImportError: No module named direct.task
Warning: filter 'collada_viewer' disabled because of ImportError: No module named direct.task
Warning: filter 'pm_viewer' disabled because of ImportError: No module named direct.task
Warning: filter 'sander_simplify' disabled because of ImportError: No module named networkx
Warning: filter 'save_screenshot' disabled because of ImportError: No module named direct.task
Warning: filter 'save_rotate_screenshots' disabled because of ImportError: No module named direct.task
Warning: filter 'save_bam' disabled because of ImportError: No module named direct.task
MISSING MTL LINE Ni 1
MISSING MTL LINE Ni 1
MISSING MTL LINE Ni 1
Traceback (most recent call last):
  File "/usr/local/bin/meshtool", line 9, in <module>
    load_entry_point('meshtool==0.3', 'console_scripts', 'meshtool')()
  File "/usr/local/lib/python2.7/dist-packages/meshtool/__main__.py", line 88, in main
    collada_inst = inst.apply(collada_inst, *arguments)
  File "/usr/local/lib/python2.7/dist-packages/meshtool/filters/optimize_filters/triangulate.py", line 19, in apply
    triangulate(mesh)
  File "/usr/local/lib/python2.7/dist-packages/meshtool/filters/optimize_filters/triangulate.py", line 9, in triangulate
    triprims.append(prim.triangleset())
  File "/usr/local/lib/python2.7/dist-packages/collada/polylist.py", line 251, in triangleset
    self.index[indexselector+1],
IndexError: index 40 is out of bounds for axis 0 with size 40

The model I used can be found at https://github.com/andyli/aframe-test/tree/1fe0f0cc8af332b9a8c7880437a8678e99e3b6e2/wall_and_door

I'm using pycollada 0.4.1, meshtool 0.3.