cg: update pipeline to lcs property WIP

This commit is contained in:
brothermechanic 2024-03-14 11:29:06 +03:00
parent c27b99ff52
commit 6c7e8c46d6
No known key found for this signature in database
GPG key ID: 9C59EF9503ACD106
3 changed files with 11 additions and 2 deletions

View file

@ -51,13 +51,18 @@ def json_to_blend(js_data, **cg_config):
bobj = None
if js_data[fc_file][js_obj]['type'] == 'LCS':
if not js_obj.endswith(cg_config['lcs_inlet']) and not js_obj.endswith(cg_config['lcs_outlet']):
if not js_data[fc_file][js_obj].get('Robossembler_SocketFlow'):
#if not js_obj.endswith(cg_config['lcs_inlet']) and not js_obj.endswith(cg_config['lcs_outlet']):
logger.info('LCS %s is not defined!', js_obj)
continue
bobj = bpy.data.objects.new(js_obj, None)
bobj.empty_display_type = 'ARROWS'
bobj.empty_display_size = round(random.uniform(0.05, 0.15), 3)
bobj.show_in_front = True
for attr in js_data[fc_file][js_obj].keys():
if 'Robossembler' not in attr:
continue
bobj[attr] = js_data[fc_file][js_obj][attr]
lcs_collection.objects.link(bobj)
imported_objects['objs_lcs'].append(bobj.name)

View file

@ -54,6 +54,10 @@ def freecad_to_json(**kwargs):
if obj.isDerivedFrom('PartDesign::CoordinateSystem'):
js_obj['type'] = 'LCS'
for attr in dir(obj):
if 'Robossembler' not in attr:
continue
js_obj[attr] = getattr(obj, attr)
elif obj.isDerivedFrom('Part::Feature'):
js_obj['type'] = 'PART'

View file

@ -283,7 +283,7 @@ if __name__ == '__main__':
'--linear_deflection',
type=float,
help='Max linear distance error',
default=0.1,
default=0.01,
required=False
)
parser.add_argument(