From 63dcbd548ef98961b1c4b331b387478919dbae58 Mon Sep 17 00:00:00 2001 From: PhaseLoop Date: Thu, 3 Apr 2025 10:32:25 +0200 Subject: [PATCH] Revert "fix issues" This reverts commit 5a6fd53b3a071a1932392c17c72af7769af42e73. --- src/Mod/CAM/Path/Tool/Bit.py | 46 ++++++++++-------------------------- 1 file changed, 13 insertions(+), 33 deletions(-) diff --git a/src/Mod/CAM/Path/Tool/Bit.py b/src/Mod/CAM/Path/Tool/Bit.py index 20a21382e9..b2b2905128 100644 --- a/src/Mod/CAM/Path/Tool/Bit.py +++ b/src/Mod/CAM/Path/Tool/Bit.py @@ -118,14 +118,22 @@ def _findRelativePath(path, typ): return relative +# Unused due to bug fix related to relative paths +""" +def findRelativePathShape(path): + return _findRelativePath(path, 'Shape') + + +def findRelativePathTool(path): + return _findRelativePath(path, 'Bit') +""" + + def findRelativePathLibrary(path): return _findRelativePath(path, "Library") class ToolBit(object): - - TOOL_TYPES = [ "EndMill", "BallEndMill", "BullNoseMill", "Drill", "VBit", "Probe", "Laser", "Other"] - def __init__(self, obj, shapeFile, path=None): Path.Log.track(obj.Label, shapeFile, path) self.obj = obj @@ -147,14 +155,6 @@ class ToolBit(object): "Base", QT_TRANSLATE_NOOP("App::Property", "The file of the tool"), ) - - obj.addProperty( - "App::PropertyEnumeration", - "ToolType", - "Base", - QT_TRANSLATE_NOOP("App::Property", "The type of the tool"), - ) - obj.addProperty( "App::PropertyString", "ShapeName", @@ -168,13 +168,10 @@ class ToolBit(object): QT_TRANSLATE_NOOP("App::Property", "List of all properties inherited from the bit"), ) - # set enum types by assigning array - obj.ToolType = self.TOOL_TYPES if path: obj.File = path if shapeFile is None: obj.BitShape = "endmill.fcstd" - obj.ToolType = "EndMill" self._setupBitShape(obj) self.unloadBitBody(obj) else: @@ -199,16 +196,6 @@ class ToolBit(object): obj.setEditorMode("BitBody", 2) obj.setEditorMode("File", 1) obj.setEditorMode("Shape", 2) - - if not hasattr(obj, "ToolType"): - obj.addProperty( - "App::PropertyString", - "ToolType", - "Base", - QT_TRANSLATE_NOOP("App::Property", "The type of the tool"), - ) - obj.ToolType = self.TOOL_TYPES - if not hasattr(obj, "BitPropertyNames"): obj.addProperty( "App::PropertyStringList", @@ -451,10 +438,6 @@ class ToolBit(object): attrs = {} attrs["version"] = 2 attrs["name"] = obj.Label - - if obj.ToolType: - attrs["type"] = obj.ToolType - if Path.Preferences.toolsStoreAbsolutePaths(): attrs["shape"] = obj.BitShape else: @@ -468,7 +451,8 @@ class ToolBit(object): for name in obj.BitPropertyNames: params[name] = PathUtil.getPropertyValueString(obj, name) attrs["parameter"] = params - attrs["attribute"] = {} + params = {} + attrs["attribute"] = params return attrs @@ -483,10 +467,6 @@ class ToolBitFactory(object): Path.Log.track(attrs, path) obj = Factory.Create(name, attrs["shape"], path) obj.Label = attrs["name"] - - if "type" in attrs: - obj.ToolType = attrs["type"] - params = attrs["parameter"] for prop in params: PathUtil.setProperty(obj, prop, params[prop])