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

Export blender double-sided mesh flag to gltf materials. #304

Merged
merged 1 commit into from Feb 20, 2019

Conversation

Cyp
Copy link
Contributor

@Cyp Cyp commented Feb 19, 2019

Just as making this pull request, it showed another new cb1f27b commit which does the same thing. So I suppose only either that one or this one will be useful, but not both.

Edit: Looking at that version, I think it wouldn't duplicate materials if needed, but this version should.

@emackey
Copy link
Member

emackey commented Feb 19, 2019

I tested this and it works really well, thanks! I do like that it will automatically duplicate materials when needed for differences in double-sidedness, that's great. I don't have any worries about letting go of that commit of mine you linked to.

I'll leave this open until @donmccurdy gets a peek at it, then we'll merge.

@emackey
Copy link
Member

emackey commented Feb 19, 2019

Fixes #154.

@emackey
Copy link
Member

emackey commented Feb 19, 2019

@donmccurdy The behavior resulting from this is:

  • When "double-sided lighting" is enabled on a Blender mesh, the materials used by that mesh will be double-sided in glTF.
  • When a double-sided mesh and a single-sided mesh share the same Blender material, the exporter will export two different copies of that material with the same name (allowed in glTF), wired correctly so the double-sided mesh gets the double-sided copy of the material, and the single-sided mesh gets the single-sided copy of the material.
  • When meshes share materials and also share double-sided settings, they will continue to share glTF materials as before.
  • Only single-sided materials can be influenced by the old custom nodes. But with this change, the custom nodes shouldn't be needed for this input anymore.

ghost
ghost approved these changes Feb 19, 2019
@emackey
Copy link
Member

emackey commented Feb 20, 2019

Merging this, thanks @Cyp.

@emackey emackey merged commit d5fd35a into KhronosGroup:master Feb 20, 2019
@donmccurdy
Copy link
Contributor

Nice clean fix, thanks! :)

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.

None yet

3 participants