CAM: Fix: Tool editor ignored shape attributes if they were not in the Shape group. Now it reads all except Base
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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 = {}
|
||||
|
||||
Reference in New Issue
Block a user