-
Notifications
You must be signed in to change notification settings - Fork 495
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: Take account of primitive extras #802
Conversation
7159451
to
d92e18b
Compare
gltf/mesh.cpp
Outdated
@@ -238,6 +238,9 @@ static bool canMergeMeshes(const Mesh& lhs, const Mesh& rhs, const Settings& set | |||
if (lhs.streams.size() != rhs.streams.size()) | |||
return false; | |||
|
|||
if (lhs.extras.data && rhs.extras.data && strcmp(lhs.extras.data, rhs.extras.data)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comparison should only work if keep_extras is set. Also, this will not work if one of the mesh has empty extras. See material.cpp/areExtrasEqual for the correct way to implement this.
Also missing some support in deduplication, probably enough to disable deduplication by returning |
I take account of your comments but I also added :
|
… and the mesh name
68ac130
to
ca2e3c5
Compare
I'm not interested in merging mesh name preservation, as meshes are very ephemeral and they get reconstructed by many different optimizations in gltfpack. Scene extras are fine I guess. I don't see why they should be part of this PR, but it's just a couple of lines so maybe it's fine. |
Ok 👍 I removed the code related to saving mesh name. |
GLTF format allows extras in primitives, gltfpack ignore it and merge primitives even when extras are present and different.
Fix #808