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

Fix face material lookup #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bitsawer
Copy link
Member

The current exporter looks for materials in the mesh data block. In Blender materials can be either linked to the object or data which can create some confusion. Most of the time current version works, but it can fail in certain cases. The correct way is to use the face material_index to index into the material_slots-array. This should not break anything, but more testing could be useful.

I attached an "exportbug.zip" file which demonstrates the problem with Godot 3.0. If you export the .blend using the current addon you should notice that the cube has a red material in Godot instead of green despite both being green in Blender. Apply the patch, export, reimport and the cube should now be green and correct (remember to restart Blender to make sure the plugin is reloaded).

exportbug.zip

@Calinou Calinou added the bug label Feb 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants