• 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 VR panel focus and collision mesh from Blender exporter

Messages
94
For MSFS 2020 VR compatibility, the SDK documentation explains how to build a PANEL_COLLISION mesh (https://docs.flightsimulator.com/ht...arch=panel_collision&rhhlterm=panel_collision). This mesh is needed to align the plane of the mouse pointer with the underlying model meshes so you don't see it as two cursors. This collision mesh also allows the use of the VR focus feature.

The MSFS Toolkit 4.0 exporter does not export the collision material in the correct format for MSFS to recognize the PANEL_COLLISION. After exporting the GLTF file, you can manually edit the JSON to format this material in a way that will work in the sim. For scenery projects with collision meshes, I'm not sure if this is needed, but if you find that collisions in the sim are not working, give it a try.

Open the cockpit LOD0 GLTF file in a text editor and search for the name of your collision material. In my case, this material is named "collision". Here is how it exports by default:

Code:
        {
            "alphaMode" : "BLEND",
            "emissiveFactor" : [
                0.800000011920929,
                0,
                0
            ],
            "extensions" : {
                "ASOBO_tags" : {
                    "Collision" : true
                },
                "ASOBO_material_invisible" : {
                    "enabled" : true
                }
            },
            "name" : "Collision",
            "pbrMetallicRoughness" : {
                "baseColorFactor" : [
                    0.800000011920929,
                    0,
                    0,
                    1
                ],
                "metallicFactor" : 0,
                "roughnessFactor" : 0.5
            }
        },

The ASOBO_tags section needs to be changed to this:

Code:
"ASOBO_tags" : {
    "tags": ["Collision"]
},

I don't fly in VR very often, only when I borrow my son's Quest. For other aircraft developers, it may be a good idea to think about getting a hold of a VR headset and testing out your creations in VR mode to check the camera position and things like the panel collision mesh. It's a small quality of life improvement that at least some of your users will be happy for.
 
Messages
94
It looks like the new exporter fork from MS will fix the collision material tags. I still use the MSFS Toolkit 0.4 version because I am still on Blender 2.93. If you switch to Blender 3.0, you should use the new addon. If you want to fix your MSFS Toolkit 0.4, I have a small patch below.

If you don't have access to a VR headset, Asobo has added a nice feature in developer mode to simulate it for 2D screens. It's under the Options menu, at the bottom, Default VR API. If you set this to fake, you can enter VR mode. You will see both eye views and you can hover the cursor onto a specific spot on the panel and verify that the cursors in both eyes point to the same exact spot. If you don't have the PANEL_COLLISION mesh configured properly, the cursors will be in different places.


VR_setting.jpg

VR_fake.jpg


If you need to patch the MSFS Toolkit addon, locate the file extensions/ext_master.py and edit the section in def gather_material_hook that refers to the road and collision materials so it looks like this:

Code:
    def gather_material_hook(self, gltf2_material, blender_material, export_settings):
        if (self.properties.enabled == True and blender_material.msfs_material_mode != None):
            if blender_material.msfs_material_mode != 'NONE':
                if gltf2_material.extensions is None:
                    gltf2_material.extensions = {}
                if gltf2_material.extras is None:
                    gltf2_material.extras = {}
                
                # Check the blend mode and attach extensions if necessary.
                # As far as I can tell, the regular blendmodes don't need an extension to work.
                if blender_material.msfs_show_blend_mode == True:
                    if blender_material.msfs_blend_mode == 'DITHER':
                        gltf2_material.extensions["ASOBO_material_alphamode_dither"] = self.Extension(
                            name="ASOBO_material_alphamode_dither",
                            extension={"enabled": True},
                            required=False
                        )


                if (blender_material.msfs_show_road_material == True or blender_material.msfs_show_collision_material == True):
                    if (blender_material.msfs_road_material == True or blender_material.msfs_collision_material == True):
                        new_ext = {}
                        if blender_material.msfs_road_material == True:
                            new_ext["tags"] = ["Road"]
                        if blender_material.msfs_collision_material == True:
                            new_ext["tags"] = ["Collision"]
                        if blender_material.msfs_collision_material == True and blender_material.msfs_road_material == True:
                            new_ext["tags"] = ["Road", "Collision"]

                        gltf2_material.extensions["ASOBO_tags"] = self.Extension(
                            name="ASOBO_tags",
                            extension=new_ext,
                            required=False
                        )

                if blender_material.msfs_show_day_night_cycle == True:
                    if blender_material.msfs_day_night_cycle == True:
                        gltf2_material.extensions["ASOBO_material_day_night_switch"] = self.Extension(
                            name="ASOBO_material_day_night_switch",
                            extension={ "enabled": True },
                            required=False
                        )
.... truncated
 
Messages
6
Country
germany
Hello!

I followed the step of editing the ext_master.py and since then the collision meshes have been exported successfully.

except panel_collision. I can see the mesh in debug view, but it doesn't prevent me from seeing my mouse cursor double in VR.

I have also checked the *.gltf. the collisions tag is entered there, just like the other meshes that work.

Can someone help me why the panel_collision mesh doesn't work?
 
Top