From 59a3650fb5c64b28e27ce71e384d7da93909a6d6 Mon Sep 17 00:00:00 2001 From: sliptonic Date: Fri, 13 Jul 2018 10:46:59 -0500 Subject: [PATCH] Fix for coverity CID 168953 Make test for ocl not conditional. --- src/Mod/Path/PathScripts/PathSurface.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathSurface.py b/src/Mod/Path/PathScripts/PathSurface.py index e7dfbb0f3d..37a5fa914d 100644 --- a/src/Mod/Path/PathScripts/PathSurface.py +++ b/src/Mod/Path/PathScripts/PathSurface.py @@ -98,6 +98,15 @@ class ObjectSurface(PathOp.ObjectOp): def opExecute(self, obj): '''opExecute(obj) ... process surface operation''' PathLog.track() + + # OCL must be installed + try: + import ocl + except: + FreeCAD.Console.PrintError( + translate("Path_Surface", "This operation requires OpenCamLib to be installed.") + "\n") + return + print("StepOver is " + str(obj.StepOver)) if obj.StepOver > 100: obj.StepOver = 100 @@ -116,14 +125,6 @@ class ObjectSurface(PathOp.ObjectOp): print("base object: " + self.baseobject.Name) - if obj.Algorithm in ['OCL Dropcutter', 'OCL Waterline']: - try: - import ocl - except: - FreeCAD.Console.PrintError( - translate("Path_Surface", "This operation requires OpenCamLib to be installed.") + "\n") - return - if self.baseobject.TypeId.startswith('Mesh'): mesh = self.baseobject.Mesh else: