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 a bug where materials and/or meshes weren't assigned to scene on first import. #12717

Merged
merged 1 commit into from
Nov 20, 2017

Conversation

NathanWarden
Copy link
Contributor

Fixes #11452

@NathanWarden NathanWarden changed the title Fixed a bug where materials weren't assigned to scene on first import. Fixed a bug where materials and/or meshes weren't assigned to scene on first import. Nov 7, 2017
@akien-mga akien-mga added this to the 3.0 milestone Nov 7, 2017
} else {

ResourceSaver::save(ext_name, mat, ResourceSaver::FLAG_CHANGE_PATH);
p_materials[mat] = mat;
p_materials[mat] = ResourceLoader::load(ext_name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for this change, and the other similar ones (reloading the just-saved mat instead of just using the source one)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's because if it uses the original sourced one the resulting imported mesh or scene uses a builtin material instead of the saved resource even though the import setting is set to "Files" on the initial import. I have a video of the issue in the linked bug report.

In other words, the original material is not the same material as the newly saved resource. Thus, when you go to make changes it won't overwrite the saved material even though the import setting is set to "Files", it will try and create another new one. The same issue exists with meshes that this PR fixes.

@NathanWarden
Copy link
Contributor Author

Before the beta hits I just want to make sure that it's clear what this fixes. I can make a video showing before and after. Actually, there's a video that I made that's in the bug report. But, I can make a video showing it after the fix. Thanks! :)

@akien-mga akien-mga merged commit 9134929 into godotengine:master Nov 20, 2017
@NathanWarden NathanWarden deleted the material_import_fix branch November 22, 2017 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants