diff --git a/src/Mod/CAM/InitGui.py b/src/Mod/CAM/InitGui.py index 6f3b6d434f..9b09fa2984 100644 --- a/src/Mod/CAM/InitGui.py +++ b/src/Mod/CAM/InitGui.py @@ -108,6 +108,10 @@ class CAMWorkbench(Workbench): from Path.Tool.toolbit.ui import cmd as PathToolBitCmd from Path.Tool.library.ui import cmd as PathToolBitLibraryCmd + from Path.Tool.camassets import cam_assets + + cam_assets.setup() + from PySide.QtCore import QT_TRANSLATE_NOOP import PathCommands diff --git a/src/Mod/CAM/Path/Preferences.py b/src/Mod/CAM/Path/Preferences.py index 10d5204393..b3bfc8ee22 100644 --- a/src/Mod/CAM/Path/Preferences.py +++ b/src/Mod/CAM/Path/Preferences.py @@ -128,6 +128,8 @@ def getAssetPath() -> pathlib.Path: def setAssetPath(path: pathlib.Path): assert path.is_dir(), f"Cannot put a non-initialized asset directory into preferences: {path}" + if str(path) == str(getAssetPath()): + return pref = tool_preferences() pref.SetString(ToolPath, str(path)) _emit_change(ToolGroup, ToolPath, path) diff --git a/src/Mod/CAM/Path/Tool/__init__.py b/src/Mod/CAM/Path/Tool/__init__.py index 042c771e31..36cb227147 100644 --- a/src/Mod/CAM/Path/Tool/__init__.py +++ b/src/Mod/CAM/Path/Tool/__init__.py @@ -18,7 +18,6 @@ cam_assets.register_asset(ToolBitShape, DummyAssetSerializer) cam_assets.register_asset(ToolBitShapePngIcon, DummyAssetSerializer) cam_assets.register_asset(ToolBitShapeSvgIcon, DummyAssetSerializer) cam_assets.register_asset(Machine, DummyAssetSerializer) -cam_assets.setup() # For backward compatibility with files saved before the toolbit rename # This makes the Path.Tool.toolbit.base module available as Path.Tool.Bit.