diff --git a/cg/blender/import_cad/build_blender_scene.py b/cg/blender/import_cad/build_blender_scene.py index 26101fe..25e7c8d 100644 --- a/cg/blender/import_cad/build_blender_scene.py +++ b/cg/blender/import_cad/build_blender_scene.py @@ -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) diff --git a/cg/freecad/utils/freecad_to_json.py b/cg/freecad/utils/freecad_to_json.py index e7f607a..d1077c4 100644 --- a/cg/freecad/utils/freecad_to_json.py +++ b/cg/freecad/utils/freecad_to_json.py @@ -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' diff --git a/cg/pipeline/cg_pipeline.py b/cg/pipeline/cg_pipeline.py index f1708f1..410df9d 100644 --- a/cg/pipeline/cg_pipeline.py +++ b/cg/pipeline/cg_pipeline.py @@ -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(