UE4 Mannequin Importer

UE4_Mannequin_Shelf.png

Problem

This tool was made on project lead request. The initial request was a shelf button for Maya that could import the UE4 mannequin into the scene. The idea was the environment artist would have an easy way to scale assets in Maya to what would be in game. Since the project was a virtual reality game in UE4 the mannequin was already at a good scale for the project.

However, this was the first tool I made for the team so the problem wasn’t as simple as making a shelf button. The tool and future tools would need to be available for any member on the team. In addition some of these team members where working remote and had different computer setups compared to the environment artist who would mainly be using this tool.

Solution

The solution begins with the common factor on the project. We all use Perforce. I understand distributing tools this way is undesirable since perforce is a version control software and not a tool for distribution but it’s all I had at the time and seemed like the best fit for the team. On the teams Perforce we had a directory for Tools that contained several folders accessible from Maya thanks to the mod file which is a way of telling Maya to look in other places for scripts and other directory files. You can even add environment variables with mod files that persist for Maya and not the system.

This means instead of installing each Maya tool all a user would have to do is install the mod file into their version of Maya. This is taken care of with a bat file which also sets environment variables that point to the Perforce directory. For the majority of the team the Perforce directory was located on the same drive but this was not the case for the rest of the team. I would have liked to kept this functionality to the mod file itself but I couldn’t find any documentation on getting directory locations within a mod file.

Lastly a UserSetup.py file loads up the shelf that holds the tool. The tool itself imports an fbx file located in the directory the mod file points to. If needed the tool could be extended to support selection of different object for scale.

Feedback

There was no feedback for this tool. Instead, the tool produced an interesting outcome for the environment artist. This artist changed their workflow on the project for the better. Previously they would keep all meshes in a single ma file to keep the scale consistent. However, being able to easily import an object for scaling allowed them to keep meshes separated. This allowed the artist to be more organized and even sped up the export process while working.

Process

This tool wasn’t gui heavy so the it was more important to talk to teammates than to plan out on paper what needed to be done. Specifically, I needed a better understanding of what type of tools would be needed in the future. Beyond that I would spend time with the artist walking them through the installation process and making sure to test the tool on their machine with them.

Code

Github Link to view the code.

The meat of this tool is the fbx_helper.py. At the time I was under the assumption I would need to make some form of exporter tool so I wanted to try and start a library now for latter. The fbx_importer.py calls the helper and imports the mannequin. The glasscat.mod file is what Maya reads to know where the extra directories are located. Since the teams Perforce directory could be anywhere I’m using an environment variable to point to the directory that contains the extra directory. Lastly the Glasscat_Mod_Installer.bat looks for a modules folder on the users documents Maya directory and makes one if none exists. The mod file is copied to this directory and then some environment variables that point to the Perforce directory on the machine are set.

UE4_MannequinB.PNG