Match translation “tool” for Maya

For those who have used XSI for anything have most likely encountered the very useful “Match translation” tool (and it’s variants). This tool exists in Maya but according to some it doesn’t work very well especially when within a hierarchy. So a solution was to constrain the object you want to move to the object that we want to match the translation to and then, in the outliner, delete the constraint. This obviously is very tedious especially if you want to this many times. So I decided to try creating my first mel scripts and created a set of scripts in a custom shelf that do this automatically. Here is the “Match translation” script: string $nodes[]; $nodes = `selectedNodes`; pointConstraint -name tmpconstraint -offset 0 0 0 -weight 1; select -r tmpconstraint; delete; select $nodes[size($nodes)-1];

This script simply automates the steps listed above and the other variants (translation+orientation, orientation, scale) all work in almost the same way. These scripts work like this: you first pick the object that you want to match the translation to and second select the object you want to move and then hit one of the shelf buttons. Simple right? I like to use these script as marking menus and on that note I was thinking about creating a tutorial that shows how to add custom marking menus, since I guess that some people simply don’t know how to do that (but many of you do). That tutorial will hopefully be up soon. Anyway, you can find the script here and to install it you simply place it in

/Users//Library/Preferences/Autodesk/maya/8.5/prefs/shelves (on a mac)

and I can’t remember where to place it on other platforms.