From bb9ae3540ec33800764d93d63c38728717025e78 Mon Sep 17 00:00:00 2001 From: David Kaufman Date: Wed, 5 Nov 2025 13:28:54 -0500 Subject: [PATCH] [CAM] bugfix tools not imported properly during library import --- src/Mod/CAM/Path/Tool/assets/ui/filedialog.py | 2 ++ src/Mod/CAM/Path/Tool/toolbit/models/base.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/Mod/CAM/Path/Tool/assets/ui/filedialog.py b/src/Mod/CAM/Path/Tool/assets/ui/filedialog.py index 1e49be1461..9308b894a2 100644 --- a/src/Mod/CAM/Path/Tool/assets/ui/filedialog.py +++ b/src/Mod/CAM/Path/Tool/assets/ui/filedialog.py @@ -23,6 +23,7 @@ import pathlib from typing import Optional, Tuple, Type, Iterable from PySide.QtWidgets import QFileDialog, QMessageBox +from ...camassets import cam_assets from ..manager import AssetManager from ..serializer import AssetSerializer, Asset from .util import ( @@ -214,6 +215,7 @@ class AssetOpenDialog(QFileDialog): toolbit.id = dependency_uri.asset_id # Import the toolbit into local store + cam_assets.add(toolbit) imported_count += 1 except Exception as e: diff --git a/src/Mod/CAM/Path/Tool/toolbit/models/base.py b/src/Mod/CAM/Path/Tool/toolbit/models/base.py index 7214c92072..62ec4b2ac1 100644 --- a/src/Mod/CAM/Path/Tool/toolbit/models/base.py +++ b/src/Mod/CAM/Path/Tool/toolbit/models/base.py @@ -103,6 +103,8 @@ class ToolBit(Asset, ABC): raise ValueError("ToolBit dictionary is missing 'shape' key") # Try to find the shape type. Default to Unknown if necessary. + if "shape" in attrs and "shape-type" not in attrs: + attrs["shape-type"] = attrs["shape"] shape_type = attrs.get("shape-type") shape_class = ToolBitShape.get_shape_class_from_id(shape_id, shape_type) if not shape_class: