Reversing Animations

#1
Hello all, looking for a little help to save my desk from further head-related damage.

I'm attempting to convert an older flyable model into an AI model (for personal use, of course - trying to get our museum's soon-to-be-flying Stinson OY-1 flying in my sim).

I have everything else fixed, except for the flaps. On this model, they animate from full downward deflection at keyframe 0, to full upward (i.e. angled up above the wing chord line, about 30 degrees) at keyframe 100. So not only are they swinging too far, but they're animating in the wrong direction.

They do not seem to respond to any changes in the "Scale" variable in the modeldef.xml, and reading through some older posts on here it seems that there are some animations that are one-way only and cannot be changed. However, given how quickly things develop with MCX and the modeling community, I was hoping that perhaps this has changed in the three or four years since those posts.

So, is there any (fairly simple) way I can get the animations to play in reverse - e.g. from frame 100 to frame 0? Or any simple way to flip the keyframes? If so, I can eliminate the upward deflection using a simple "Bias" variable.

Thanks for any help that's provided!
 

=rk=

Resource contributor
#2
You could isolate and export the part and create a new animation sequence using FSDS and then join that new animated part to the original model.
 
#3
With things like this in the past I've added a new entry into the modeldef.xml to reverse the animation, then applied that with the animation manager in MCX.
It will still look backwards in MCX but should animate correctly in the sim.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#4
I guess I would try to tweak the xanim file manually. You should be able to reverse them there. It can't be done in MCX at the moment.
 
#5
With things like this in the past I've added a new entry into the modeldef.xml to reverse the animation, then applied that with the animation manager in MCX.
It will still look backwards in MCX but should animate correctly in the sim.
Yeah, that's what I was trying to do too - and did successfully for an aileron that was also not animated in the right direction. But as noted, this part ignores any changes to the "Scale" variable. Unless there's another way to reverse it in modeldef that I haven't found out about yet...?

I guess I would try to tweak the xanim file manually. You should be able to reverse them there. It can't be done in MCX at the moment.
Looks like I get to learn something new today! Thanks for giving me a direction to look in, hadn't gotten deep enough into this to know that was an option.
 
#6
Have you tried

<Scale>-1.0</Scale>

May need a <Bias> entry as well.
?

Have a look at the "lever_flap_reversed" part in the default modeldef.
 
#7
Have you tried

<Scale>-1.0</Scale>

May need a <Bias> entry as well.
?

Have a look at the "lever_flap_reversed" part in the default modeldef.
Tried that, didn't have any luck. It honestly looked like it should have worked.

That said, in 15 minutes, I took Arno's suggestion, exported the model as an X, figured out what I was looking at, and fixed the flaps. I also fixed the aileron animation so that I didn't have to use a custom animation in modeldef, which seems like a good thing.

Thanks, everyone, for the suggestions and opening me up to a new tool in the toolbox.
 
#8
Could you explain what you did in order to fix that issue ? I have the exact same issue with the flaps when converting a FS9 AI aircraft for Prepar3d v4
I had in mind to export the model along with the animations to see what is wrong with the flaps but I am not familiar enough yet with this new MCX feature

thanks in advance
 
#9
Export Object, change "Save as type" to "FSX object X file (*.X)", name as required. You should get two files, <filename>.x and <filename>.xanim. Open the .xanim file in the text editor of your choosing (I use Wordpad) and find the section you're animating (look for the animation type you previously assigned). You'll see the Anim tag, the AnimStream subtag, and then a number (usually five) Keyframe tags with time values of 0.0 to 100.0 (or 200.0 for some animations).

The simple way to reverse the animation is to cut-and-paste the lines to re-order them, now going largest to smallest. Then renumber them in the original order.

For example, on a 100-frame animation with five keyframe points - 0, 25, 50, 75, 100 - you'd cut-and-paste to order them 100, 75, 50, 25, 0. Then you'd change the time entries back to 0, 25, 50, 75, 100. Hope that's clear.

However, I may have run into a possible bug that I'll put in a separate thread.
 
Top