TagStudio icon indicating copy to clipboard operation
TagStudio copied to clipboard

feat: add model thumbnail rendering

Open Lunarient opened this issue 10 months ago • 1 comments

Summary

This pull request adds 3D model thumbnail support for .obj, .gltf, .stl, .glb, and .fbx formats, using Open3D 0.19.0 for rendering. It supports textures and can color texture-less models. In the future, I plan to add a setting for users to choose their default model color.

This supersedes https://github.com/TagStudioDev/TagStudio/pull/693

This closes https://github.com/TagStudioDev/TagStudio/issues/351

Remaining Issues

The first issue with the pull request is that Open3D's OffscreenRenderer requires a dedicated thread, and it crashes if no thread adopts the renderer. I'm unsure how to integrate this with QThreads, so as a workaround, I set daemon=True for the rendering thread to prevent the software from hanging on exit. While this stops the hanging issue, it feels like a hacky solution.

The second issue is that sometimes on the first run the program seg faults, but on second run has no issues

Preview

Screenshot_12-Mar_23-47-34_22376

Tasks Completed

  • Platforms Tested:
    • [ ] Windows x86
    • [ ] Windows ARM
    • [ ] macOS x86
    • [ ] macOS ARM
    • [X] Linux x86
    • [ ] Linux ARM
  • Tested For:
    • [x] Basic functionality
    • [ ] PyInstaller executable

Lunarient avatar Mar 13 '25 03:03 Lunarient

Looks like the offscreenrenderer that comes with open3d only works on linux. So I need to try a different way to render off screen. I think there are other ways, they will just take more time. Back to the drawing board

Lunarient avatar Apr 02 '25 17:04 Lunarient

Closing, see discussion post #1231

CyanVoxel avatar Nov 26 '25 05:11 CyanVoxel