-
-
Notifications
You must be signed in to change notification settings - Fork 303
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
glTF 2.0 importer #70
glTF 2.0 importer #70
Conversation
This is a reply to #67 (comment).
In glTF each skin lists the nodes it considers its joints. The skeleton is only implicitly specified. The nodes themselves only represent transforms.
Yes, tinygltf handles the data type conversions.
Should be fixed now.
I will look into the cmake scripts and the CI build next.
I haven't really considered other options. It seems very well maintained and is used by several high profile projects.
As of glTF 2.0 only Let me know if you have more feedback, I'll try to finish whatever is left to do quickly so we can get this merged. |
127ba17
to
1888f82
Compare
Thanks Alexander for the hard work and all the answers. I didn't managed to look at the code yet but you answered most of the questions. I'll need more time to be able to get into the code, I'll get back to you then. Some next steps I can think of:
One last thing: Are the gltf data you added compatible with MIT license? Can they be redistributed? Thanks again, |
No hurry. I might do some more improvements in the meantime.
Sounds good, I'll look into that soon.
glTF meshes are trivial to import as they are basically OpenGL vertex and index buffers, I'm not sure if there's a need for such functionality in Ozz.
The models are my own, I release them into the public domain. Thanks for the quick response, I look forward to more feedback on the code. |
Sorry it's taking me a long time to get the next release out. But this is not forgotten no worries! Have you checked this resources: https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0 ? I thought that could be great to use some for unit testing. What do you think? Talk soon, Guillaume |
Hi Alexander, I created a gltf branch and integrated your PR. Thanks again for the hard work. Here's a list of some of the changes I made:
At the moment the skeleton to import is taken from the root of the skin. I'm wondering if there's a way to import skeleton without skins, like ozz fbx importer is working (using node types). This allows to animate anything (like http://guillaumeblanc.github.io/ozz-animation/samples/baked/), share a skeleton for many skins, ... This is quite usual in production afaik. The next important step is to add unit tests, for all failing and succeeding cases. I'd recommend to use resources from https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0 to have a good gltf spec coverage. Any progress or new thing on your side? Cheers, |
commenting because this would be super useful as well. |
Hi, any feedback about gltf branch status ? It loads your gltf asset according to my tests, and has fixes for a few issues with node naming and spline sampling for example. Can you see a way to implement node filtering, as needed for skeleton import ? Looking forward to hearing from you. Guillaume |
my fork has some commits in it that fix some issues I had with the gltf branch. https://github.com/pgruenbacher/ozz-animation/commits/master |
@guillaumeblanc I also noticed that gltf2ozz pads the joints with no animation channel with bind pose transforms... which is fine... but it makes me wonder if it's a flaw that ozz animation file format doesn't allow for empty joint tracks. Likewise wouldn't it make sense for empty joint tracks to allow for automatic partial blending. I.e. if I export upper body animation and lower body animation and then run a blend job with the two, i'd expect them to animate properly without having to manually set the joint weights explicitly... however currently the animations blend improperly e.g. lower body animation only animates partially since its blending the lower joints with the bind pose transforms of the upper body animation. |
i.e. I'd have expected to export only affected tracks, and then the sampler job would have a bind pose option when sampling the tracks to write out the bind pose for joints with no assigned tracks. Or maybe just write out the bind pose to the local transforms as default before sampling. |
Empty animation tracks are actually considered as default tracks during sampling: zero for translation, identity quaternion for rotations, one for scales. If the skeleton was provided to the sampling job, it could get bind pose from there indeed (#78).
I'm sure you saw partial blending sample, which allows to do what you're describing. Thanks for the feeback. |
Hi @AlexanderDzhoganov, any feedback about current branch status and remaning questions? Did you managed to try it? Cheers, |
I'm planning to bring that branch to develop. Guillaume |
This is a follow-up to #67. Previous discussion can be found there.
This PR implements a mostly spec compliant importer from glTF 2.0 to Ozz. It subclasses OzzImporter and can be used in the same way as the FBX one. It depends on tinygltf for parsing.
Changes since last time:
develop
branch.ozz_build_gltf
CMake option. It requiresozz_build_cpp11
to beON
.media/gltf
to test out different parts of the importer (e.g. cubic spline interpolation).auto
for basic types.include/
.