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

Fixed some texture loading errors #290

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JBKacerovsky
Copy link

Small changes to fix texture loading errors that caused crashes when converting some glb models loaded with trimesh to pyrender scenes using pyrender.Scene.from_trimesh_scene

  • material.py: updated baseColorTexture.setter to check for "L" and "LA" mode textures and convert them to RGBA (avoids ValueError('Cannot reformat 2-channel texture into RGB') for greyscale baseColorTextures
  • utils.py: updated format_texture_source to handle bool textures to aviod TypeError('Invalid type {} for texture'.format(
    type(texture)

convert PIL mode "L" or "LA" to "RGBA" for basecolorTexture
added condition to handle bool array textures in format_texture_source
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

Successfully merging this pull request may close these issues.

1 participant