Skip to content

Commit

Permalink
ASE export success message now displays some stats about the ASE file…
Browse files Browse the repository at this point in the history
… (material count, face count etc.)
  • Loading branch information
cmbasnett committed Sep 20, 2024
1 parent 6380422 commit fa51768
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion io_scene_ase/exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,15 @@ def execute(self, context):
options.should_invert_normals = pg.should_invert_normals
try:
ase = build_ase(context, options, context.selected_objects)

# Calculate some statistics about the ASE file to display in the console.
object_count = len(ase.geometry_objects)
material_count = len(ase.materials)
vertex_count = sum(len(x.vertices) for x in ase.geometry_objects)
face_count = sum(len(x.faces) for x in ase.geometry_objects)

ASEWriter().write(self.filepath, ase)
self.report({'INFO'}, 'ASE exported successfully')
self.report({'INFO'}, f'ASE exported successfully ({object_count} objects, {material_count} materials, {face_count} faces, {vertex_count} vertices)')
return {'FINISHED'}
except ASEBuildError as e:
self.report({'ERROR'}, str(e))
Expand Down

0 comments on commit fa51768

Please sign in to comment.