mtion SDK Documentation

Overview

The mtion SDK is used to create and export mtion clubhouses, environments, assets and interactive experiences using Unity, which can afterwards be accessed from within the mtion app. You will need Unity version 2021.3.25 for the SDK.

Install

Open the package manager in Unity:

Then add a package using the following git URL: https://github.com/mtion-tv/MtionSDK.git

After the installation completes the mtion SDK window can be opened from the top bar under “MTION SDK/SDK Tools”.

Pressing this button will open up the “MTION SDK Tools” window.

Getting started - Create and export a new room

This short tutorial goes over the process of creating a new room using the SDK, exporting it, and accessing it from within mtion studio.

Creating the room scene

In order to create a room press the “Create Room Scene” button within the mtion SDK window. This will add a couple new GameObjects to the current scene.

Notice the MTION ROOM object that was added to the scene. ⚠ All GameObjects that you want to export as part of this room need to be children of the MTION ROOM object! ⚠

Building the room

This room could be exported in its current state, but that’s not very interesting, it’s empty!

This is where you can get creative and build something exciting and original. For the purposes of this example I’m going to build a small house. ⚠ Remember that whatever you add to the room needs to be added under the MTION ROOM object in order to get exported! ⚠

Once you’ve built up your room then it’s time to export it.

Exporting

Back on the “MTION SDK Tools” window set the name of the room and give it a description. You should not change the export location, and you can check out "Environment scene" section for more information regarding “Environment ID”, for now we’ll leave it blank.

Finally, pressing on the “Build Scene” button will begin the export process. This may take anywhere from a couple seconds to a few minutes depending on the complexity of the scene.

Once the export is complete, the new room should appear under the “Clubhouse Templates” section in the mtion studio dashboard.

Adding props

In order to add props to the room, navigate over to the “Props” tab in the main SDK window. Here you can add virtual cameras, displays, lights, and virtual assets to the room.

For the purposes of this example I’m going to add a couple cameras to my room by using the “Add Virtual Camera” button, and an asset by using the “Add 3D Asset” button. Notice that these new objects were added to the scene under the “SDK PROPS” object. ⚠ All props (cameras, displays, lights, and virtual assets) need to be children of the “SDK PROPS” object in order to get exported correctly! ⚠

The new virtual asset “VirtualAsset (0)” is empty so let’s add a GameObject to “Virtual Asset (0)”. When building out this room, this asset will get exported along with the room and will also be accessible as a standalone asset from within the asset browser in mtion studio.

Build out the room again, just as above using the “Build Scene” button under the “Build” tab. If you enter mtion studio and create a new clubhouse using this updated room template, the clubhouse will include the newly added props.

Furthermore, the virtual asset that was exported is now also available in the asset browser.

Scene types

Room scene

A room scene can be created by clicking “Create Room Scene” under the “Build” tab. Exporting this type of scene using the “Build Scene” button results in a new clubhouse template in mtion studio. See the above "creating the room scene" section for more details.

Environment scene

An environment scene can be created by clicking the “Create Environment Scene” under the “Build” tab.

⚠ When creating an environment scene all GameObjects that you want to export need to be added underneath the “MTION ENVIRONMENT” GameObject in the scene! ⚠

After exporting this type of scene using the “Build Scene” it can be added to room scenes via its ID. This ID can be found under the auto-generated “Environment” object.

The “Environment ID” can be set on a room scene using the “Build” tab. ⚠ Remember to re-export the room scene after changing this! ⚠

Now, the environment will be instantiated alongside the clubhouse template in mtion studio.

Skybox

To get a skybox into a scene, you'll need to

  1. Create a new Unity Scene and initialization it as a "Environment"

  2. Create a Unity Scene for the "Room", copy over the environment ID to the slot

  3. In the environment scene, set the skybox texture

Asset scene

An asset scene can be created by clicking the “Create Asset Scene” under the “Build” tab.

⚠ When creating an asset all GameObjects that you want to export need to be added underneath the “MTION ASSET” GameObject in the scene! ⚠

Exporting this type of scene using the “Build Scene” button results in a new virtual asset available under the asset browser in mtion studio.

NOTE: Assets exported as part of a room scene will also be available in the asset browser.

Avatar Scene

You can import VRM avatar models into your mtion clubhouse using the SDK. See this video guide below:

For VSF model import, you do not need the SDK. You can upload your VSD models into your mtion clubhouse directly in the mtion app.

Props

The “Props” tab is only available while in a room scene. Here props can be added or modified.

⚠ All props (cameras, displays, lights, and virtual assets) need to be children of the “SDK PROPS” object in order to get exported correctly! ⚠

In order to delete a prop simply delete the corresponding GameObject underneath the “SDK PROPS” object. This will also remove it from the corresponding list in the “Props” tab.

Virtual cameras

Adding a virtual camera in the SDK is equivalent to adding a virtual camera using mtion studio, however doing it in the SDK bundles it with the template.

Display components

Adding a display component in the SDK is equivalent to adding a display using mtion studio, however doing it in the SDK bundles it with the template.

Light components

Adding a light component in the SDK is equivalent to adding a light using mtion studio, however doing it in the SDK bundles it with the template.

Virtual assets

Adding a virtual asset in the SDK will bundle the asset with the room template. It will also make the asset available within the asset browser in mtion studio. ⚠ When adding a virtual asset as part of a room scene, make sure to add child GameObjects to export underneath the VirtualAsset object in the scene. ⚠

Actions

Actions can be added to a Virtual Asset in order to give it unique and interactive behaviors within mtion studio. Simply add any of the following components to a GameObject contained within your Virtual Asset. ⚠ This only works for dedicated Virtual Asset scenes. It does not work with props belonging to a Room scene. ⚠

Once the component is added the user facing action name and descriptions can be updated from within the “Actions” tab. The “Active” toggle can also be unchecked in order to prevent that action from being exported.

Particle Action Controller

Add this component in order to allow a particle system to be played and stopped from within mtion studio. ⚠ Ensure your desired Particle System has been added to the “Particle System” field within the Particle Action Controller component. ⚠

Once exported the “Play Particles” and “Stop Particles” actions are visible from within mtion studio.

Additionally, the particles can be set to loop or play from within the “Custom Properties” section in the inspector panel.

Set Animator Trigger Action

Add this component in order to set an Animator Trigger from within mtion studio. ⚠ Ensure the “Animator” and “Trigger Name” fields are populated with your desired values. ⚠

Once exported the Set Animator Trigger action is visible from within mtion studio and can be used to set the specified Animator Trigger.

Unity Event Action

Add this component in order to add custom functionality to your Virtual Asset using Unity Events. Multiple events can be combined within a single Unity Event Action or they can be split up across multiple actions. ⚠ Unity Events that reference custom components are not supported currently. Please only reference native Unity components. ⚠

Once exported the Unity Event action is visible from within mtion studio and can be used to trigger the Unity Events that were defined.

Last updated