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

MSFS Explain js/css/html and xml and gltf/bin and wasm relationships - Unofficial SDK ver 0.13 info

Ok, This is a treasure hunt to go through the xml files in the Official\OneStore\fs-base-aircraft-common\ModelBehaviorDefs\Asobo\Transponder folder. I took the AS330.xml file and tried to figure out how it worked with the Pitts.

The key in this whole thing is the naming in the model glif file agrees with the parameters in the xml files.

So I looked at the Pitts interior.xml. You can view it in notepad++ with the json plugin or your favorite editor. Or if you update blender you can import the gltf file and see the node names.
In the Pitts the transponder texture for the AS330 is $AS330_screen and I will leave it as that as that would me changing the gltf file. This is the same as the panel.cfg naming. There is no need to change the panel.xml, nothing there for the transponder.

So I changed:

[VCockpit03]
size_mm=440,100
pixel_size=440,100
texture=$AS330_Screen
htmlgauge00=Generic/Transponders/AS330/AS330.html, 0,0,440, 100
to
[VCockpit03]
size_mm=440,100
pixel_size=440,100
texture=$AS330_Screen
htmlgauge00=Generic/Transponders/KT76C/KT76C.html, 0,0,440, 100

ASOBO has provided the js/css/html KT76C.htl/.js/.css files in the core system for use to use, so the panel.cfg is pointing to existing code, there is no need to reinvent the wheel.

Now we need a KT76C.xml - I took the AS330.xml and copied it into a project folder. Renamed all the AS330 to KT76C inside the xml. I removed the button 8 and 9 stuff since there is no 8 and 9 in the 76C.

As an example - here is part of the xml files.

