Skip to content

Conversation

@mikedh
Copy link
Owner

@mikedh mikedh commented Feb 27, 2025

A rough draft towards supporting Pyglet 2. Keeps the Pyglet 1 viewer which may be deprecated at some point but not for quite a while. Pyglet 2 requires basically a viewer re-write, and this is currently showing a single mesh but needs quite a bit more work (instanced meshes, etc).

This applies the following moves and deprecations:

  • trimesh.viewer.widget -> examples/widget
    • Applies the deprecation warning for the move of the widget into the examples folder.
  • trimesh.viewer.windowed -> trimesh.viewer.pyglet1
    • Keeps the old viewer as the new one probably needs some time, and to avoid breaking people's Python installs.
  • trimesh.rendering -> trimesh.viewer.pyglet1.conversion
    • This was positioned as something more general than it probably was, which is a Pyglet specific indexed vertex list constructor. Still thinking about the right way to deprecate this.
  • trimesh.viewer.pyglet2
    • New viewer.

Other changes:

  • Viewer uses the matrices provided by the Camera object which should help with people who want to render things in the same frames as the scene. This should also make it relatively easy to support orthographic cameras.
  • Viewer needs shaders for points, lines, textured meshes, etc. Shaders should be stored in the library for easy editing.
  • This should probably either wait to release until pyglet.Models stabilizes or use a lower level construct.

@YoniChechik
Copy link

have you considered integration with www.rerun.io ? They already did all the visualization heavy lifting

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.

2 participants