Skip to content
This repository has been archived by the owner on Dec 1, 2021. It is now read-only.

MMUGenerator Version 1

jsprenger edited this page Jun 1, 2021 · 1 revision

MMUGenerator

Overview

The MMU Generator is a Unity package, which helps to easily develop and deploy MMUs without needing to take care about the complexity of handling Unity and C# development files. It is important to note, the currently available Adapters only support auto-generated MMUs with a version below or equal to Unity Version 2018.3.4f1. It is therefore recommended to use Unity Version 2018.3.4f1. Later version are currently not supported by the Adapter and will lead to errors.

Setup

To install please create an empty project and import the provided MMU Generator package. After having imported the package, you should have the following files in your Assets folder.

image

Before going on. Please check your player settings within your Unity project. As illustrated in the image below, the API compatibility Level should be set to .Net4.x.

image

Exemplary Workflow

To start, please go to the resources folder and drag the Tpose Avatar to your empty scene. Now the scene should look like the following image:

image

Next, please rename the tpose GameObject to your desired MMU name. This avatar now serves as a base for your future MMU. To setup your MMU please click in the Scene Hierarchy window of the renamed MMU (in our case TestMMU).

image

Now please right click on your Avatar, and a context menu should appear. Please select the SetupMMU item.

image

Now you should see the following window:

image

In here, you can define the meta information of the MMU such as the name, motion type author and description. Since the MMUGenerator automatically generates source code for you, you can optionally specify which kind of source code should be auto-generated. By default only the source code using a base class template is provided. If you plan to strongly use the animator in your MMU, please check the Use Animator template as well. After having specified your desired options, next, please click on create structure. If everything was successful, the next window should appear.

image

Next, please click the Setup Components button. Within the Setup Components process, all available scripts and information such as joint mappings are automatically generated. Moreover, if create prefab is enabled, a prefab of your MMU is generated (strongly recommended).

image

After the setup of the components the following window should appear:

image

Now you should see a new folder in your Assets folder with the name of your defined MMU (in our case TestMMU).

image

By opening the folder the following files can be seen.

image

In particular, the TestMMU prefab has been created which contains the avatar, an auto-generated MMUScript and the set up components. Moreover, a description file was automatically generated. If you have custom scripts, which you want to add to the MMU, please add them to the scripts folder. Same applies for custom dependencies of the MMU, these should be analogously included in the Dependencies folder. Investigating the generated prefab/MMU in the scene, it can be encountered that a MMU script was automatically generated (in our case TestMMU).

image

By opening the TestMMU script with Visual Studio you can edit the auto-generated code.

image

In particular, all Unity components can be accessed within the script. If you utilized the animator template, you can now just create an animation controller with an animation clip in Unity and drag it to the Animator of the TestMMU.

image

The auto-generated code now plays back the Animations as defined in the Animation Controller (testController). Please ensure remove the “throw new System.NotImplementedException();” from the code in the assign instruction method. In here, the animator should be parametrized from code.

To finally export your MMU, please rightclick on the generated prefab in your MMU folder. The following context menu should appear.

image

Now select export MMU. The following window should appear.

image

Please fill out the missing information and click on expert. Now you must choose the desired export location. Now the asset bundles are build and a .dll containing your scripts and source code is automatically created. If successful, the folder containing your created zip archive will be opened and the following window will be shown.

image

For utilization of the MMU please create a new folder in the MMIEnvironment MMUs folder (e.g. MMUs/TestMMU/). Please extract the content of the created zip archive into the respective folder. Congratulations, you have created your first MMU! The MMU can now be utilized by the target engine using your defined motion type.

Debugging the MMU

The MMUGenerator provides the possibility to debug the developed MMU within the Unity environment. To do this the MMU Adapter (script) is provided. This script automatically hosts a (virtual) adapter which connects to the framework. To enable this functionality simply add the MMU Adapter script to the MMU GameObject.

image

Once added, please ensure that the MMU environment/launcher is running. Afterwards, enter the Unity play mode.

{{image.png}}

The new MMU should now actively register at the MMI register/launcher. Now, the MMU can be accessed from any target engine using the defined motion type.

image

Known Issues

Clone this wiki locally