[CAM] bugfix tools not imported properly during library import

This commit is contained in:
David Kaufman
2025-11-05 13:28:54 -05:00
parent cb88a6d603
commit bb2ca9f9c9
2 changed files with 4 additions and 0 deletions

View File

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

View File

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