Skip to content

[Bug] ImportFile progress callback never called — progress bar stays at 0% #601

Description

@JeanPhilippeKernel

Type

  • Bug

Overview

Both AssimpImporter::ImportFile() and GltfImporter::ImportFile() accept an ImportProgressCallback on_progress parameter but neither implementation calls it during processing. The importer panel's progress bar remains at 0% for the entire import duration and jumps directly to 100% on completion.

Context

AssetImporterUIComponent wires OnImportProgress as the on_progress callback, which updates m_progress (read each frame by RenderImporting()). Because the callback is never invoked, the user sees no feedback during potentially long imports (large FBX, multi-material GLB).

Relevant files:

  • ZEngine/ZEngine/Importers/AssimpImporter.cppImportFile() and AssimpProgressHandler::Update()
  • ZEngine/ZEngine/Importers/GltfImporter.cppImportFile()
  • Tetragrama/Components/AssetImporterUIComponent.cppOnImportProgress()

AssimpImporter already has an AssimpProgressHandler class that overrides Assimp::ProgressHandler::Update(float percentage). The handler holds a pointer to the importer but does not forward the percentage to the stored on_progress callback.

What needs to be done

AssimpImporter

  1. Store the on_progress callback and context pointer on AssimpProgressHandler (or on AssimpImporter as transient fields, cleared after each ImportFile call).
  2. In AssimpProgressHandler::Update(float percentage), call on_progress(context, percentage) if the callback is set.

GltfImporter

  1. Identify logical progress milestones in ImportFile() (e.g. after loading, after mesh extraction, after material extraction, after texture extraction, after serialization) and call on_progress(context, fraction) at each.

Testing

  • Import a large FBX (> 50 MB) and verify the progress bar advances smoothly during the import.
  • Import a GLB and verify the progress bar shows at least 2–3 intermediate updates before completing.

Acceptance criteria

  • AssimpImporter calls on_progress via AssimpProgressHandler::Update() during assimp processing
  • GltfImporter calls on_progress at each major processing stage
  • Progress value is in the range [0.0, 1.0]
  • Progress bar in the importer panel visibly advances during a real import
  • Builds without warnings in Debug and Release
  • All relevant unit tests pass
  • No regression in existing functionality

Estimated effort

2–3 hours

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions