Open traversaro opened 2 years ago
Hey, is this still happening? Checking on my local machine it looks OK:
n [4]: m = trimesh.load('/home/mikedh/Downloads/WaterBottle.glb')
primitive has no mode! trying GL_TRIANGLES?
In [5]: m
Out[5]: <trimesh.Scene(len(geometry)=1)>
In [9]: m.geometry
Out[9]:
OrderedDict([('WaterBottle',
<trimesh.Trimesh(vertices.shape=(2549, 3), faces.shape=(4510, 3))>)])
In [10]: m.geometry['WaterBottle'].visual.material
Out[10]: <trimesh.visual.material.PBRMaterial at 0x7f66ab235520>
In [11]: mat = m.geometry['WaterBottle'].visual.material
In [12]: mat._data
Out[12]:
{'emissiveFactor': array([1., 1., 1.]),
'baseColorTexture': <PIL.PngImagePlugin.PngImageFile image mode=RGB size=2048x2048 at 0x7F66AB240A30>,
'doubleSided': False}
In [13]: mat.emissiveFactor
Out[13]: array([1., 1., 1.])
In [14]: mat.emissiveTexture
Out[14]: <PIL.PngImagePlugin.PngImageFile image mode=RGB size=2048x2048 at 0x7F66A31BA130>
Is it possible the runner is missing pillow
, which would be required to load the texture?
I missed the reply @mikedh ! I will trigger a new build in https://github.com/conda-forge/pyrender-feedstock/pull/2 to check.
@traversaro I reproduce the same thing on my local machine and also on GitHub Workflow (See #216)
I was debugging code and found the following behavior change:
import trimesh
print(trimesh.__version__)
bm = trimesh.load("tests/data/WaterBottle.glb").dump()[0]
print(bm.visual.material.emissiveTexture)
trimesh 3.9.32
3.9.32
primitive has no mode! trying GL_TRIANGLES?
<PIL.Image.Image image mode=RGB size=2048x2048 at 0x7F385EAFACD0>
trimesh 3.9.33
3.9.33
primitive has no mode! trying GL_TRIANGLES?
None
@mikedh Your analysis helped me a lot. It seems that the dump
method has changed in trimesh 3.9.33 so it does not take into account some materials. So I have changed the test based on your code which is in my PR #216.
Also note that prior to 3.9.33 emissive Texture was of type PIL.Image.Image
but is now PIL.PngImagePlugin.PngImageFile
. It can be a starting point to know the effects of the changes introduced in 3.9.33
Since trimesh 3.9.33 (I tested with pip, and trimesh 3.9.32 works fine) the
test_meshes.py
test fails with error: