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

Merge animations before writing to JSON. #102

Merged
merged 2 commits into from
Dec 11, 2017
Merged

Merge animations before writing to JSON. #102

merged 2 commits into from
Dec 11, 2017

Conversation

donmccurdy
Copy link
Contributor

Fixes #66.

Related:

Disclaimer: I have no idea how memory management works in C++. Do i need to deallocate the old
animations somehow? 😅

Copy link

@najadojo najadojo left a 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.

// 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) {

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) {

@pjcozzi
Copy link
Member

pjcozzi commented Dec 10, 2017

@lasalvavida are you able to take a quick look at this?

@lasalvavida
Copy link
Contributor

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 GLTF submodule of this project in other applications it will become a higher priority.

@donmccurdy
Copy link
Contributor Author

Thanks @lasalvavida! Is there any scripting to do bulk updates like KhronosGroup/glTF-Sample-Models#76, or would I do that manually?

@lasalvavida
Copy link
Contributor

@donmccurdy, check out the tools branch.

It was never added to master, but I did write a python script for autogenerating the models.

@donmccurdy
Copy link
Contributor Author

Ok, perfect! 🙂

GLTF::Animation* mergedAnimation = new GLTF::Animation();

// Merge all animations. In the future, animations should be grouped
// according to COLLADA <animation_clip/> nodes.
Copy link
Member

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made one.

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

Successfully merging this pull request may close these issues.

5 participants