@@ -59,19 +59,23 @@ def get_3d_view():
|
||||
Returns
|
||||
-------
|
||||
Gui::View3DInventor
|
||||
Return the current `ActiveView` in the active document or `None`.
|
||||
The Active 3D View or `None`.
|
||||
"""
|
||||
if App.GuiUp:
|
||||
# FIXME The following two imports were added as part of PR4926
|
||||
# Also see discussion https://forum.freecad.org/viewtopic.php?f=3&t=60251
|
||||
import FreeCADGui as Gui
|
||||
from pivy import coin
|
||||
if Gui.ActiveDocument:
|
||||
v = Gui.ActiveDocument.ActiveView
|
||||
if "View3DInventor" in str(type(v)):
|
||||
return v
|
||||
if not App.GuiUp:
|
||||
return None
|
||||
|
||||
return None
|
||||
# FIXME The following two imports were added as part of PR4926
|
||||
# Also see discussion https://forum.freecadweb.org/viewtopic.php?f=3&t=60251
|
||||
import FreeCADGui as Gui
|
||||
from pivy import coin
|
||||
|
||||
mw = Gui.getMainWindow()
|
||||
view = mw.getActiveWindow()
|
||||
if view is None:
|
||||
return None
|
||||
if not hasattr(view, "getSceneGraph"):
|
||||
return None
|
||||
return view
|
||||
|
||||
|
||||
get3DView = get_3d_view
|
||||
|
||||
Reference in New Issue
Block a user