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

gltfpack: mesh.primitives merged unexpectly #470

Closed
scarletsky opened this issue Aug 23, 2022 · 3 comments
Closed

gltfpack: mesh.primitives merged unexpectly #470

scarletsky opened this issue Aug 23, 2022 · 3 comments

Comments

@scarletsky
Copy link

I am using this build of gltfpack.

The origin model is here monkey.glb.zip

image

No matter what flags (-kn -km -ke -vpf -noq) I pass, gltfpack will merge the primitives unexpectly.

image

@scarletsky scarletsky added the bug label Aug 23, 2022
@zeux
Copy link
Owner

zeux commented Aug 23, 2022

This is by design - the point of gltfpack is that it reorganizes and reprocesses the scene to make it more efficient. The options you quoted affect various aspects of transformations that have an impact on application access - eg without kn, an application that uses named node access may not get access to the node or meshes attached to it. However, primitives are an internal detail of glTF file encoding and as such they don't get a special option to block merging.

@scarletsky
Copy link
Author

The original glb above is output by my own gltf exporter, it omitted all materials fields.

And I've output another glb by blender. At this time the mesh.primitives had material field:
image

I use the same gltfpack -kn -km -ke -vpf command, and the mesh.primitives are not merged.
image

So if I want to keep the original primitives, I need to assign different material to them, right ?

@zeux
Copy link
Owner

zeux commented Aug 24, 2022

Yes, if two primitives have different materials, gltfpack won't merge them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants