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

feat: add model thumbnail rendering #860

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Lunarient
Copy link

@Lunarient Lunarient commented Mar 13, 2025

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 #693

This closes #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
    • Linux x86
    • Linux ARM
  • Tested For:
    • Basic functionality
    • PyInstaller executable

@CyanVoxel CyanVoxel added Type: Enhancement New feature or request Type: QoL A quality of life (QoL) enhancement or suggestion Type: UI/UX User interface and/or user experience Priority: Medium An issue that shouldn't be be saved for last labels Mar 13, 2025
@Lunarient
Copy link
Author

Okay I'm no longer certain it's the model renderer that's causing the seg fault. I disabled the renderer and it still seg faults when adding new files to a library, but otherwise I don't know what causes it. If I someone else can test this, then it should be good to merge

@Lunarient Lunarient marked this pull request as ready for review March 24, 2025 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Medium An issue that shouldn't be be saved for last Type: Enhancement New feature or request Type: QoL A quality of life (QoL) enhancement or suggestion Type: UI/UX User interface and/or user experience
Projects
Status: 🚧 In progress
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Render STL thumbnails
2 participants