Over the last few weeks I’ve been working on a set of scripts in my free time to help get additional relevant data from Maya into Unity. In particular, I’ve been interested in getting things for procedural animation (constraints, expressions, etc.) out of Maya and into Unity automatically, since I have traditionally had to re-code them manually. As such, I’ve developed a Python script that is invoked whenever Unity imports a Maya asset, which in turn adds attributes to the intermediate FBX file for Unity to operate on in an AssetPostprocessor script. Rather than babble, however, I decided to make a video to demonstrate how the tools work. (Click through to Vimeo to view in full HD.)
I’ll be releasing an early version of all of these scripts for free download soon, which will come as an update to my AMTools Maya Python package as well as a Unity package containing all of the editor scripts and components I created (these include a point constraint, orient constraint, aim constraint, expose transform, and so on).
As noted in the video, there are some limitations (some of which I can and will fix later). Briefly:
- The orient constraint that I coded only uses slerp, average, and slime, so it does not yet support the Longest or No Flip interpolation types
- Expressions support a limited range of node types (I currently only support transforms, aim/orient/point constraints, and some custom nodes that I made for Maya)
- No support yet for getting attributes or executing MEL on-demand inside expressions (e.g.
$var = `getAttr pSphere1.tx`;) - Unity only lets you set Euler rotations using zxy order
- I have not yet finished adding quaternion decomposition for arbitrary rotation orders, so you can only get Euler rotations in zxy (hint: if you’re still using Euler angles, it’s time to step up to flavor town)
- Euler angles can be set to any value, but since they are decomposed from a quaternion they can only be obtained as the shortest arc from [-180,180]
- I have not yet implemented functionality to build game code from node networks
Wadam, you’re a beast. This is very impressive tech.. wish I had a project to use it in!
nice!
keep it up.
Very cool
I wish I can use this tool in my next project which will happen in next semester.
Super Cool Hugo
This is very cool. Been hoping for a long time that someone would explore Maya python -> Unity python. Been musing wistfully about bringing my rigs from Maya to Unity or prototyping interactivity in Maya.
Don’t know python yet, but I do character rigging and direct Unity development. If you would like somebody to test and give feedback. I would enjoy doing that.
Cheers
Barrett Fox
@protodeep