Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed duplicate loading of .obj model causing material ID errors #1405

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

erikwski
Copy link

@erikwski erikwski commented Mar 8, 2024

I'm excited to make my first contribution to the project!

This pull request addresses the issue described in the closed issue: #1403, where loading an .obj model could result in the creation of unnecessary "Default" materials or duplicate materials.

I've implemented a solution based on approaches used in my previous projects, which effectively prevents these issues.

Key changes:

  • Don't create a Default material everytime that parse a MTL file
  • The Material id is generated using the node id + "_" + material.id
  • If the material of the same type of node try to be created again, just link the instance to the new component setted in _ownedComponents attributes

Testing:

I've thoroughly tested this solution in my local environment to ensure it resolves the issue without introducing any regressions.
I welcome any feedback or suggestions you may have.

Thank you for your time!

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.

1 participant