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

Question on modeldef.xml

Messages
203
Country
unitedstates
I spent the weekend learning about attaching animations, visibility and effects to parts, fun stuff even if my family doesn't think so :).

From my research, it seems that all Gmax/3DS part animations and visibility features eventually come from Modeldef.xml.

1) I saw the post in another forum by Fr. Bill about the missing taxi_light entry in modeldef.xml. It seems the SDK only includes the general_lights for visibility, which doesn't seem quite complete. Logical thus far to add taxi lights. The SDK documentation on attaching a green nav light to the DC3's flex wing stops short of attaching the tag itself. Since I didn't find a tag that controls nav light visibility (there is one that controls the nav light switch for a VC), I assume I need to go in an create a similar entry for nav lights, beacon, etc, tied to LIGHTS NAV, LIGHTS BEACON, respectively provided they are on moving parts (that precludes the use of the aircraft.cfg to attach lights).

To create new animations/visibility types, is it really just a matter of adding new entries to enhance the default set provided just by ensuring the new entry has a unique ID and name?

2) Moving further in the possibilities, can C: tags be used in modeldef.xml to expand functionality beyond the default "sim variables"?

I'm thinking along the lines: hey, I can model more doors, more lights, refueling boom, none of which are built-in the default feature set.

Sounds too good to be true. This is a sanity check after long hours...

Etienne
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
I have found that you can actually have landing and taxi lights "ground splashes" that're fully controllable even without using the actual variables the sim provides... This opens up the possibility of having "spotlights" that could be freely rotated via a gauge programmed "joystick" for example... :)

The key to this being that since the actual "ground splash" is created by an .fx file, simply having that .fx file Attached to a poly that can be made visible/invisible will allow it to work...

As for the other lights, here are three of the one's I've added to my modeldef.xml file that seem to have been forgotten by ACES. As you can clearly see, it's rediculously easy to copy-paste-rename existing entries... :cool:

Code:
    <Animation name="beacon_light" guid="54447384-cff6-479c-a654-9b9cd33e4f09" length="100" type="Sim" typeParam2="beacon_light" typeParam="AutoPlay" />
    <Animation name="logo_light" guid="54547384-cff6-479c-a654-9b9cd33e4f0a" length="100" type="Sim" typeParam2="logo_light" typeParam="AutoPlay" />
    <Animation name="nav_light" guid="54647384-cff6-479c-a654-9b9cd33e4f0b" length="100" type="Sim" typeParam2="nav_light" typeParam="AutoPlay" />
   <Animation name="taxi_light" guid="43347384-cff6-479c-a654-9b9cd33e4f09" length="100" type="Sim" typeParam2="taxi_light" typeParam="AutoPlay" />

    <PartInfo>
        <Name>beacon_light</Name>
        <AnimLength>100</AnimLength>
        <Visibility>
            <Parameter>
                <Sim>
                    <Variable>LIGHT BEACON</Variable>
                    <Units>bool</Units>
                </Sim>
            </Parameter>
        </Visibility>
    </PartInfo>
    <PartInfo>
        <Name>taxi_light</Name>
        <AnimLength>100</AnimLength>
        <Visibility>
            <Parameter>
                <Sim>
                    <Variable>LIGHT TAXI</Variable>
                    <Units>bool</Units>
                </Sim>
            </Parameter>
        </Visibility>
    </PartInfo>
    <PartInfo>
        <Name>logo_light</Name>
        <AnimLength>100</AnimLength>
        <Visibility>
            <Parameter>
                <Sim>
                    <Variable>LIGHT LOGO</Variable>
                    <Units>bool</Units>
                </Sim>
            </Parameter>
        </Visibility>
    </PartInfo>
    <PartInfo>
        <Name>nav_light</Name>
        <AnimLength>100</AnimLength>
        <Visibility>
            <Parameter>
                <Sim>
                    <Variable>LIGHT NAV</Variable>
                    <Units>bool</Units>
                </Sim>
            </Parameter>
        </Visibility>
    </PartInfo>
 
Last edited:
Messages
203
Country
unitedstates
I'm not sure why the default lights are missing in the SDK - thanks for completing the set.

Etienne
 
Messages
69
Country
newzealand
Hi Fr Bill
Thanks again for your knowledgeable contibutions. I have added the above coding into my modeldef.xml and am pleased to report that my first FSX aircraft now displays taxi lights and landing lights.

Chers
Mike
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
No problem... One of the most interesting things about the new system is that you can have the "landing light ground splash" appear using any method you wish.

You could even use a custom L:var to turn 'em on/off! :cool:
 
Messages
17
Country
france
I have found that you can actually have landing and taxi lights "ground splashes" that're fully controllable even without using the actual variables the sim provides... This opens up the possibility of having "spotlights" that could be freely rotated via a gauge programmed "joystick" for example... :)

The key to this being that since the actual "ground splash" is created by an .fx file, simply having that .fx file Attached to a poly that can be made visible/invisible will allow it to work...

Sorry for such a noob question, but I am trying to add left_wingfold and right_wingfold to the modeldef.xml and for some reason I can't get it to work. Would you be so kind to assist me?
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
Sorry for such a noob question, but I am trying to add left_wingfold and right_wingfold to the modeldef.xml and for some reason I can't get it to work. Would you be so kind to assist me?

The first step is to look at the SDK to determine the parameter name(s) and animation criteria. We have two A:vars that are both percentage, which makes life easier since we don't need any "math" to massage the units to fit an animation track! ;)

FOLDING WING LEFT PERCENT
FOLDING WING RIGHT PERCENT

I'll do the "left" one here, then you can do the other... ;)

The second step is to determine what we need in the way of code. Since this is presumably needed to actually animate folding wings, we will only need an <Animation> section, and don't have to worry about a <MouseRectangle> or <Visibility> section.

Now, open modeldef.xml and look for a "prototype entry" similar to what we need... Ah, here's one!:

Code:
    <PartInfo>
        <Name>lever_stick_l_r</Name>
        <AnimLength>100</AnimLength>
        <Animation>
            <Parameter>
                <Sim>
                    <Variable>YOKE X POSITION</Variable>
                    <Units>percent</Units>
                    <Scale>0.5</Scale>
                    <Bias>50</Bias>
                </Sim>
            </Parameter>
        </Animation>
    </PartInfo>

Now, we don't need any special math, and we don't need to limit the animation's motion, so we can simply set the <Scale> to 1.0, then fill in our own values:

Code:
    <PartInfo>
        <Name>wing_fold_left</Name>
        <AnimLength>100</AnimLength>
        <Animation>
            <Parameter>
                <Sim>
                    <Variable>FOLDING WING LEFT PERCENT</Variable>
                    <Units>percent</Units>
                    <Scale>1.0</Scale>
                    <Bias>50</Bias>
                </Sim>
            </Parameter>
        </Animation>
    </PartInfo>

Well! That was easy enough! ;)

Now, we simply need to create an <Animation name=> GUID for the new code:

<Animation name="wing_fold_left" guid="9F28026F-B903-4856-CFAF-40B71893E3F2" length="100" type="Sim" typeparam2="wing_fold_left" typeparam="AutoPlay" />

Done!

That wasn't too hard at all... :teacher:

If the animation is too fast in the sim, adjut the <Bias> value lower. Conversely, if the animation is too slow, increase the <Bias> value. :cool:
 
Last edited:
Messages
17
Country
france
Thanks. I actually feel horrible to ask a fellow semi professional dev in this field for this kind of help, but I got people who are sick, people on holiday and others that don't want to talk to me anymore.

I owe you.
 
Messages
1,614
Country
puertorico
"Payment" for this type of advice is usually one or more:

- a credit in your documentation ("Useful information figuring out some problem received from the forum at fsdeveloper.com")

- passing on some help to some other modeller struggling with a problem you've solved.

