Skip to content

Commit

Permalink
Fix passing read only vertex color buffer when loading GLTF
Browse files Browse the repository at this point in the history
This would fail down the line when vertex colors are converted to RGBA which attempts to modify the buffer contents directly
  • Loading branch information
RealDanTheMan committed May 30, 2024
1 parent 7853a5e commit 55b86ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions trimesh/exchange/gltf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1560,11 +1560,11 @@ def _read_buffers(
if len(colors) == len(kwargs["vertices"]):
if visuals is None:
# just pass to mesh as vertex color
kwargs["vertex_colors"] = colors
kwargs["vertex_colors"] = colors.copy()
else:
# we ALSO have texture so save as vertex
# attribute
visuals.vertex_attributes["color"] = colors
visuals.vertex_attributes["color"] = colors.copy()
except BaseException:
# survive failed colors
log.debug("failed to load colors", exc_info=True)
Expand Down

0 comments on commit 55b86ba

Please sign in to comment.