fusion: purge meshes/ folder prima di ogni export
Aggiunto _purge_meshes_dir() chiamato all inizio di export_meshes_and_hierarchy. Cancella .obj/.stl/.mtl residui di export precedenti (component rinominati o rimossi dal modello Fusion) che altrimenti rimanevano come orfani nella cartella di output e venivano potenzialmente caricati dal viewer come nodi vuoti. Conteggio in stats.purged_stale, mostrato nel messageBox finale di entrambi gli script (plotter + ATL).
This commit is contained in:
@@ -562,10 +562,10 @@ def run(context):
|
||||
design, root_comp, out_dir
|
||||
)
|
||||
_annotate_hierarchy(nodes)
|
||||
_log('purged stale meshes: {0}'.format(mesh_stats.get('purged_stale', 0)))
|
||||
_log('hierarchy nodes: {0}, mesh ok: {1}, mesh fail: {2}'.format(
|
||||
len(nodes), mesh_stats['exported_meshes'], mesh_stats['failed_meshes']
|
||||
))
|
||||
|
||||
hierarchy_payload = {
|
||||
'metadata': {
|
||||
'documentName': doc_name,
|
||||
@@ -651,16 +651,17 @@ def run(context):
|
||||
'Export ATL completato.\n\n'
|
||||
'Cartella: {0}\n\n'
|
||||
'Nodi gerarchia: {1}\n'
|
||||
'Mesh esportate: {2} (fallite: {3})\n\n'
|
||||
'Joints: {4} (rinominati {5}, orfani {6})\n'
|
||||
'As-Built Joints: {7} (rinominati {8}, origin recuperati {9}, revolute senza origin {10})\n'
|
||||
'Motion Links: {11}\n'
|
||||
'Rigid Groups: {12}\n\n'
|
||||
'Mesh esportate: {2} (fallite: {3}, stale rimosse: {4})\n\n'
|
||||
'Joints: {5} (rinominati {6}, orfani {7})\n'
|
||||
'As-Built Joints: {8} (rinominati {9}, origin recuperati {10}, revolute senza origin {11})\n'
|
||||
'Motion Links: {12}\n'
|
||||
'Rigid Groups: {13}\n\n'
|
||||
'Log dettagliato: export_atl.log'.format(
|
||||
out_dir,
|
||||
len(nodes),
|
||||
mesh_stats['exported_meshes'],
|
||||
mesh_stats['failed_meshes'],
|
||||
mesh_stats.get('purged_stale', 0),
|
||||
len(joints_list), joints_renamed, orphans_joints,
|
||||
len(as_built_list), ab_renamed, origin_recovered, revolutes_no_origin,
|
||||
len(motion_links),
|
||||
|
||||
Reference in New Issue
Block a user