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

Materials linked to objects (and not to object's data) are not exported #430

Closed
atteneder opened this issue Apr 13, 2019 · 4 comments
Closed
Labels
enhancement New feature or request exporter This involves or affects the export process Material

Comments

@atteneder
Copy link
Contributor

Describe the bug
In Blender's material tab you can choose wheter you link the material to the data (mesh) or the object.
The benefit (also for the glTF) is that you can instantiate the same mesh with different materials applied.

To Reproduce
Steps to reproduce the behavior:

  1. Extract the attached zip
  2. There are two blend files with 3 materials on 3 objects each. In omnicase_data.blend the objects have dedicated meshes and materials applied to the data. In omnicase_object.blend the objects share a mesh, but have different materials applied to the objects:

Screenshot 2019-04-13 at 19 26 14

  1. omnicase_data.blend exported as separate glTF looks like this:

Screenshot 2019-04-13 at 19 24 53

  1. omnicase_object.blend exported as separate glTF looks like this:

Screenshot 2019-04-13 at 19 24 39

Clearly just the material from the meshes is exported

Expected behavior
All materials applied to objects are exported accordingly. The mesh itself is re-used and not duplicated in data.

.blend file/ .gltf
obj_materials.zip

Version

  • OS: macOS
  • Blender Version 2.80 beta

Additional context
I reported this one in the legacy exporter, where it was partially solved (meshes were still duplicated):
KhronosGroup/glTF-Blender-Exporter#186

@julienduroure julienduroure added enhancement New feature or request exporter This involves or affects the export process labels Apr 14, 2019
@jamespedid
Copy link

This would be a great enhancement for my use case :)

@emackey
Copy link
Member

emackey commented Aug 19, 2019

I think this issue was fixed in #526, and we forgot to close this issue.

@jamespedid Are you seeing this behavior in the 2.80 release? Or did you just find this in a search? I can't reproduce it from the test model linked above, and I think it's fixed.

@emackey emackey closed this as completed Aug 19, 2019
@jamespedid
Copy link

I think I might have different ideas or expectations and the issue might be slightly different.

For me, I want to create a single model and attach 5 textures to it. I want to export the model with a default texture chosen, but also with the other textures with the intention to change the model to a different texture at a later point in time.

I'm also very new to this technology, so there might be reasons to not do this.

@emackey
Copy link
Member

emackey commented Aug 20, 2019

That's an interesting use. Certainly there's been glTF spec talk of materials being swapped like this, see the thread on asset variants here: KhronosGroup/glTF#1569

Nothing like this exists in the Blender exporter as yet. I think you have to use each material that you want exported to the model, but you might be able to use it with object linking as described above. Still there's no way, yet, for the glTF to specify that the app must choose a material, at least until some asset variant mechanism is specified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request exporter This involves or affects the export process Material
Projects
None yet
Development

No branches or pull requests

4 participants