Skip to content

[Feature] Reimport flow — trigger reimport from stored SourcePath in .meta #602

Description

@JeanPhilippeKernel

Type

  • Feature

Overview

Every successful import writes MetaFileData::SourcePath (the original source file path) to the .meta sidecar alongside the cooked artifact. This data is available but there is no UI path to use it — users cannot reimport an asset when the source file changes without going through a fresh file-picker import.

Context

AssetImporterUIComponent::OnImportFileComplete() calls MetaFileIO::Write() with the source path populated. The .meta file is stored next to the .zemesh artifact under the VFS. However:

  • The content browser has no right-click context menu.
  • AssetImporterUIComponent has no "reimport selected" action.
  • There is no code path that reads SourcePath back and triggers ImportFile.

Related code:

  • ZEngine/ZEngine/Core/VFS/Meta/MetaFileData.hSourcePath field
  • ZEngine/ZEngine/Core/VFS/Meta/MetaFileIO.h/.cpp — read/write
  • Tetragrama/Components/AssetImporterUIComponent.cppOnImportFileComplete()
  • Tetragrama/Components/ContentBrowserUIComponent (or ProjectViewUIComponent) — future right-click target

What needs to be done

  1. Add a right-click context menu to the content browser grid for .zemesh items.
  2. On "Reimport", read the .meta sidecar for that asset via MetaFileIO::Read().
  3. If SourcePath is non-empty and the file exists on disk, populate AssetImporterUIComponent::m_path_buf and call StartImport() with m_add_to_scene = false.
  4. If SourcePath is empty or the file is missing, show an error in the importer log and fall back to opening the file picker.
  5. Add a visible "Reimport" button in the importer panel's Idle state history list (next to each successfully imported entry).

Testing

  • Import a GLB → modify it externally → right-click the .zemesh in the content browser → "Reimport" → verify the updated mesh is reflected in the scene.
  • Right-click a .zemesh with a missing source file → verify a clear error message is shown.

Acceptance criteria

  • Right-click context menu appears on .zemesh items in the content browser
  • "Reimport" reads SourcePath from the .meta sidecar and triggers ImportFile
  • Missing source file produces a visible error rather than a silent no-op
  • Builds without warnings in Debug and Release
  • All relevant unit tests pass
  • No regression in existing functionality

Estimated effort

1 day

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions