maya to max: Workflow to export Morpheus rig animation

The week before Christmas, my cousin Ty (website) was visiting to hang out and talk shop. He’s in school for character animation and I have a background in experimental animation. We decided to work on a short mini project while he was staying and we got right to work on it the day he arrived. He chose the Morpheus rig to use for our main character (why?). This rig was created by Josh Burton (website), he also was our saviour and finding a way to bring the character animation from Maya into 3dsMax.

So here’s what we did!

First after creating the character animation we used Josh’s Mel script to make the character mesh selectable -

//turn on selectability
//hand
setAttr “hand_left_grp.overrideEnabled” 0;
//hand
setAttr “hand_right_grp.overrideEnabled” 0;
//body
setAttr “all_anim|Geo_grp.overrideEnabled” 0;
//face
setAttr “FacialRig_grp|Geo_grp.overrideEnabled” 0;

Next, we put that geometry into a set, and then used a Python script that Josh supplied us -

import maya.cmds as mc
def returnAllDeformers(obj):
“”"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ACKNOWLEDGEMENT
Pythonized from – http://www.scriptswell.net/2010/09/mel-list-all-deformers-on-mesh.html

DESCRIPTION:
Returns a list of deformers on an object in order from top to bottom

REQUIRES:
obj(string)

RETURNS:
deformers(list)/False
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
“”"
objHistory = mc.listHistory(obj,pruneDagObjects=True)
deformers = []
if objHistory != None:
for node in objHistory:
typeBuffer = mc.nodeType(node, inherited=True)
if ‘geometryFilter’ in typeBuffer:
deformers.append(node)
if len(deformers)>0:
return deformers
else:
return False

 

def polyUniteGeo(objList,name=’unitedGeo’):
“”"
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
DESCRIPTION:
Unites polys with the poly unite command. Every piece of geo must have
a deformer node with an .outputGeometry

REQUIRES:
objList(string)
name(string) – base name for the geo and node created

RETURNS:
returnList = [unifedGeoName,polyUniteNode]
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
“”"
geoOutNodes = []

“”" get all of the outMesh possibilities”"”
for obj in objList:
outGeoNode = False
deformers = returnAllDeformers(obj)
for i in range(len(deformers)):
if mc.objExists(deformers[i]+’.outputGeometry’) == True:
outGeoNode = (deformers[i]+’.outputGeometry’)
geoOutNodes.append(outGeoNode)
if outGeoNode != False:
break

if len(geoOutNodes) != len(objList):
print “Don’t have connections for all geo pieces”
return False

“”" make the node “”"
unitedGeoBuffer = mc.polyUnite(geoOutNodes,name=(name+’_polyUnite’))
unitedGeo = unitedGeoBuffer[0]
uniteNode = unitedGeoBuffer[1]
uniteNode = mc.rename(uniteNode,(name+’_polyUniteNode’))

“”" Connect the various pieces to the polyUnite”"”
for obj in objList:
index = objList.index(obj)
mc.connectAttr((‘%s%s’% (geoOutNodes[index],’[0]‘)),(‘%s%s%i%s’% (uniteNode,’.inputPoly[',index,']‘)),f=True)
mc.connectAttr((‘%s%s’% (obj,’.worldMatrix[0]‘)),(‘%s%s%i%s’% (uniteNode,’.inputMat[',index,']‘)),f=True)

return [unitedGeo,uniteNode]

This script doesn’t appear to do anything, but then you run this other Python script that Josh shared with us -

import maya.cmds as mc
geo = mc.ls(sl=True)
TheNameYouWant = ‘ThisIsMyNewName’
polyUniteGeo(geo,name=TheNameYouWant)

The only thing you’ll wanna change is the ThisIsMyNewName text to whatever you want the base name to be.
At this point there will be a new item in the Outliner, ThisIsMyNewName_polyUnite. Select it, and run a Geometry Cache.

Cache settings:
Cache directory/name, named relevant to scene and animation
File distribution: One file
Store points as: Float
Cache time range: [whatever range necessary]
Create!

Then toss the mesh into a Set, and while it is still selected go and export selected!

Exporting the FBX, animation checked – everything in animation is unchecked except Geometry Cache File(s), where you also pick the set that you created which will have your polyUnited geo. Export!

Tags: , , , , , , , , , ,

Leave a Reply