Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TWO PROBLEMS; direct.task and Attribute Error #2

Open
Daviderr opened this issue Jul 10, 2014 · 4 comments
Open

TWO PROBLEMS; direct.task and Attribute Error #2

Daviderr opened this issue Jul 10, 2014 · 4 comments

Comments

@Daviderr
Copy link

I have two problems,
when i start mesh tool it says:
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 '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
even if installed last version of Panda3D.

And when i try to load an obj file and simply write it it says to me:

Traceback (most recent call last):
File "/usr/local/bin/meshtool", line 8, in
load_entry_point('meshtool==0.3', 'console_scripts', 'meshtool')()
File "/Library/Python/2.7/site-packages/meshtool-0.3-py2.7.egg/meshtool/main.py", line 89, in main
collada_inst = inst.apply(collada_inst, *arguments)
File "/Library/Python/2.7/site-packages/meshtool-0.3-py2.7.egg/meshtool/filters/save_filters/save_obj.py", line 30, in apply
save_obj_util.write_obj(mesh, rel_mtlfilename, f)
File "/Library/Python/2.7/site-packages/meshtool-0.3-py2.7.egg/meshtool/filters/save_filters/save_obj_util.py", line 107, in write_obj
f.write("usemtl %s\n" % boundprim.material.id)
AttributeError: 'NoneType' object has no attribute 'id'
and when i open it with some OBJ Viewer like MeshViewer the new obj file has only vertices and no faces.

Thanks

@jterrace
Copy link
Member

You can ignore the warnings. Would it be possible for you to post the .obj file?

@jterrace
Copy link
Member

I think b52501d should fix the second problem. Could you run from master and confirm?

@Daviderr
Copy link
Author

Thanks for your support, ok i modify the code following your advice now:

MacBook-Pro-di-Davide-2:~ DavideMorgagni$ sudo meshtool --load_obj /1.obj --save_obj /12.obj
Warning: filter 'print_pm_perceptual_error' disabled because of ImportError: No module named direct.showbase.ShowBase
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 '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
Traceback (most recent call last):
  File "/usr/local/bin/meshtool", line 8, in <module>
    load_entry_point('meshtool==0.3', 'console_scripts', 'meshtool')()
  File "/Library/Python/2.7/site-packages/meshtool-0.3-py2.7.egg/meshtool/__main__.py", line 89, in main
    collada_inst = inst.apply(collada_inst, *arguments)
  File "/Library/Python/2.7/site-packages/meshtool-0.3-py2.7.egg/meshtool/filters/save_filters/save_obj.py", line 30, in apply
    save_obj_util.write_obj(mesh, rel_mtlfilename, f)
  File "/Library/Python/2.7/site-packages/meshtool-0.3-py2.7.egg/meshtool/filters/save_filters/save_obj_util.py", line 126, in write_obj
    f.write("\n".join(map(lambda idx: format_string % tuple(chain.from_iterable(zip(*idx))), index_iter)))
  File "/Library/Python/2.7/site-packages/meshtool-0.3-py2.7.egg/meshtool/filters/save_filters/save_obj_util.py", line 126, in <lambda>
    f.write("\n".join(map(lambda idx: format_string % tuple(chain.from_iterable(zip(*idx))), index_iter)))
TypeError: zip argument #1 must support iteration

And the output is still an obj with only vertices and an empty .mtl file.

@jterrace
Copy link
Member

Can you try this:

meshtool --load_obj /1.obj --medium_optimizations --save_obj /12.obj

or at least this?

meshtool --load_obj /1.obj --generate_normals --save_obj /12.obj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants