From 1ca81099d456736adfc84b78a270a3bd760ae667 Mon Sep 17 00:00:00 2001 From: sliptonic Date: Wed, 3 Sep 2025 15:32:33 -0500 Subject: [PATCH] [CAM] Make sure CAMAsset location exists (#23618) * Fixes #22858 Ensure that the default CAM asset location exists and is created in the user data location * Update src/Mod/CAM/Path/Preferences.py Co-authored-by: Chris Hennes --------- Co-authored-by: Chris Hennes --- src/Mod/CAM/Path/Preferences.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Mod/CAM/Path/Preferences.py b/src/Mod/CAM/Path/Preferences.py index b3bfc8ee22..7f784fa4f6 100644 --- a/src/Mod/CAM/Path/Preferences.py +++ b/src/Mod/CAM/Path/Preferences.py @@ -114,9 +114,11 @@ def getBuiltinToolBitPath() -> pathlib.Path: return getBuiltinAssetPath() / "Bit" -def getDefaultAssetPath(): - config = pathlib.Path(FreeCAD.ConfigGet("UserConfigPath")) - return config / "CamAssets" +def getDefaultAssetPath() -> Path: + data_dir = pathlib.Path(FreeCAD.getUserAppDataDir()) + asset_path = data_dir / "CamAssets" + asset_path.mkdir(parents=True, exist_ok=True) + return asset_path def getAssetPath() -> pathlib.Path: