Skip to content

Commit

Permalink
Draft: Change get_3d_view to only return the active 3D view (FreeCAD#…
Browse files Browse the repository at this point in the history
…11050)

Related issue:
FreeCAD#10634

Also needed to avoid warnings from the PlaneGui class.
  • Loading branch information
Roy-043 committed Oct 15, 2023
1 parent 8ad5c6c commit a1b8a2e
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/Mod/Draft/draftutils/gui_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ def get_3d_view():
Returns
-------
Gui::View3DInventor
Return the current `ActiveView` in the active document,
or the first `Gui::View3DInventor` view found.
Return `None` if the graphical interface is not available.
Return the current `ActiveView` in the active document or `None`.
"""
if App.GuiUp:
# FIXME The following two imports were added as part of PR4926
Expand All @@ -73,12 +70,6 @@ def get_3d_view():
if "View3DInventor" in str(type(v)):
return v

# print("Debug: Draft: Warning, not working in active view")
v = Gui.ActiveDocument.mdiViewsOfType("Gui::View3DInventor")
if v:
return v[0]

_wrn(translate("draft", "No graphical interface"))
return None


Expand Down

0 comments on commit a1b8a2e

Please sign in to comment.