-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Proper fix would likely require the ability to create a 3D viewer from Python without creating a tab at the same time. Most of the hoops I've jumped through are to attempt to prevent the tab from being garbage-collected, which crashes the viewer.
https://freecad-python-stubs.readthedocs.io/en/latest/autoapi/FreeCADGui/#FreeCADGui.createViewer is the only function that opens a viewer, and does so as a tab containing one or two viewers.
Additionally, while someone's exposing this in the FreeCAD API, it would be nice to have access to some of the QuarterWidget API, at least enough to save a screenshot/PNG render of a 3D view (preferably without having to make it visible on-screen) would be a good start, as currently the 3D view is an (ironically) opaque object.
If we could have access to the full customized-by-freecad QuarterWidget library's Python bindings, that would be wonderful.
To quote a comment in the source code of this addon:
FreeCAD uses a modified version of QuarterWidget, so the
import pivy.quarterone will cause segfaults.
FreeCAD's FreeCADGui.createViewer() puts the viewer widget inside an MDI window, and detaching it without causing segfaults on exit is tricky.