• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSX:SE Animation working in MCX but not in FSX?

Messages
45
Country
australia
Hi all,

I've been working on adding animations to the fsx default 747-400 VC model. I do this by adding code straight into the .x and .xanim files (I don't use any 3D software. I'm a sucker for punishment).

I frequently backup 'versions' of my .x and .xanim files when I work on a project, just in case I break something.

I have added many animations (approx. 50), mostly animating the switches on the overhead panel. In my latest 'version', the autopilot disengage bar is no longer animating correctly in FSX (all others have compiled correctly). It was working correctly in a previous version. I haven't made any changes to it.

When I review the compiled model in MCX, the animation is working correctly? How can this be?

When I revert to a previous back up, the compile works fine and the autopilot disengage bar is animating correctly within FSX. But I haven't changed anything in relation to the code of that part?

I've spent some time tonight searching the forums for anything related to this problem without any lot of luck. I'm hoping one of you has run into something similar in the past and can point me in the right direction...

Code below in case anyone is interested.

From the modeldef.xml:

<Animation name="747_Part78" guid="ee48d4f3-3bf7-47be-b990-e893bffd4c4c" length="50" type="Sim" typeParam2="747_Part78" typeParam="AutoPlay" />

<PartInfo>
<Name>747_Part78</Name>
<AnimLength>50</AnimLength>
<Animation>
<Parameter>
<Code>
(L:Autopilot Block, bool) 50 *
</Code>
<Lag>400</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<TooltipText>Disengage Autopilot and Autothrottle</TooltipText>
<HelpID>HELPID_DISPLAY_UNIT_SELECTOR</HelpID>
<MouseFlags>LeftSingle</MouseFlags>
<CallbackCode>
(M:Event) 'LeftSingle' scmp 0 == if{ (L:Autopilot Block, bool) 0 == if{ 1 (&gt;L:Autopilot Block, bool)
(&gt;K:AUTOPILOT_OFF)
(A:Autopilot throttle arm,bool)
if{ (&gt;K:AUTO_THROTTLE_ARM) } }
els{ 0 (&gt;L:Autopilot Block, bool) } } }
</CallbackCode>
</MouseRect>
</PartInfo>

From the .xanim file:

<Anim name="747_Part78" guid="ee48d4f3-3bf7-47be-b990-e893bffd4c4c" length="50.000" type="Sim" typeParam="AutoPlay" typeParam2="747_Part78">
<AnimStream name="Position" id="2" partName="node5_78" length="50.000">
<Keyframe time="0.000" type="Vector" data="0.000000;0.000000;0.000000;0.000000"/>
<Keyframe time="50.000" type="Vector" data="0.000000;0.000000;-0.009769;0.000000"/>
</AnimStream>
<AnimStream name="Rotation" id="0" partName="node5_78" length="50.000">
<Keyframe time="0.000" type="Quaternion" data="0;0;0;1"/>
<Keyframe time="50.000" type="Quaternion" data="0;0;0;1"/>
</AnimStream>
</Anim>

From the .x file:

AnimLinkName {
"node5_78";
}
 
Hi,

It's hard to help you with this one. But if it worked before and now it doesn't, while you haven't changed the X file code for that animation, it might be your modeldef.xml has been modified for the definition of this specific animation.
 
Hi all,

Acting on a hunch that I might've corrupted the .xanim file somehow, I reverted to my earlier .xanim backup (thank goodness for backups, always a good idea!).

I began to add in my changes one at a time, compiling the interior model and testing within FSX to ensure the autopilot disengage bar remained animated and quickly arrived at the offending component.

When the below animation entry exists in the .xanim file, the autopilot disengage bar ceases to animate within FSX. All other animations work fine, including the new logo light switch.

When I take this animation entry out of the .xanim file, the autopilot disengage bar animates just fine within FSX.

So, I'm glad to have identified the culprit. However, I'm still no closer to understanding why! Don't forget that within MCX, the animation works just fine with the offending animation entry included or not. Any ideas anyone? I note that my .xanim file is at about 100kb. I don't imagine there is a file size restriction on the .xanim file when compiling is there?

The problem .xanim entry code is provided below, along with the associated modeldef.xml entry, however it's the standard modeldef entry for the logo light switch. I didn't create that.

Appreciate any insight that anyone might have.

Trent

<Anim name="switch_logo_light" guid="921BD320-BB39-437d-A835-FE3AB399ED26" length="100.000" type="Sim" typeParam="AutoPlay" typeParam2="switch_logo_light">
<AnimStream name="Position" id="2" partName="node_logo_light" length="50.000">
<Keyframe time="0.000" type="Vector" data="0.000000;0.000000;0.000000;0.000000"/>
<Keyframe time="50.000" type="Vector" data="0.000000;0.000000;0.000000;0.000000"/>
</AnimStream>
<AnimStream name="Rotation" id="0" partName="node_logo_light" length="50.000">
<Keyframe time="0.000" type="Quaternion" data="0;0;0;1"/>
<Keyframe time="50.000" type="Quaternion" data="-0.5;0;0;0.866025"/>
</AnimStream>
</Anim>

<PartInfo>
<Name>switch_logo_light</Name>
<AnimLength>50</AnimLength>
<Animation>
<Parameter>
<Code>
(A:Light Logo,bool) 50 *
</Code>
<Lag>400</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<HelpID>HELPID_GAUGE_LIGHT_SWITCH_LOGO</HelpID>
<EventID>TOGGLE_LOGO_LIGHTS</EventID>
</MouseRect>
</PartInfo>
 
One thing I notice is that the animation key length (50) and the length attribute in the animation definition (100) are different. Could that be part of the problem?
 
For those following this thread with any interest, I have an update.

Essentially, I think some form of voodoo or shamanism was at play in the .x file itself. I can't fully explain it, but the default 747 logo light switch seems to always have had problems and never worked right. Should you wish, load up the default 747 and play with the logo switch. You'll notice an active part, but no animation.

After reciting a number of incantations and annointing the .x file with some holy water I essentially moved the logo light switch part from one part of the .x file to another.

It now works as it should and without upsetting the autopilot disengage bar.

Does anyone have any insight as to how parts in one area of an .x file (when it has an attached animation) might interfere with the animation of parts in another? It's very very strange. In some ways it's fitting this would happen in an .x file...did you see what I did there?

Alright. Calling it a night. I expect I'll sleep much better than I have the last several nights! :)

Trent
 
Back
Top