Skip to content

fix: preserve model materials across source reimport - #3366

Open
Kreblc3428 wants to merge 1 commit into
stride3d:masterfrom
Kreblc3428:fix-3363-material-reimport
Open

fix: preserve model materials across source reimport#3366
Kreblc3428 wants to merge 1 commit into
stride3d:masterfrom
Kreblc3428:fix-3363-material-reimport

Conversation

@Kreblc3428

Copy link
Copy Markdown
Contributor

PR Details

Fixes model material assignments becoming misaligned or losing references when updating a model from source after materials are removed and later restored.

The importer now aligns saved materials to the current source material order by name, while the editor reconnects genuinely reintroduced material slots to an existing same-named material asset.

Tested with the reproduction from #3363, including repeated v1 ? v2 ? v1 updates, multiple material removals, manual overrides, save/reopen, and running the editor.

Developed with assistance from ChatGPT using GPT-5.6 Sol. The final changes were reviewed and tested before submission.

Related Issue

Fixes #3363

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My change requires a change to the documentation.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have built and run the editor to try this change out.

@Kryptos-FR

Copy link
Copy Markdown
Member

This kind of changes needs new tests to cover that specific scenario.

@xen2

xen2 commented Aug 25, 2026

Copy link
Copy Markdown
Member

FYI, I took a quick look at the failing tests and it seems to be AnimatedModel rendering all white:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Repeated glb file updates in resources cause materials to be assigned incorrectly

3 participants