Fix for coverity CID 168953

Make test for ocl not conditional.
This commit is contained in:
sliptonic
2018-07-13 10:46:59 -05:00
committed by Yorik van Havre
parent 2c74bcddd4
commit 3d09e6543a

View File

@@ -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: