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

Dummy/Placeholder animation tags?

Heretic

Resource contributor
Messages
6,830
Country
germany
When importing FS9 MDLs, animations containing custom code ("unknown" or "usrvar" - what's the difference, by the way?) or animation code that can not be found in the ModelDef will not be compiled into a FSX/P3D model upon exporting and will therefor be lost.

So what about an option for auto-generating empty animation tags (GUID, name, tags, animation length data, but no actual code for interacting with MSFS/P3D) during export to avoid losing those animations?
This will primarily enable the possibility to work on models across several sessions without having to tag all missing/custom animations one by one first.
 

=rk=

Resource contributor
Messages
4,450
Country
us-washington
To the computer, one animation tag is as good as any, including "usrvar." You'd have to come up with something a bit more definitive as to why usrvar is not appropriate. You could say, compare each item against a list of known acceptables and that will eliminate all undesirables, including custom tags. Also I don't think an empty tag will do at all. An animation is an array of quaternions and keyframes and the tag describes the schema, ambient or l_wing_flex. Some, not all, animations can have different tags. A r_tire_still can also be ambient, however it can never be lever_canopy_open. So, you will probably have to use a tag that the compiler recognizes and it will have to be otherwise unused.
While it does not seem impossible, it seems much more elegant to simply have your macros reassign tags from a known standard to another known standard and all the custom, usrvar tags are still going to have to kicked upstairs for human evaluation, so you that can interpret the intent of the original artist and possibly assign a new recognizable tag.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,859
Country
netherlands
Hi Bojrn,

usrvar is probably the name of an animation (it is the name of the variable for sure), so I suspect those should be exported. The unknown ones are indeed not exported to MDL because XtoMDL doesn't know about them (they are put in the X file, but the compiler skips them).

Before I have considered to make them all ambient by default, but that is also not always what you want. I could consider to add an empty placeholder until I can convert the content as well.
 

Heretic

Resource contributor
Messages
6,830
Country
germany
To the computer, one animation tag is as good as any, including "usrvar." You'd have to come up with something a bit more definitive as to why usrvar is not appropriate. You could say, compare each item against a list of known acceptables and that will eliminate all undesirables, including custom tags. Also I don't think an empty tag will do at all. An animation is an array of quaternions and keyframes and the tag describes the schema, ambient or l_wing_flex. Some, not all, animations can have different tags. A r_tire_still can also be ambient, however it can never be lever_canopy_open. So, you will probably have to use a tag that the compiler recognizes and it will have to be otherwise unused.
While it does not seem impossible, it seems much more elegant to simply have your macros reassign tags from a known standard to another known standard and all the custom, usrvar tags are still going to have to kicked upstairs for human evaluation, so you that can interpret the intent of the original artist and possibly assign a new recognizable tag.

You've misunderstood me. My point is not to have MCX guess the artist's intent (that's our job after all) but simply avoid losing any unassignable animations during export.
Hence the "optional feature" and the indiscriminate tagging using empty, autogenerated animation tags.
And it's really only intended as a simple way of producing incremental edits of model files. Sometimes, you just can't tag all unknown or missing animations during one session.



usrvar is probably the name of an animation (it is the name of the variable for sure), so I suspect those should be exported. The unknown ones are indeed not exported to MDL because XtoMDL doesn't know about them (they are put in the X file, but the compiler skips them).

Before I have considered to make them all ambient by default, but that is also not always what you want. I could consider to add an empty placeholder until I can convert the content as well.

Usrvar animations aren't exported, unless you've implemented it at one point and I've missed it.

An empty placeholder is all that's needed.
A full blown conversion of custom tags in FS9 models is of course the ultimate feature, but I understand that it's not easy to implement.


By the way:
Is there any way to collect custom XML code from FS9 models besides copying the data from MCX' event log window and pasting it into a text file?
 
Messages
141
Country
netherlands
Is there any way to collect custom XML code from FS9 models besides copying the data from MCX' event log window and pasting it into a text file?

If you open the FS9 model in Notepad++, you will find the XML code in text format near the top of the file. I found that 90% can be copy-pasted without corrections, some tags need a bit of editing. The only caviat is that you cannot tell straight away which piece of code belongs to which model part.
 

Heretic

Resource contributor
Messages
6,830
Country
germany
Is there any way to collect custom XML code from FS9 models besides copying the data from MCX' event log window and pasting it into a text file?

If you open the FS9 model in Notepad++, you will find the XML code in text format near the top of the file. I found that 90% can be copy-pasted without corrections, some tags need a bit of editing. The only caviat is that you cannot tell straight away which piece of code belongs to which model part.

You're right, pieces of XML code are indeed contained near the header of the MDL file. But Notepad, Notepad2 and Notepad++ all add tons of placeholder characters and therefor completely mess up the tags, requiring much more post-processing than extraction via MCX.

E.g:
This is what I get in Notepad++:
Code:
#1#0#300               ´      EöËÏo lE¨l®ÅDÉ    (A:GENERAL ENG THROTTLE     LEVER POSITION:2, part)     s0 0 >= if{ l0 -50 * 50     + } els{ l0 (A:THROTTLE     LOWER LIMIT, part) / 1 +     50 * }                    ¸      EöËÏo lE¨l®ÅDÉ    (A:GENERAL ENG THROTTLE     LEVER POSITION:3, part)     s0 0 >= if{ l0 -50 * 50     + } els{ l0 (A:THROTTLE     LOWER LIMIT, part) / 1 +     50 * }                    ¼      EöËÏo lE¨l®ÅDÉ    (A:GENERAL ENG THROTTLE     LEVER POSITION:4, part)     s0 0 >= if{ l0 -50 * 50     + } els{ l0 (A:THROTTLE     LOWER LIMIT, part) / 1 +     50 * }                    À      Hò0<®CƒúÍ)÷ª>    GENERAL ENG PROPELLER LE    VER POSITION:1#percent#-    1#100                      Ä      EöËÏo lE¨l®ÅDÉ    (L:EmergencyThrottleInUs    e, bool) 1 !=     if{ (A    :GENERAL ENG THROTTLE LE    VER POSITION:1, part) s0     0 >=       if{ l0 -50 *     50 + }       els{ l0 (A    :THROTTLE LOWER LIMIT, p    art) / 1 + 50 * }           d (>L:Engine1ThrottlePos    ition, percent)       }

Versus what I get in MCX:
Code:
14:33    MDL9Reader    Warning        Failed to find animation name for parameters (A:GENERAL ENG THROTTLE LEVER POSITION:2, part) s0 0 >= if{ l0 -50 * 50 + } els{ l0 (A:THROTTLE LOWER LIMIT, part) / 1 + 50 * }
14:33    MDL9Reader    Warning        Failed to find animation name for parameters (A:GENERAL ENG THROTTLE LEVER POSITION:3, part) s0 0 >= if{ l0 -50 * 50 + } els{ l0 (A:THROTTLE LOWER LIMIT, part) / 1 + 50 * }
14:33    MDL9Reader    Warning        Failed to find animation name for parameters (A:GENERAL ENG THROTTLE LEVER POSITION:4, part) s0 0 >= if{ l0 -50 * 50 + } els{ l0 (A:THROTTLE LOWER LIMIT, part) / 1 + 50 * }
14:33    MDL9Reader    Warning        Failed to find animation name for parameters (L:EmergencyThrottleInUse, bool) 1 !=     if{ (A:GENERAL ENG THROTTLE LEVER POSITION:1, part) s0 0 >=       if{ l0 -50 * 50 + }       els{ l0 (A:THROTTLE LOWER LIMIT, part) / 1 + 50 * }       d (>L:Engine1ThrottlePosition, percent)       }     els{ (L:Engine1ThrottlePosition, percent) }

You can only copy entries line by line from the event log and have to do some "find and replace" afterward, but at least the tags are displayed in a cleaner format.



But scratch my request, I totally forgot that there's a "save event log to file" button which makes things fairly easy.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,859
Country
netherlands
Hi,

I guess what I could do is dump the information that MCX has read (and shows in the event log) as a comment in an empty definition in the modeldef.xml. That would be a quick way to make your workflow easier, until it can be done more automatic.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,859
Country
netherlands
Hi,

I have made a quick implementation of this. Hopefully what I have added to the ModelDef.xml makes sense :), let me know if it gives more trouble.
 
Messages
141
Country
netherlands
Arno, I tried a couple of FS9 AI aircraft, the new custom animation tagging worked very well for me, this is a very good enhancement.
One question: Is there a reason the translated custom FS9 animations get type="Standard" and typeParam="" ?
When exported, this corrupts the animation. When I changed it to type="Sim" and typeparam="AutoPlay", the problem was solved.

Henk.
 

Heretic

Resource contributor
Messages
6,830
Country
germany
Animation generation for the custom code from FS9 model is a bit hit and miss. For some code, it works really well, other code gets turned into this:

Code:
 <Animation name="custom_anim_3#percent_28" guid="3facbe51-e17e-4114-8735-36047d4fb2da" length="100" type="Standard" typeParam2="custom_anim_3#percent_28" typeParam="" />
  <PartInfo>
    <Name>custom_anim_3#percent_28</Name>
    <AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Code>percent</Code>
        <Lag>EXIT OPEN:3</Lag>
      </Parameter>
    </Animation>
  </PartInfo>

  <Animation name="custom_anim_23" guid="6b868d73-e4fe-48d3-947b-3df19dea6a9f" length="100" type="Standard" typeParam2="custom_anim_23" typeParam="" />
  <PartInfo>
    <Name>custom_anim_23</Name>
    <AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Code>knots</Code>
        <Lag>RELATIVE WIND VELOCITY BODY Z</Lag>
      </Parameter>
    </Animation>
  </PartInfo>

Log:
Code:
18:20    MDL9Reader    Information    Created dummy animation with parameters RELATIVE WIND VELOCITY BODY Z#knots
18:20    MDL9Reader    Information    Created dummy animation with parameters EXIT OPEN:3#percent
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,859
Country
netherlands
One question: Is there a reason the translated custom FS9 animations get type="Standard" and typeParam="" ?
When exported, this corrupts the animation. When I changed it to type="Sim" and typeparam="AutoPlay", the problem was solved.

That's my lack of understanding of how it's supposed to work. I can fix that.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,859
Country
netherlands
Animation generation for the custom code from FS9 model is a bit hit and miss. For some code, it works really well, other code gets turned into this:

Code:
<Animation name="custom_anim_3#percent_28" guid="3facbe51-e17e-4114-8735-36047d4fb2da" length="100" type="Standard" typeParam2="custom_anim_3#percent_28" typeParam="" />
  <PartInfo>
    <Name>custom_anim_3#percent_28</Name>
    <AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Code>percent</Code>
        <Lag>EXIT OPEN:3</Lag>
      </Parameter>
    </Animation>
  </PartInfo>

  <Animation name="custom_anim_23" guid="6b868d73-e4fe-48d3-947b-3df19dea6a9f" length="100" type="Standard" typeParam2="custom_anim_23" typeParam="" />
  <PartInfo>
    <Name>custom_anim_23</Name>
    <AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Code>knots</Code>
        <Lag>RELATIVE WIND VELOCITY BODY Z</Lag>
      </Parameter>
    </Animation>
  </PartInfo>

Log:
Code:
18:20    MDL9Reader    Information    Created dummy animation with parameters RELATIVE WIND VELOCITY BODY Z#knots
18:20    MDL9Reader    Information    Created dummy animation with parameters EXIT OPEN:3#percent

I now used the parsing functions I had already, but it seems for FS2004 the rules are different. I'll see if I can improve it.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,859
Country
netherlands
Hi,

I'm trying to understand the different types of animations in the DICT section of the FS2004 MDL. But I have some difficulties, does any of you know there is documentation on this part of aircraft design available? I can see in the MDL that there are different types of animations, but it would help to know what they are to read them correctly ;)
 

Heretic

Resource contributor
Messages
6,830
Country
germany
Apart from the documentation in the MakeMDL SDK, I don't know of anything specific about FS9's MDL format. MakeMDL.parts.xml contains a few annotations, but nothing about specific types of animations.

What particular aspect do you want to know?
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,859
Country
netherlands
I think my problems is that I need to differentiate between the sim, code, callback, etc types of animations when reading the MDL.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,859
Country
netherlands
I have made a small test object with some animations in GMax already, hopefully that helps :)
 

