From 066c3cf374ef535d927ea24deed337a053cab544 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Mon, 8 Jan 2018 15:13:01 -0200 Subject: [PATCH] Draft: Added property to allow to turn off Shape2DView recomputes if invisible --- src/Mod/Draft/Draft.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py index dcd86d481f..4edd3d520b 100644 --- a/src/Mod/Draft/Draft.py +++ b/src/Mod/Draft/Draft.py @@ -5361,10 +5361,12 @@ class _Shape2DView(_DraftObject): obj.addProperty("App::PropertyBool","Tessellation","Draft",QT_TRANSLATE_NOOP("App::Property","Tessellate Ellipses and B-splines into line segments")) obj.addProperty("App::PropertyBool","InPlace","Draft",QT_TRANSLATE_NOOP("App::Property","For Cutlines and Cutfaces modes, this leaves the faces at the cut location")) obj.addProperty("App::PropertyFloat","SegmentLength","Draft",QT_TRANSLATE_NOOP("App::Property","Length of line segments if tessellating Ellipses or B-splines into line segments")) + obj.addProperty("App::PropertyBool","VisibleOnly","Draft",QT_TRANSLATE_NOOP("App::Property","If this is True, this object will be recomputed only if it is visible")) obj.Projection = Vector(0,0,1) obj.ProjectionMode = ["Solid","Individual Faces","Cutlines","Cutfaces"] obj.HiddenLines = False obj.Tessellation = False + obj.VisibleOnly = False obj.InPlace = True obj.SegmentLength = .05 _DraftObject.__init__(self,obj,"Shape2DView") @@ -5389,6 +5391,11 @@ class _Shape2DView(_DraftObject): #return DraftGeomUtils.cleanProjection(Part.makeCompound(edges)) def execute(self,obj): + if hasattr(obj,"VisibleOnly"): + if obj.VisibleOnly: + if obj.ViewObject: + if obj.ViewObject.Visibility == False: + return False import DraftGeomUtils obj.positionBySupport() pl = obj.Placement