Syerjchep

Is there a way to get time marker data from Assimp's animations?

Recommended Posts

Pretty straight forward question. I'm using the asset importer library to help me import collada files exported from blender (using an improved exporter add-on). These models have animations. I've written code that's able to use assimp to load these files and animate them reasonably well. The only problem is I have time markers in my models that will say, mark frame 17/250 as "reload:start" and frame 29/250 as "reload:end" and in order to know which frames to play to "reload" I need to be able to access this data in my program. Yet none of the documentation on assimp seems to hint at where this data is loaded to if at all.

Edited by Syerjchep

Share this post


Link to post
Share on other sites

Assimp's documentation states:

"An aiAnimation has a duration. The duration as well as all time stamps are given in ticks. To get the correct timing, all time stamp thus have to be divided by aiAnimation::mTicksPerSecond. Beware, though, that certain combinations of file format and exporter don't always store this information in the exported file. In this case, mTicksPerSecond is set to 0 to indicate the lack of knowledge."

So first check if mTicksPerSecond is 0. The data should be in aiAnimation. I haven't used Assimp in a long time, though.

Share this post


Link to post
Share on other sites
On 10/19/2017 at 5:29 PM, Yxjmir said:

Assimp's documentation states:

"An aiAnimation has a duration. The duration as well as all time stamps are given in ticks. To get the correct timing, all time stamp thus have to be divided by aiAnimation::mTicksPerSecond. Beware, though, that certain combinations of file format and exporter don't always store this information in the exported file. In this case, mTicksPerSecond is set to 0 to indicate the lack of knowledge."

So first check if mTicksPerSecond is 0. The data should be in aiAnimation. I haven't used Assimp in a long time, though.

Hey there, I just realized you also responded to the last topic I made in september about glew.h not compiling. That's funny. Anyway, just like there I manged to find a work around. In this case I just have anyone who supplies a model specify the start and end frames for each animation manually. Only issue is I can't find a way to play multiple animations simultaneously. 

Share this post


Link to post
Share on other sites

I don't know much about animation right now, but you can multiply the transforms for each bone and that will blend the animations with the other. I'm not sure how to do this in Assimp. Have you tried just playing the animations one after the other? If so, what was the effect? (Did it just play the first one, or the last one, or was there some other result)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now