Heretic

Resource contributor
Messages
6,830
Country
germany
I think my problems is that I need to differentiate between the sim, code, callback, etc types of animations when reading the MDL.

Is there no indication in the FS9 model as to what type some XML code has?

You can check if some code contains a variable formatted for writing ("(>" or "&gt;"). That'd most likely define it as callback.
If you can find out the prefix (or type) of a sim variable ("A:"), you can wrap it in "sim" tags. Or just merge it with its unit and put it into "code" tags. MSFS doesn't care.
Multiple operations in custom code can very likely be wrapped in "code" tags.

One other problem would be visibility tags, but I don't think these are parsed as custom code by the FS9 model reader (judging from the "set conditions" dialog when loading a model).
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,859
Country
netherlands
Hi Bjorn,

That's exactly what I'm trying to figure out now, how it is defined in the MDL what type of XML code it is. I have made a sample object with some boxes and assigned different animations to it. Hopefully that will help me to find the animation type and mouse rectangles. Not sure about the visibility conditions yet, they might be stored different in the FS2004 MDL. That's something to check later.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,859
Country
netherlands
Just for fun I added a test box with a visibility condition as well. I start to see how that works in the mdl, it's itching now to find deeper in this :)
 

Heretic

Resource contributor
Messages
6,830
Country
germany
One-click conversion of FS9 models with custom animations, visibilities and only minimal manual intervention would be a dream come true.
 
Top