@@ -808,7 +808,9 @@ class ViewProviderBuildingPart:
|
||||
if hasattr(vobj,prop) and hasattr(child.ViewObject,prop[8:]) and not hasattr(child,"ChildrenOverride"):
|
||||
setattr(child.ViewObject,prop[8:],getattr(vobj,prop))
|
||||
elif prop in ["CutView","CutMargin"]:
|
||||
if hasattr(vobj,"CutView") and FreeCADGui.ActiveDocument.ActiveView:
|
||||
if hasattr(vobj, "CutView") \
|
||||
and FreeCADGui.ActiveDocument.ActiveView \
|
||||
and hasattr(FreeCADGui.ActiveDocument.ActiveView, "getSceneGraph"):
|
||||
sg = FreeCADGui.ActiveDocument.ActiveView.getSceneGraph()
|
||||
if vobj.CutView:
|
||||
from pivy import coin
|
||||
|
||||
@@ -1164,6 +1164,11 @@ class _ViewProviderSite:
|
||||
|
||||
if hasattr(self, 'trueNorthRotation') and self.trueNorthRotation is not None:
|
||||
return
|
||||
if not FreeCADGui.ActiveDocument.ActiveView:
|
||||
return
|
||||
if not hasattr(FreeCADGui.ActiveDocument.ActiveView, 'getSceneGraph'):
|
||||
return
|
||||
|
||||
from pivy import coin
|
||||
self.trueNorthRotation = coin.SoTransform()
|
||||
sg = FreeCADGui.ActiveDocument.ActiveView.getSceneGraph()
|
||||
@@ -1172,10 +1177,18 @@ class _ViewProviderSite:
|
||||
|
||||
def removeTrueNorthRotation(self):
|
||||
|
||||
if hasattr(self, 'trueNorthRotation') and self.trueNorthRotation is not None:
|
||||
sg = FreeCADGui.ActiveDocument.ActiveView.getSceneGraph()
|
||||
sg.removeChild(self.trueNorthRotation)
|
||||
self.trueNorthRotation = None
|
||||
if not hasattr(self, 'trueNorthRotation'):
|
||||
return
|
||||
if self.trueNorthRotation is None:
|
||||
return
|
||||
if not FreeCADGui.ActiveDocument.ActiveView:
|
||||
return
|
||||
if not hasattr(FreeCADGui.ActiveDocument.ActiveView, 'getSceneGraph'):
|
||||
return
|
||||
|
||||
sg = FreeCADGui.ActiveDocument.ActiveView.getSceneGraph()
|
||||
sg.removeChild(self.trueNorthRotation)
|
||||
self.trueNorthRotation = None
|
||||
|
||||
def updateTrueNorthRotation(self):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user