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

Started by
3 comments, last by Yxjmir 6 years, 5 months ago

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.

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.

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. 

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)

This topic is closed to new replies.

Advertisement