From 6464196d3a8038479d37a396c33e1d38dd447d80 Mon Sep 17 00:00:00 2001 From: Samuel Abels Date: Mon, 30 Jun 2025 20:27:54 +0200 Subject: [PATCH] CAM: Fix: Tool editor ignored shape attributes if they were not in the Shape group. Now it reads all except Base --- src/Mod/CAM/Path/Tool/shape/doc.py | 3 +++ src/Mod/CAM/Path/Tool/shape/models/base.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Mod/CAM/Path/Tool/shape/doc.py b/src/Mod/CAM/Path/Tool/shape/doc.py index da1bb79421..d1c5c463df 100644 --- a/src/Mod/CAM/Path/Tool/shape/doc.py +++ b/src/Mod/CAM/Path/Tool/shape/doc.py @@ -69,6 +69,7 @@ def get_object_properties( obj: "FreeCAD.DocumentObject", props: Optional[List[str]] = None, group: Optional[str] = None, + exclude_groups: Optional[List[str]] = None, ) -> Dict[str, Tuple[Any, str]]: """ Extract properties from a FreeCAD PropertyBag, including their types. @@ -90,6 +91,8 @@ def get_object_properties( for name in props or obj.PropertiesList: if group and not obj.getGroupOfProperty(name) == group: continue + if exclude_groups and obj.getGroupOfProperty(name) in exclude_groups: + continue if hasattr(obj, name): value = getattr(obj, name) type_id = obj.getTypeIdOfProperty(name) diff --git a/src/Mod/CAM/Path/Tool/shape/models/base.py b/src/Mod/CAM/Path/Tool/shape/models/base.py index 6a2122bb33..312109318b 100644 --- a/src/Mod/CAM/Path/Tool/shape/models/base.py +++ b/src/Mod/CAM/Path/Tool/shape/models/base.py @@ -357,7 +357,7 @@ class ToolBitShape(Asset): raise ValueError("No 'Attributes' PropertyBag object found in document bytes") # loaded_raw_params will now be Dict[str, Tuple[Any, str]] - loaded_raw_params = get_object_properties(props_obj, group="Shape") + loaded_raw_params = get_object_properties(props_obj, exclude_groups=["", "Base"]) # Separate values and types, and populate _param_types loaded_params = {}