Draft: Allow to set a default camera height

This commit is contained in:
Yorik van Havre
2019-09-05 20:50:29 -03:00
parent ef558a8d25
commit 2463c2a7d5

View File

@@ -1405,6 +1405,15 @@ class Snapper:
self.toolbar.toggleViewAction().setVisible(True)
if FreeCADGui.ActiveDocument:
self.setTrackers()
if not FreeCAD.ActiveDocument.Objects:
if FreeCADGui.ActiveDocument.ActiveView:
if FreeCADGui.ActiveDocument.ActiveView.getCameraType() == 'Orthographic':
c = FreeCADGui.ActiveDocument.ActiveView.getCameraNode()
if c.orientation.getValue().getValue() == (0.0, 0.0, 0.0, 1.0):
p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft")
h = p.GetInt("defaultCameraHeight",0)
if h:
c.height.setValue(h)
def hide(self):
if hasattr(self,"toolbar"):