Skip to content

Commit

Permalink
Added progress indicator when exporting PSK files
Browse files Browse the repository at this point in the history
  • Loading branch information
cmbasnett committed Nov 23, 2023
1 parent 68c7d93 commit d0fe7d9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion io_scene_psk_psa/psk/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ def build_psk(context, options: PskBuildOptions) -> PskBuildResult:
psk_material.texture_index = len(psk.materials)
psk.materials.append(psk_material)

for input_mesh_object in input_objects.mesh_objects:
context.window_manager.progress_begin(0, len(input_objects.mesh_objects))

for object_index, input_mesh_object in enumerate(input_objects.mesh_objects):

# MATERIALS
material_indices = [material_names.index(material_slot.material.name) for material_slot in input_mesh_object.material_slots]
Expand Down Expand Up @@ -288,6 +290,10 @@ def build_psk(context, options: PskBuildOptions) -> PskBuildResult:
bpy.data.meshes.remove(mesh_data)
del mesh_data

context.window_manager.progress_update(object_index)

context.window_manager.progress_end()

result.psk = psk

return result

0 comments on commit d0fe7d9

Please sign in to comment.