[CAM] bugfix tools not imported properly during library import
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user