mansrz / pymt

Automatically exported from code.google.com/p/pymt
0 stars 0 forks source link

Texture in obj files are not working #214

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
in 3Dviewer, i remplace the .obj and .mtl by my project. I re-name it on
"monkey.obj & monkey.mtl"

Nothing more. I launch 3dviewer.py and i don't see my texture.

I run with PyMT 0.4 on Windows 7 32bits 

Please provide any additional information below.

Original issue reported on code.google.com by lovan...@hotmail.fr on 16 Feb 2010 at 10:37

Attachments:

GoogleCodeExporter commented 9 years ago
See http://github.com/tito/pymt/commit/da892789eb74d33bc982f6f7181933ba918a715b

Fixed support of Texture in material : 
* space in filename
* texture load
* texture coordinates converted to valid tex_coord from texture

Can't test with monkey, the material used is not attached in the rar.

But i've been able to load & use :
* http://www.tox3d.com/Files/CoffeeTable1.zip
* 
http://www.tox3d.com/Products/3d-Models/Furnishings/TableWare/SoupBowl/SoupBowll
1.zip

Original comment by txprog on 30 Mar 2010 at 10:26

GoogleCodeExporter commented 9 years ago
how thanks!
I'll try tomorow! you has use blender for make this? i can see a new file: .pz3 
and
.daz, it's importante file? how did u has creat that file? thanks in advance !

Original comment by lovan...@hotmail.fr on 30 Mar 2010 at 11:14

GoogleCodeExporter commented 9 years ago
I didn't add anything, this .pz3 and .daz are comming with the zip file.
It's another user that give me a link to tox3D. (only obj/mtl file are used)

Original comment by txprog on 30 Mar 2010 at 11:17

GoogleCodeExporter commented 9 years ago
so thanks! Maybe it's better to use a .fbx ? it's better of .obj (more complete 
file)
You didn't think same? 

Original comment by lovan...@hotmail.fr on 30 Mar 2010 at 11:23

GoogleCodeExporter commented 9 years ago
hi, i've try with a new version, but no work with me. Sorry, no texture always..
I've add a new .mtl, .obj and texture .jpg, change a name of obj in 3Dviewer.py 
and
run. But its the same

Original comment by lovan...@hotmail.fr on 31 Mar 2010 at 1:44

GoogleCodeExporter commented 9 years ago
yep, same for me.
A
[WARNING] [Image   ] Unable to load image <plywoodclean.jpg>
/usr/local/lib/python2.6/dist-packages/PyMT-0.4-py2.6.egg/pymt/obj.py:153:
UserWarning: Could not load texture plywoodclean.jpg
  warnings.warn('Could not load texture %s' % values[1])
/usr/local/lib/python2.6/dist-packages/PyMT-0.4-py2.6.egg/pymt/obj.py:156:
UserWarning: Parse error in plywoodclean.jpg.
  warnings.warn('Parse error in %s.' % filename)
Traceback (most recent call last):
  File "3Dviewer.py", line 185, in <module>
    pymt_plugin_activate(w, ctx)
  File "3Dviewer.py", line 176, in pymt_plugin_activate
    ctx.mv = ModelViewer(size=(root.width,root.height))
  File "3Dviewer.py", line 73, in __init__
    self.model = bunny = OBJ(os.path.join(current_dir, 'coffeetable/CoffeeTable1.obj'))
  File "/usr/local/lib/python2.6/dist-packages/PyMT-0.4-py2.6.egg/pymt/obj.py", line
63, in __init__
    self.load_material_library(values[1])
  File "/usr/local/lib/python2.6/dist-packages/PyMT-0.4-py2.6.egg/pymt/obj.py", line
150, in load_material_library
    material.texture = pymt.Image(filename).texture
  File
"/usr/local/lib/python2.6/dist-packages/PyMT-0.4-py2.6.egg/pymt/core/image/__ini
t__.py",
line 152, in __init__
    self.filename   = arg
  File
"/usr/local/lib/python2.6/dist-packages/PyMT-0.4-py2.6.egg/pymt/core/image/__ini
t__.py",
line 209, in _set_filename
    self._filename, keep_data=self._keep_data)
  File
"/usr/local/lib/python2.6/dist-packages/PyMT-0.4-py2.6.egg/pymt/core/image/__ini
t__.py",
line 96, in load
    im = loader(filename, **kwargs)
  File
"/usr/local/lib/python2.6/dist-packages/PyMT-0.4-py2.6.egg/pymt/core/image/__ini
t__.py",
line 43, in __init__
    self._data      = self.load(filename)
  File
"/usr/local/lib/python2.6/dist-packages/PyMT-0.4-py2.6.egg/pymt/core/image/img_p
ygame.py",
line 34, in load
    im = pygame.image.load(filename)
pygame.error: Couldn't open plywoodclean.jpg

Original comment by awa...@gmail.com on 31 Mar 2010 at 3:42

GoogleCodeExporter commented 9 years ago
You're still using the pymt version of EGG, (with easy_install).
You need to run on the latest git version !

=> /usr/local/lib/python2.6/dist-packages/PyMT-0.4-py2.6.egg
Remove this directory to ensure not running on packaged one.

Original comment by txprog on 31 Mar 2010 at 7:25

GoogleCodeExporter commented 9 years ago
i'will try with linux OS. With windows 32 bits, no error, working but, without
texture. And i don't find PyMT-0.4-py2.6.egg ... If you know more... Thanks in 
advence 

Original comment by lovan...@hotmail.fr on 1 Apr 2010 at 1:36

GoogleCodeExporter commented 9 years ago

Original comment by txprog on 2 Jul 2010 at 2:17