<Template Name="ASOBO_AS330_Template">
<DefaultTemplateParameters>
<ID>1</ID>
<Condition Check="CIRCUIT_ID">
<True>
<FAILURE>(A:CIRCUIT ON:#CIRCUIT_ID#, Bool)</FAILURE>
</True>
<False>
<FAILURE>(A:CIRCUIT GENERAL PANEL ON, Bool)</FAILURE>
</False>
</Condition>
<ANIM_NEVER_FAILS/>
<EMISSIVE_DEFAULT_VALUE>0.5</EMISSIVE_DEFAULT_VALUE>
<AS330>TRANSPONDER</AS330>
</DefaultTemplateParameters>

<UseTemplate Name="ASOBO_GT_Helper_Suffix_ID_Appender">
<TEMPLATE_TO_CALL>ASOBO_AS330_SubTemplate</TEMPLATE_TO_CALL>
</UseTemplate>
</Template>
to

<Template Name="ASOBO_KT76C_Template">
<DefaultTemplateParameters>
<ID>1</ID>
<Condition Check="CIRCUIT_ID">
<True>
<FAILURE>(A:CIRCUIT ON:#CIRCUIT_ID#, Bool)</FAILURE>
</True>
<False>
<FAILURE>(A:CIRCUIT GENERAL PANEL ON, Bool)</FAILURE>
</False>
</Condition>
<ANIM_NEVER_FAILS/>
<EMISSIVE_DEFAULT_VALUE>0.5</EMISSIVE_DEFAULT_VALUE>
<KT76C>TRANSPONDER</KT76C>
</DefaultTemplateParameters>

<UseTemplate Name="ASOBO_GT_Helper_Suffix_ID_Appender">
<TEMPLATE_TO_CALL>ASOBO_KT76C_SubTemplate</TEMPLATE_TO_CALL>
</UseTemplate>
</Template>

I kept the ASOBO name - but I think you could change to LHC, but I am unsure if it impacts things. (edit: yes it would because some calls are to templates in the core files - leave as ASOBO).

Do not mix older modeldef.xml code with these templates. These templates are great. You just need to know what names to give to your nodes, parts and animations. They have to agree with the parameters like -

<KT76C>TRANSPONDER</KT76C>
<BTN_ID>#ID#</BTN_ID>
<PREFIX>#KT76C#_Push</PREFIX>
and
<NODE_ID>#PREFIX#_#BTN_ID##SUFFIX_ID#</NODE_ID>
<ANIM_NAME>#PREFIX#_#BTN_ID##SUFFIX_ID#</ANIM_NAME>
<PART_ID>#PREFIX#_#BTN_ID#</PART_ID>

This is the new stuff. You get the "values" of these parameters from the

<DefaultTemplateParameters>

area of other templates. This treasure hunt is difficult.

So the model gltf file needs NODE_IDs, ANIM_NAMEs, and PART_ID that will agree with the parameters and the way they are "built".

The PREFIX "value" is taken from the #KT76C# value and then we concatenate "_PUSH" (without the quotes)
This makes PREFIX = TRANSPONDER_Push

Now BTN_ID = #ID# which depends on what button is pushed. (This all happens behind the scenes with Coherent_GT js/css/html talking to the code files C++ and then the XML files. (This is all magic to me right know)

<UseTemplate Name="ASOBO_KT76C_Push_Button_Template">
<BTN_ID>VFR</BTN_ID>
<TOOLTIPID>TT:COCKPIT.TOOLTIPS.XPDR_VFR</TOOLTIPID>
</UseTemplate>
<UseTemplate Name="ASOBO_KT76C_Push_Button_Template">
<BTN_ID>0</BTN_ID>
</UseTemplate>
<UseTemplate Name="ASOBO_KT76C_Push_Button_Template">
<BTN_ID>1</BTN_ID>
</UseTemplate>

If VFR button.
NODE_ID value is #PREFIX#_#BTN_ID##SUFFIX_ID# - so that is TRANSPONDER_Push + _ + VFR + the suffix id - This is more magic as there is code below that gets this value.
edit: ANIM_NAME value is #PREFIX#_#BTN_ID##SUFFIX_ID# - so that is TRANSPONDER_Push + _ + VFR + the suffix id - This is more magic as there is code below that gets this value.

<UseTemplate Name="ASOBO_GT_Helper_Suffix_ID_Appender">
<TEMPLATE_TO_CALL>ASOBO_KT76C_SubTemplate</TEMPLATE_TO_CALL>
</UseTemplate>

This is the reason I said you can't change ASOBO to LHC, because this is a core html template you don't have.
I assume the SUFFIX_ID is _1. It adds the underscore too.

So NODE_ID = TRANSPONDER_Push _VFR_1. If you look at the gltf file we have an node with that name.
edit: And ANIM_NAME = TRANSPONDER_Push _VFR_1. If you look at the gltf file we have an animation with that name.

1610299462002.png


1610308172418.png


So the PART_ID is built the same way. Your model has to agree with the way ASOBO has setup the parameters.

One more file change. I had to change the Pitts_Interior.xml and change AS330 to KT76C.

<Behaviors>
<Include ModelBehaviorFile="Asobo\Common.xml"/>
<Include ModelBehaviorFile="Asobo\Misc\Accelerometer.xml"/>
<Include ModelBehaviorFile="Asobo\Transponder\KT76C.xml"/>
<Include ModelBehaviorFile="Asobo\NAVCOM\NavComSystem.xml"/>

<!-- HTML INSTRUMENTS ################### -->
<Component ID="Accelerometer">
<UseTemplate Name="ASOBO_Accelerometer_Template">
</UseTemplate>
</Component>
<Component ID="KT76C">
<UseTemplate Name="ASOBO_KT76C_Template">
</UseTemplate>
</Component>

That is what's needed for the file change.

What's needed is a list of ALL the template parameters and NODE_ID, PART_ID and ANIM_NAME. This is a huge task. And then somehow add them to Blender2MSFS utility.

To build a package I followed what WorkingTitle and MrTommymxr do. I used planeconverter to make packages with a SimObject folder and ModeBehaiviorDef folder. Placed the new KT76C.xml in modeBehaviorDef and the other files in the SimObject. This modified the ASOBO Pitts.

I will be adding this to the Unofficial SDK documentation.

Edit: minor edits done.
 
Last edited:
The one thing I have not figured out is ... What is a PART_ID and where is it used. There is code in the core xml that uses it, but I don't know why or how.
 
The Part ID is the 'name' of the part that you give the object in Blender or Max.
Usually, I found, the part has the same name as the animation.
A problem we have with animating parts that had a lot of work on them, like landing gear, etc, that had lots of scaling and things done, does not always animate well and so we have to use dummy parts (empty's in Blender talk) and so the dummy will have a similar name, but not important, and it has the animation name, and the actual object part (like a switch object) is the clickable part and has the real name (like the animation name).

I had an issue with this. Multiple parts and animations with the same names. I found in the DA62 and another, that the parts have numbers at the ends of the names (on parts, not animations) such as 'somethingnode005'
 
Ron,

What if I created the duplicate AS330 renamed to KT76C, and placed it into my own panel folder, like how we treat our own gauges? Simply link to it in the panel config?
 
You can do that, But you need to make sure your blender file has the same names for the buttons and animations.

So NODE_ID = TRANSPONDER_Push _VFR_1. If you look at the gltf file we have an node with that name.
edit: And ANIM_NAME = TRANSPONDER_Push _VFR_1. If you look at the gltf file we have an animation with that name.

The xml KT76C.xml goes in a ModelBehaviorDef folder.

ASOBO has made an AS330.xml and put it in the core ModelBehaviourDefs folder. Since there is no KT76C.xml there you need to make your own ModelBehaviorDefs folder structure.

ModelBehaviorDefs\Asobo\Transponder

Your project package will have a SimObject folder structure and a ModelBehaviorDefs at minimum. Maybe you have effects also. See my unofficial SDK explanation on VFS.
 
Last edited:
So NODE_ID = TRANSPONDER_Push _VFR_1. If you look at the gltf file we have an node with that name.
edit: And ANIM_NAME = TRANSPONDER_Push _VFR_1. If you look at the gltf file we have an animation with that name.

Yep. The name for the button and animation will usually be the same. You might be able to change it in the ModelXML or Behavior, but for now, yes.
Reason the part needs to have the same name is for MouseRect, and also for triggering the animation or code. Thats why a button object will have the right name, but the dummy which animates, which the button, knob, or lever is connected to, has the correct name.
 
I have updated the Unofficial SDK files and added an excel spreadsheet with all the ANIM_NAME values. You can read where the ANIM_NAME value comes from a specific xml file and the folder.

These ANIM_NAME values are used also for NODE_ID values that you put in your blender model as a Node and as a animation name.

It will allow you to use the templates for the modelBehaviorDefs in your own model. You won't need to make your own instruments. for example

TRANSPONDER - if you use the AS330.xml file template and name your nodes and animations in the following manner. (similar to what I did above in this thread for the KT76C.

<ANIM_NAME>#PREFIX#_#BTN_ID##SUFFIX_ID#<\ANIM_NAME>AS330.xmlfs-base-aircraft-common\ModelBehaviorDefs\Asobo\Transponder\AS330.xml

Your buttons would be:

TRANSPONDER_Push_VFR_1 for Prefix = TRANSPONDER_Push, BTNID = VFR and SUFFIX is 1

You will need to update your interior.xml file that you manually setup (just look at ASOBO's existing aircraft)

See thread post #2
 
It is not a criticism but just a drawback that needs to be pointed out: this method links your development to Asobo's developments.
If Asobo modify in the right way it is a plus for you but if it is a regression you should cry ☺️
 
Last edited:
It is not a criticism but just a drawback that needs to be pointed out: this method links your development to Asobo's developments.
If Asobo modify in the right way it is a plus for you but if it is a regression you should cry ☺️
Yes agree, but hopefully things will stabilize.
 
Ron,

What if I created the duplicate AS330 renamed to KT76C, and placed it into my own panel folder, like how we treat our own gauges? Simply link to it in the panel config?
Follow my adventures as I try to do this:


Long story short, you copy the html_ui file structure into your Package sources, add a new assetgroup for the html_ui and that's as far as I've got. I'm having a lot of trouble just getting a copy of a gauge running. You don't copy into your panel folder like with xml, you need to use the html_ui file structure.
 
Here is another update to the Unofficial SDK pages.

Added XML Behavior Template info.

Updated the spreadsheet for Animation names and put them in another folder. - You can delete the one in Documentation.

See post 2 of this thread.

Edit: error in folder structure- updated Model Behaviors not XML Gauges
 
Last edited:
Updated February 3, 2021 - Lighting Model - It's blank on official SDK ToDo.

I added with a description of PBR textures and Armor Paint, Blender, Gimp workflow.

This is a work in progress as I learn PBR.

New link

edit: there may be an update to the SDK with the release of World Update3 - Maybe? So updating now and see what things have changed in the next SDK update.
 
Last edited:
Back
Top