Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [Bug 2.015d] collada import (animation)

Author
Message
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 10th Dec 2015 09:47 Edited at: 10th Dec 2015 13:42
Hi

I think the collada format doesn't work properly with animation.
It's ok without animation (for files exported from blender).

All the files I have tried doesn't work when I tried to use animation (bones).
I have only the model (not animated).

Why is collada important ?
Because the size of a .dae file is < at the size of a .x file

Exemple (the same export, from blender) :
- animation.dae -> 12ko
- animation.x -> 30ko
So we can have almost 3X + of animation in .dae than in .x , 3X more ennemies for example ^^.

My test file (very simple animation (3bones, 20 frames), very simple mesh (18 faces)) :
- animation.x (30ko) : ok in AGK2 (model+animation) http://www.dracaena-studio.com/images/games/dev/bug/animation.x
- animation.dae (12ko) : mesh ok, animation not ok in AGK2 http://www.dracaena-studio.com/images/games/dev/bug/animation.dae

The original blend file (made with blender 2.76) : http://www.dracaena-studio.com/images/games/dev/bug/animation_test.blend


I hope this can help to fixe this issue .
Thanks


EDIT : I have add the link I have forgotten ^^
AGK2 tier1 - http://www.dracaena-studio.com
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 10th Dec 2015 13:30
Would you mind attaching that animation.x file? I have not been able to load any .x file from Blender successfully, and I'm wondering if it's my computer that's the problem.
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 10th Dec 2015 13:43
I have add the link for the blend file (.blend), the .x and the .dae
AGK2 tier1 - http://www.dracaena-studio.com
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 12th Dec 2015 01:33
I tried the animation.dae file and it animated here, the rectangle bent backwards and forwards. How are you playing the animation? I used this
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 12th Dec 2015 03:41
Both the .x and the .dae files load and play just fine for me.
Blendman
10
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 12th Dec 2015 08:49 Edited at: 12th Dec 2015 14:16
Hi Paul

Sorry, it's my fault, I have though the starttime and endtime (PlayObjectAnimation( objID, animName, starttime, endtime, loop, tweentime ) ) was in frame, not in second.
IT work fine with your code, or if I use seconds.

I have tried with :

So it didn't work with that code, because, it start at the end of the animation.
I always work in frame not in second, when I create my animation, I have to change my workflow ^^.

So we have to convert the frame into second, I guess.
If I have a character with 3 animation, with 60 frames :
- 0-20 : walk
- 21-40 : attack
- 41-60 : die

I have to use (for 60 frames)


Sorry for the false report.

PS :
It's strange, because with a .x file, my previous code works (PlayObjectAnimation( 1, "", 1, 20, 1, 0 ))
AGK2 tier1 - http://www.dracaena-studio.com
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 12th Dec 2015 14:24
Paul, can you clarify this? Although some of the commands mention using seconds as animation references, it seems like they really should be using frames.

I believe the animation commands actually do use frames as parameters, but the help files say they call for seconds. Is that right?

Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 12th Dec 2015 17:14
It is all using times, I considered using frames but ran into a problem with the way the Asset Import Library loads animations. It has the possibility that frame 1 of the position data could have different time stamp from frame 1 of the rotation data, for example if the position is constantly changing whilst the rotation is doing a smooth interpolation from frame 0 to frame 1 over a longer period of time. So timing is the only way to guarantee consistency.
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 12th Dec 2015 19:45
Quote: "It is all using times,"


That seems really foreign to me. The time an animation runs depends on the speed of playback vs the number of frames.

AGK2 appears to play animations at 1 frame per second, which is so slow that some animations may not seem to be moving at all, but they are just moving really slowly.

When I create a 60 frame 30 fps animation in Blender, then export the object to .x, load it into AGK2, it plays MUCH more slowly than it did in Blender. In fact, it takes 2 seconds to complete, 1 frame per second.
If I set the play speed to 30, a 60 frame animation takes 2 seconds to play.

Aha! So, when the animation speed in AGK2 is set to the same fps as the animation created in Blender (usually 24 or 30 fps), all is well, and the "time" value for picking each animation out of a group can be thought of as "frames" instead of "time."
Thus, instead of doing calculations inside the PlayObjectAnimation() command, we can just set the speed once, then treat the time parameters as frames. Does that sound right?

Also, GetObjectAnimationDuration() shows as a valid command, but returns no value, and has no entry in the help file. This command is to be added later?
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 13th Dec 2015 01:25
Quote: "when the animation speed in AGK2 is set to the same fps as the animation created in Blender (usually 24 or 30 fps), all is well, and the "time" value for picking each animation out of a group can be thought of as "frames" instead of "time.""

If the modelling program outputs one frame as one second then that works. It depends how the animation is exported. Unfortunately I'm not that familiar with modelling programs.

Quote: "Also, GetObjectAnimationDuration() shows as a valid command, but returns no value, and has no entry in the help file. This command is to be added later?"

It works here, you have to know the name of the animation stored in the file, or use GetObjectAnimationName to find out. It looks like I forgot to add a help file for it though, I'll get that fixed.

Login to post a reply

Server time is: 2024-09-29 07:30:43
Your offset time is: 2024-09-29 07:30:43