• 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.

FSXA MDL file format issue

Roy Holmes

Resource contributor
Messages
1,805
Country
us-virginia
I'm having a problem with one simple 3D gauge whose needle does not move.

It happens to be the last animated item in the .mdl file and the content of that area of the file suggests to me that it is missing the XML code.

The preceeding three items have essentially the same layout and they include the XML code.

The first of the good three has the following mdl content starting at XANI
Code:
XANI  Fž'X"0RB®Í¾¡üÏ  ´CSim             AutoPlay XAPC.   (A:Turb eng corrected N1:1,percent) 10 % 36 * XANS       N     ´CXANK                     €?XANK     ´B    ÷5¿    ÷5?XANK     4C      €?        XANK     ‡C    ÷5?    ÷5?XANK     ´C              €?

I can see the XANI header and the XANS header for the XANK animation code as well as the XML code after XAPC

The modeldef code for this item is
Code:
<Animation name="needle_Small_RPM" guid="58279E46-3022-4252-AECD-BE08A11AFCCF" type="Sim" typeParam="AutoPlay" typeParam2="needle_Small_RPM" length="360"/>
	<PartInfo>
		<Name>needle_Small_RPM</Name>
		<AnimLength>360</AnimLength>
		<Animation>
			<Parameter>
				<Code>(A:Turb eng corrected N1:1,percent) 10 % 36 *</Code>
			</Parameter>
		</Animation>
	</PartInfo>

