Advertisement Jump to content
Syerjchep

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

This topic is 453 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!