-
Notifications
You must be signed in to change notification settings - Fork 158
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
Merge animations before writing to JSON. #102
Merge animations before writing to JSON. #102
Conversation
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.
I was going to leave a comment about how to handle the memory management but it seems this tool doesn't care it leaks memory everywhere. Since its a command line/single block tool it really doesn't matter much as all the memory will be reclaimed by the OS when the process finishes.
GLTF/src/GLTFAsset.cpp
Outdated
// according to COLLADA <animation_clip/> nodes. | ||
for (size_t i = 0; i < animations.size(); i++) { | ||
GLTF::Animation* animation = animations[i]; | ||
for (GLTF::Animation::Channel* channel : animation->channels) { |
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.
I see this pattern in this file already:
for (GLTF::Animation* animation : animations) {
for (GLTF::Animation::Channel* channel : animation->channels) {
@lasalvavida are you able to take a quick look at this? |
This looks good to me, thanks @donmccurdy! And yeah, don't worry about memory. It's on the roadmap (see #70), but not super high priority since as far as I know people just use this as a command-line tool. If there is interest in using the |
Thanks @lasalvavida! Is there any scripting to do bulk updates like KhronosGroup/glTF-Sample-Models#76, or would I do that manually? |
@donmccurdy, check out the tools branch. It was never added to master, but I did write a python script for autogenerating the models. |
Ok, perfect! 🙂 |
GLTF::Animation* mergedAnimation = new GLTF::Animation(); | ||
|
||
// Merge all animations. In the future, animations should be grouped | ||
// according to COLLADA <animation_clip/> nodes. |
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.
Did a new issue get opened to track this?
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.
I made one.
Fixes #66.
Related:
Disclaimer: I have no idea how memory management works in C++. Do i need to deallocate the old
animations somehow? 😅