plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.


Please take a moment to read the platform’s guidelines before you get started!


question

XCodr_Designs avatar image
XCodr_Designs asked XCodr_Designs edited

Trouble attaching visual effects to sim object

Hi, I'm trying to attach a visual (particle) effect to a sim object. I have a working visual effect, and a sim object, I just can't attach it. I can spawn it on the sim object via inspector in the visual effect editor, so I know the sim object exists and is placed in the world, and I know the effect works.

I suspect that the issue is the attach point, I've tried adding an attach point via MCX, and by adding an empty in blender (which I named "Steam), however I can't find any clear direction on how to add an attach point to a model in Blender. I'm using the Asobo Blender exporter (https://github.com/AsoboStudio/glTF-Blender-IO-MSFS). When I try to enter a node name in the Inspector for the VFX editor, the name box is outline in red, which also makes me think the issue is the attach point, but I don't know if that actually means anything...

I have also built all, restarted, etc. In addition the console doesn't produce any errors.

This is what my XML file looks like:


<?xml version="1.0" encoding="utf-8"?>

<ModelInfo guid="{9bbd4104-de1c-4431-a691-81b21c1069a2}" version="1.1">

<LODS>

<LOD minSize="0" ModelFile="Steam_Emitter.gltf"/>

</LODS>

<Behaviors>

<Component ID="#MyFXSpawner#">

<Parameter type="Override">

<FX_GUID>{7E5D94F3-3458-4186-9C50-7221D5BD0C9B}</FX_GUID>

<FX_CONTACT_POINT_ID>-1</FX_CONTACT_POINT_ID>

<FX_CODE>1 0 &gt;</FX_CODE>

<FX_OFFSET_X>0.0</FX_OFFSET_X>

<FX_OFFSET_Y>0.0</FX_OFFSET_Y>

<FX_OFFSET_Z>0.0</FX_OFFSET_Z>

<FX_ROTATION_OFFSET_P>0.0</FX_ROTATION_OFFSET_P>

<FX_ROTATION_OFFSET_B>0.0</FX_ROTATION_OFFSET_B>

<FX_ROTATION_OFFSET_H>0.0</FX_ROTATION_OFFSET_H>

</Parameter>

<Component ID="SteamEmmitterXCDKWYS" Node="Steam">

<UseTemplate Name="ASOBO_GT_FX"/>

</Component>

</Component>

</Behaviors>

</ModelInfo>

If anyone can shed some light on the issue or the attach point that would be greatly appreciated! Thank you!

sceneryvfx
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

thealx avatar image
thealx answered XCodr_Designs commented

Simobject XML has slightly different node names compare to aircraft XML. This is carrier ops catapult shuttle object with smoke attached - hope it will help to see the difference:

<?xml version="1.0" ?>

<ModelInfo guid="{33da00b5-3b37-46b5-b5e4-550fb6abd6ae}" version="1.1">

  <LODS>

    <LOD MinSize="0" ModelFile="pbk-shuttle.gltf"/>

  </LODS>

</ModelInfo>

<ModelBehaviors>
  <Include ModelBehaviorFile="Asobo\Generic\FX.xml"/>

  <Component ID="CATAPULT_SMOKE">
    <OverrideTemplateParameters>
      <FX_GUID>{0EEB3195-3D0C-49F9-B016-7EAEC3B3EECE}</FX_GUID>
      <FX_CODE>1</FX_CODE>
      <FX_GRAPH_PARAM_0>STRENGTH, 
        1
      </FX_GRAPH_PARAM_0>
    </OverrideTemplateParameters>
    <Component ID="CATAPULT_SMOKE_NODE" Node="STEAM">
      <UseTemplate Name="ASOBO_GT_FX"/>
    </Component>
  </Component>

</ModelBehaviors>

</xml>
1 comment
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

XCodr_Designs avatar image XCodr_Designs commented ·

Thank you for the response @thealx ! That is likely part of the problem, however this didn't fix it. I believe the issue is the attach point. When I look in the GLTF I see a Steam node, but there is no location data. Do you by chance know how to add an attach point/node using the Asobo Blender exporter, or have an example .gtlf (only the gltf, not the bin which contains the actual geometry), that I could take a look at? If not no worries. Thanks again for the response!

0 Likes 0 ·
XCodr_Designs avatar image
XCodr_Designs answered XCodr_Designs edited

Finally got it. Turns out the FX_CODE tag needs to be inside the UseTemplate tag, not the Parameter tag. Some examples show it in both places, some have it in just the parameter tag, idk why. Here is the correct XML Code.

For attach points, all a node is is just a piece of geometry, and the name of that node is the name of that piece of geometry in Blender. I would encourage Asobo to please document this as currently there is no documentation on what a node is, and it's a very important thing considering that is how you do custom beacon objects and particle effects, and likely other things as well.

Edit: I can't mark this as answered, so if a mod could do that that would be great, thanks!


<?xml version="1.0" encoding="utf-8"?>
<ModelInfo guid="{9bbd4104-de1c-4431-a691-81b21c1069a2}" version="1.1">
<LODS>
<LOD minSize="0" ModelFile="Steam_Emitter.gltf"/>
</LODS>
<Behaviors>
  <Include ModelBehaviorFile="Asobo\Generic\FX.xml"/> 
  <Component ID="XCD_KWYS_Steam">
<OverrideTemplateParameters>
  <FX_GUID>{7E5D94F3-3458-4186-9C50-7221D5BD0C9B}</FX_GUID>  
  <FX_CONTACT_POINT_ID>-1</FX_CONTACT_POINT_ID>
  <FX_OFFSET_X>0.0</FX_OFFSET_X>
  <FX_OFFSET_Y>1.0</FX_OFFSET_Y>
  <FX_OFFSET_Z>0.0</FX_OFFSET_Z>
  <FX_ROTATION_OFFSET_P>0.0</FX_ROTATION_OFFSET_P>
  <FX_ROTATION_OFFSET_B>0.0</FX_ROTATION_OFFSET_B>
  <FX_ROTATION_OFFSET_H>0.0</FX_ROTATION_OFFSET_H>
</OverrideTemplateParameters>
<Component ID="XCD_KWYS_Steam_Node" Node="XCD_KWYS_Steam_Cube">  
  <UseTemplate Name="ASOBO_GT_FX">
<FX_CODE>1 0 &gt;</FX_CODE>
  </UseTemplate>
</Component>
  </Component> 
</Behaviors>
</ModelInfo>
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 19.1 MiB each and 23.8 MiB total.