Useful tutorials

During my internet explorations I’ve discovered Zeth Willie.
He does Maya Tutorials and posts them on Vimeo. He explains himself and Maya very clearly, which is great for beginners and advanced users alike.

His introduction to Python is something all Maya users should watch :)

Have a look:
http://vimeo.com/67579845

Zeroing out. Or in.

Today I wrote a little tool that simply groups whatever you have selected, for the purposes of cleaning up transforms. Also works with multiple objects selected and groups them all under a group in the same worldspace as the first selected object.
Grab the code here and place it on your shelf.

import maya.cmds as cmds
import maya.OpenMaya as om

grpList = cmds.ls(sl = True)

parentObj = cmds.listRelatives( grpList[0], parent = True )
cmds.group( em = True, name = grpList[0] + '_Zero_GRP' )
cmds.parentConstraint( grpList[0], grpList[0] + '_Zero_GRP' )
cmds.delete( grpList[0] + '_Zero_GRP_parentConstraint1' )
cmds.scaleConstraint( grpList[0], grpList[0] + '_Zero_GRP' )
cmds.delete( grpList[0] + '_Zero_GRP_scaleConstraint1' )
cmds.parent( grpList[0], grpList[0] + '_Zero_GRP' )
try:
    cmds.parent( grpList[0] + '_Zero_GRP', parentObj )
    om.MGlobal.displayInfo( grpList[0] + ' now has a group above it' )
except:
    om.MGlobal.displayInfo( grpList[0] + ' has no parent object, grouped in world space' )

cmds.select( grpList[0] )
newParent = cmds.listRelatives( parent = True )
listEndNumber = len(grpList)
remainingObj = grpList[1:int(listEndNumber)]

for i in remainingObj:
    cmds.parent( i, newParent )

om.MGlobal.displayInfo( grpList[0] + ' now has a group above it' )