From 4379846dfa1810c940e0b3b9213874fc70588cf2 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Mon, 22 Jun 2015 21:58:56 -0300 Subject: [PATCH] Arch: Section planes now restore the view clipping when loaded --- src/Mod/Arch/ArchSectionPlane.py | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/Mod/Arch/ArchSectionPlane.py b/src/Mod/Arch/ArchSectionPlane.py index 261a58b0d..8701dd93a 100644 --- a/src/Mod/Arch/ArchSectionPlane.py +++ b/src/Mod/Arch/ArchSectionPlane.py @@ -262,20 +262,19 @@ class _ViewProviderSectionPlane: if self.clip: sg.removeChild(self.clip) self.clip = None - else: - for o in Draft.getGroupContents(vobj.Object.Objects,walls=True): - if hasattr(o.ViewObject,"Lighting"): - o.ViewObject.Lighting = "One side" - self.clip = coin.SoClipPlane() - self.clip.on.setValue(True) - norm = vobj.Object.Proxy.getNormal(vobj.Object) - mp = vobj.Object.Shape.CenterOfMass - mp = DraftVecUtils.project(mp,norm) - dist = mp.Length + 0.1 # to not clip exactly on the section object - norm = norm.negative() - plane = coin.SbPlane(coin.SbVec3f(norm.x,norm.y,norm.z),-dist) - self.clip.plane.setValue(plane) - sg.insertChild(self.clip,0) + for o in Draft.getGroupContents(vobj.Object.Objects,walls=True): + if hasattr(o.ViewObject,"Lighting"): + o.ViewObject.Lighting = "One side" + self.clip = coin.SoClipPlane() + self.clip.on.setValue(True) + norm = vobj.Object.Proxy.getNormal(vobj.Object) + mp = vobj.Object.Shape.CenterOfMass + mp = DraftVecUtils.project(mp,norm) + dist = mp.Length + 0.1 # to not clip exactly on the section object + norm = norm.negative() + plane = coin.SbPlane(coin.SbVec3f(norm.x,norm.y,norm.z),-dist) + self.clip.plane.setValue(plane) + sg.insertChild(self.clip,0) else: if self.clip: sg.removeChild(self.clip)