Skip to content

[Task] Wire import options (scale, axis, normals) to importer pipeline #599

Description

@JeanPhilippeKernel

Type

  • Task / chore

Overview

The Options state in AssetImporterUIComponent exposes Scale, Axis, Generate Normals, Merge Identical Vertices, Import Materials, and Import Textures controls, but none of these values are read inside StartImport(). The ImportConfiguration is built without them and both importers ignore them entirely — the options panel is currently cosmetic.

Context

AssetImporterUIComponent::StartImport() builds an AssetCodec::ImportConfiguration from EditorConfiguration paths only. The five settings fields on the component (m_scale, m_axis_index, m_gen_normals, m_merge_vertices, m_import_materials, m_import_textures) are stored but never forwarded.

Related code:

  • Tetragrama/Components/AssetImporterUIComponent.cppStartImport()
  • ZEngine/ZEngine/Importers/AssetCodec.hImportConfiguration
  • ZEngine/ZEngine/Importers/AssimpImporter.cppImportFile(), m_flags
  • ZEngine/ZEngine/Importers/GltfImporter.cppImportFile()

What needs to be done

  1. Add optional fields to ImportConfiguration for the user-facing settings:
    • float ImportScale (default 1.0)
    • bool UpAxisZ (default false — Y-up)
    • bool GenerateNormals (default true)
    • bool MergeIdenticalVertices (default true)
    • bool ImportMaterials (default true)
    • bool ImportTextures (default true)
  2. Populate these fields in AssetImporterUIComponent::StartImport() from the component's member variables.
  3. In AssimpImporter::ImportFile(), build the assimp post-process flags from the config fields instead of m_flags (the static bitmask).
  4. In GltfImporter::ImportFile(), apply ImportScale to the root transform and skip material/texture extraction when the corresponding flags are false.

Testing

  • Import a GLB with Scale = 0.01 → verify the mesh is visibly smaller in the viewport.
  • Import an FBX with Generate Normals unchecked → verify no normals pass is run (check assimp log output).
  • Import with Import Materials unchecked → verify no .zematerial is written to disk.

Acceptance criteria

  • All five option fields are propagated from AssetImporterUIComponent to ImportConfiguration
  • AssimpImporter respects GenerateNormals, MergeIdenticalVertices, ImportMaterials, ImportTextures, and ImportScale
  • GltfImporter respects ImportScale, ImportMaterials, and ImportTextures
  • Builds without warnings in Debug and Release
  • All relevant unit tests pass
  • No regression in existing functionality

Estimated effort

1–2 days

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