vispy / vispy

Main repository for Vispy
http://vispy.org
Other
3.25k stars 616 forks source link

Wavefront file containing mtllib skipped when loading materials #1468

Open lucasnavisens opened 6 years ago

lucasnavisens commented 6 years ago

Hi,

I'm loading an obj file with its associated mtl file, it seems in your wavefront.py file loader you explicitly skip the mtllib line. See below:

  elif line.startswith('mtllib '):
            logger.warning('Notice reading .OBJ: material properties are '
                           'ignored.')

Is there a way to load the mtl and obj directly using vispy ?

Thanks.

djhoese commented 6 years ago

@lucasnavisens It looks like this module was originally added by @almarklein and updated by a few other people later. I am not familiar with this format so if there is a feature you need you may need to implement it yourself as I won't have time to look in to this. Pull requests are welcome and I can provide any help if you need it.

asnt commented 6 years ago

@lucasnavisens What do you need in the MTL file? Current workarounds:

lucasnavisens commented 6 years ago

Hi @asnt,

I needed to texture map from image to mesh and alongside this the material / reflection attributes associated to the texture / mesh to render a phone in 3d and apply the screen textures to it for a video.

It isn't an immediate project anymore but thanks will try when I have time.

This is the video of the 3d visualizer (with dark background) written with vispy to get a better understanding: https://www.youtube.com/watch?v=oyqCsjdJhBg&t=1s

Cheers. Thanks!