RCG Pipeline Release with Docs

This commit is contained in:
brothermechanic 2024-04-09 11:52:13 +00:00 committed by Igor Brylyov
parent df0fb32592
commit 3878990c4e
26 changed files with 2127 additions and 54 deletions

View file

@ -244,8 +244,7 @@ def hierarchy_tree(obj, dict_tree, clones_dic=None) -> dict:
'type': '',
'name': '',
'base_name': '',
'loc_xyz': [],
'rot_xyzw': [],
'pose': [{'loc_xyz': []}, {'rot_xyzw': []}],
'attributes': [],
'children': [
{
@ -261,6 +260,7 @@ def hierarchy_tree(obj, dict_tree, clones_dic=None) -> dict:
]
}
'''
# collect type
if obj.isDerivedFrom('Part::Feature'):
if obj.isDerivedFrom('PartDesign::CoordinateSystem'):
@ -274,22 +274,25 @@ def hierarchy_tree(obj, dict_tree, clones_dic=None) -> dict:
# collect name
dict_tree['name'] = obj.Label
# collect base_name
dict_tree['base_name'] = ''
if clones_dic:
if obj.isDerivedFrom('Part::Feature'):
for k, v in clones_dic.items():
if obj.Label in v:
dict_tree['base_name'] = k
# collect transforms
dict_tree['loc_xyz'] = list(obj.Placement.Base)
dict_tree['rot_xyzw'] = list(obj.Placement.Rotation.Q)
dict_tree['pose'] = [
{'loc_xyz': list(obj.Placement.Base)},
{'rot_xyzw': list(obj.Placement.Rotation.Q)}
]
# collect attributes
dict_tree['attributes'] = []
robossembler_attrs = [attr for attr in dir(obj) if 'Robossembler' in attr]
if robossembler_attrs:
dict_tree['attributes'] = []
for attr in robossembler_attrs:
dict_tree['attributes'].append({attr: getattr(obj, attr)})
# collect children
if obj.OutList:
# collect children for LOCATOR only
if obj.OutList and obj.isDerivedFrom('App::Part'):
dict_tree['children'] = []
for child in obj.OutList:
# skip hidden objects