The last of the good three has the following mdl content starting at XANI
Code:
XANIÍ   ÿ»×%’EÝÀ`7Ú5•  ÈBSim             AutoPlay XAPC-      (L:needle_TGT, number)
         XANSc       P     ÈBXANK                     €?XANK     HB    г]?       ¿XANK     ÈB    г]?       ?

This is essentially identical in format to the first one and the modeldef code is:
Code:
<Animation name="needle_TGT" guid="11D7BBFF-9225-451c-81DD-C06037DA3595" type="Sim" typeParam="AutoPlay" typeParam2="needle_TGT" length="100"/>
	<PartInfo>
		<Name>needle_TGT</Name>
		<AnimLength>100</AnimLength>
		<Animation>
			<Parameter>
				<Code>
          (L:needle_TGT, number)
        </Code>
			</Parameter>
		</Animation>
	</PartInfo>

The one that does not work does not have a XAPC section after Autoplay, it jumps to XANS.

Code:
XANIï   Fž'X"1RB®Í¾¡üÏ  ðBSim             AutoPlay XANSº       Q     ðBXANK                     €?XANK     ðA    г]?       ¿XANK     pB    г]?       ?XANK     *B    
óF?    !?XANK     ÈB    9B&?    ø©B?XANK     ðB       ?    г]?

I searched modeldef for any other instance of "Autoplay XANS" and there was none.

The XML code for this item is:
Code:
<Animation name="needle_fuelFlow" guid="58279E46-3122-4252-AECD-BE08A11AFCCF" type="Sim" typeParam="AutoPlay" typeParam2="needle_FuelFlow" length="120"/>
	<PartInfo>
		<Name>needle_fuelFlow</Name>
		<AnimLength>120</AnimLength>
		<Animation>
			<Parameter>
				<Code>(A:TURB ENG FUEL FLOW PPH:1,Pounds per hour) 100 /</Code>
			</Parameter>
		</Animation>
	</PartInfo>

The .xanim blocks for the last two are:
Code:
<Anim name="needle_TGT" guid="11D7BBFF-9225-451c-81DD-C06037DA3595" length="100.000000"
	type="Sim" typeParam="AutoPlay" typeParam2="needle_TGT">
	<AnimStream name="Rotation" id="0" partName="needle_TGT" length="100.000000">
		<Keyframe time="0.000000" type="Quaternion" data="0.000000;0.000000;0.000000;1.000000"/>
		<Keyframe time="50.000000" type="Quaternion" data="0.000000;0.866025;0.000000;-0.500000"/>
		<Keyframe time="100.000000" type="Quaternion" data="0.000000;0.866025;0.000000;0.500000"/>
	</AnimStream>
</Anim>	// End anim block
<Anim name="needle_fuelFlow" guid="58279E46-3122-4252-AECD-BE08A11AFCCF" length="120.000000"
	type="Sim" typeParam="AutoPlay" typeParam2="needle_FuelFlow">
	<AnimStream name="Rotation" id="0" partName="needle_fuelFlow" length="120.000000">
		<Keyframe time="0.000000" type="Quaternion" data="0.000000;0.000000;0.000000;1.000000"/>
		<Keyframe time="30.000000" type="Quaternion" data="0.000000;0.866025;0.000000;-0.500000"/>
		<Keyframe time="60.000000" type="Quaternion" data="0.000000;0.866025;0.000000;0.500000"/>
		<Keyframe time="80.000000" type="Quaternion" data="0.000000;0.777146;0.000000;0.629320"/>
		<Keyframe time="100.000000" type="Quaternion" data="0.000000;0.649448;0.000000;0.760406"/>
		<Keyframe time="120.000000" type="Quaternion" data="0.000000;0.500000;0.000000;0.866025"/>
	</AnimStream>
</Anim>	// End anim block


The mdl file format wiki does not mention XAPC and I wonder if anyone has seen this issue before.

So far as I can see the reason why the fuel flow needle does not move is the lack off Autoplay XAPC and the XML code in the .mdl file.

Roy
 
If I open the interior .mdl file with ModelConverterX, the fuel flow gauge is animated. So the animation works, but does not in FS because it has no code commands.

All very strange
Roy
 
Last edited:
Roy,

Sometimes the smallest flaw in the code will 'get through' the compiler, but doesnt work, even though its animated, meaning the code could be malfunctioning.

Also, I just remembered, try clearing the animation, then setting in your 'frames' (like zero to 100, etc), and reset the animation. This has happened many times to me, the animation will not keep the frames settings.

If you reset, and it still doesnt work, try giving it the same animation as a 'working' needle and see if that code works on this needle also. If it does, then you know the needle is fine and the code isnt working.

Try rewriting the code again from scratch if you find it 'is' the code.


Bill
 
Bill,
Thanks for your clear input.

The problem was that XtoMdl was not picking up the code and not creating a XAPC section in the .mdl file.

I tried changing the animation name to see if that made any difference. As given in my post I had used
Code:
<Animation name="needle_fuelFlow" guid="58279E46-3122-4252-AECD-BE08A11AFCCF" type="Sim" typeParam="AutoPlay" typeParam2="needle_FuelFlow" length="120"/>

Note, there is a difference in the spelling of the animation name and the typeParam2 name. Although the SDK states that typeParam2 is only necessary for backward compatibility issues, it does say that it should be a repeat of the animation name.

So I made them both "needle_fuelFlow. No change.

Eventually after a lot of head banging I made them both "needle_fuel_flow", no upper case.

The resulting mdl file had the XAPC section for this part and works like it should.

It still has me confused because I have a number of custom modeldef entries with upper case letters in their names which work fine.

I know XtoMdl looks for upper case letters in things like "PartInfo" and maybe it does that for part names also.

However to be on the safe side, I'll only use lower case part names from now on.

With that out of the way I have to deal with an autopilot knob that does have a XAPC section, working mouse rectangle which adjusts bank angle in flight, but the knob itself does not move. The value of its code changes as it should, but the rascal just stays put.

Again, thanks for the inputs


Roy
 
If one on of the two are different with a single capital, it will not work. If the top had a capital, that will kill it.

Crazy important.

Glad you found it. One of the things I do now when I have spent a rediculous amount of time on one is to just rewrite it. Usually that will fix it.



Bill
 
Back
Top