-
Notifications
You must be signed in to change notification settings - Fork 60
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
TinyGltfImporter: Import Weights and JointIds mesh attributes #84
Conversation
Signed-off-by: Squareys <[email protected]>
From gitter to archive here:
|
@@ -1171,6 +1171,41 @@ Containers::Optional<MeshData> TinyGltfImporter::doMesh(const UnsignedInt id, Un | |||
return Containers::NullOpt; | |||
} | |||
|
|||
/* Joint attribute ends with _0, _1 ... */ | |||
} else if(Utility::String::beginsWith(attribute.first, "JOINTS")) { |
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.
TODO for testing: the code relies on the attributes being sorted (so JOINTS_0 before JOINTS_1) and without gaps. I think sorting is ensured implicitly due to how JSON dict data is stored, but the gaps need to be checked.
if(!(accessor.componentType == TINYGLTF_COMPONENT_TYPE_UNSIGNED_BYTE) && | ||
!(accessor.componentType == TINYGLTF_COMPONENT_TYPE_UNSIGNED_SHORT)) { |
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.
if(!(accessor.componentType == TINYGLTF_COMPONENT_TYPE_UNSIGNED_BYTE) && | |
!(accessor.componentType == TINYGLTF_COMPONENT_TYPE_UNSIGNED_SHORT)) { | |
if(!(accessor.componentType == TINYGLTF_COMPONENT_TYPE_UNSIGNED_BYTE && !accessor.normalized) && | |
!(accessor.componentType == TINYGLTF_COMPONENT_TYPE_UNSIGNED_SHORT && !accessor.normalized)) { |
IDs can't be normalized. Also needs a test ;)
Signed-off-by: Squareys <[email protected]>
Huh, what's this, completely forgot this was even attempted in the old plugin 😆 Two complete plugin reimplementations later, this is done in |
Hi @mosra !
Building on top of mosra/magnum#441, here's the import of the new mesh attributes in TinyGltfImporter.
Best,
Jonathan
TODO
"skins"
?