M2u interactive sync script for Maya -> UE4

Assuming you have the plugin compiled, you’re probably stumbling over the whole path/Python thing. Here’s what I did:

I have the m2u Python code in a directory “d:\GitHub\m2u”. I then set an environment variable in Windows (8.1 in my case) with name PYTHONPATH to “D:\GitHub”. So without the m2u directory. You can do this in Windows in Control Panel > System and Security >System >Advanced System Settings > Advanced > Environment Variables > System Variables.

Then you can create a shelf button in Maya with the following Python command:


""" maya startup file

called by a shelf button or so, will initialize the system
to use the maya program modules and create the UI attached to maya
"""

import m2u

m2u.core.initialize("maya", "ue4")

# create UI here, send the initialized m2u module to the ui if necessary (max)
# in maya it should be in the maya namespace ?

#createUI(m2u)

#TODO check if pyQt is installed, if not, use the simple internal maya UI

from m2u.maya import mayaInternalUI
mayaInternalUI.createUI()