- sharing a tip, mini-tutorial....
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
Thanks. I actually feel horrible to ask a fellow semi professional dev in this field for this kind of help, but I got people who are sick, people on holiday and others that don't want to talk to me anymore.

I owe you.

My friend, all that I ever ask is that folks who're help pass it on... ;)
 
Messages
37
Country
unitedkingdom
Modeldef.xml

I have read these posts with interest and although I can find the xml file I could only find it in the folder that contains the 3DS scripts/plug in modeling/enivronmental in the SDK file.

I am using GMAX - is this xml to be moved into the gmax gamepack folder?
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
I have read these posts with interest and although I can find the xml file I could only find it in the folder that contains the 3DS scripts/plug in modeling/enivronmental in the SDK file.

I am using GMAX - is this xml to be moved into the gmax gamepack folder?

Pardon the shout, but ABSOLUTELY NOT!!!

Unlike Max, the export process from GMax is a "closed loop," meaning that there's no way to intercept the process once started. Furthermore, the path to the modeldef.xml file is located in the Windows Registry. If you try to move the file, GMax won't "find it" and no animations will work...
 
Messages
37
Country
unitedkingdom
modeldef.xml

Thank you for the reply. I have not moved any files but the only modeldef.xml files I can find after doing a file search are located in the SDK - is that the one I edit? The search did not reveal a file in the Windows Registry
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
Thank you for the reply. I have not moved any files but the only modeldef.xml files I can find after doing a file search are located in the SDK - is that the one I edit? The search did not reveal a file in the Windows Registry

Yes. Simply edit the one modeldef.xml file located in the ..\bin folder.

I suggest making a copy of the file for backup purposes prior to making any additions and/or edits, of course... ;)
 
Messages
37
Country
unitedkingdom
Modeldef.xml

Thank you for the response.

I copied and pasted the code from the earlier post into the modeldef.xml in the bin file but now when I try and open the animation option in FSTools, I get an error message . I pasted the two groups of animations i.e Animation name and PartInfo - any ideas as to what I am doing wrong?
 
Last edited:

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
Thank you for the response.

I copied and pasted the code from the earlier post into the modeldef.xml in the bin file but now when I try and open the animation option in FSTools, I get an error message . I pasted the two groups of animations i.e Animation name and PartInfo - any ideas as to what I am doing wrong?

That's a tough question to answer! It's obviously an error in the "paste" job.

You did post the two parts of the code in the appropriate sections of the modeldef.xml file, right?
 
Messages
37
Country
unitedkingdom
Modeldef.xml

Thank you for the response.

I looked at the xml file (still new to programming) and guessed that the two parts of the code posted in this tread have to be pasted separately into the Animation name and the Part info sections. I looked to see if they went in any particular order by word searching a random animation name and finding where it went (relative to the other entries) in the both sections but as far as I can tell it makes no difference.

I am still getting the same error message. I have done a clean install of both Gmax and the SDK and the error message goes when I replace the XML with a back up of the original.

I attach the file and wonder if you could spot where I am going wrong.

Regards

Humph
 
Last edited:

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
I attach the file and wonder if you could spot where I am going wrong.

Regards

Humph

It took a bit to find, but it's quite obvious once found:

</PartInfo>
<PartInfo>



</ModelInfo>

You have an extra <PartInfo> tag at the bottom of the modeldef.xml file with no "closing" </PartInfo> tag, which will cause the entire file to be rejected.

I'll accept the "blame" for this since the original snippet I posted at the beginning of the thread also contained the offending <PartInfo> tag... :yikes: I've edited the original post to remove the problem child...

BTW, since the order makes no difference at all, it would be much easier on you to place the new entries at the TOP of the list of default <PartInfo> sections... :cool:
 
Last edited:

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
It works!

Thank you for taking the trouble to search and find the problem.

You don't need to thank me. After all, I'm the idiot who created the problem and caused you so much grief! :eek:

It's the very least I could do... ;)
 
Top