/* NAME: dbMultiParent.mel VERSION: 1.0 CATEGORY: Rigging FUNCTION: A script that parents multiple selected objects into a heirarchy with the parent being the first selected object. A lot of times you may want to parent multiple objects down a heriarchy (a joint chain for instance). Instead of selecting the child, parent, and then hitting "p" multiple times, use this to save some clicks. USAGE: 1. Copy the dbMultiParent.mel into your Maya Scripts directory (Usually found in "My Documents\maya\\scripts\"). 2. Select the objects you want from the parent down through the children. 2. In the Maya Script Editor, type in "source dbMultiParent.mel; dbMultiParent;" AUTHOR: David Bokser E-MAIL: me@davidbokser.com WEBSITE: www.davidbokser.com */ // // Parents multiple selected objects into a // heirarchy with the parent being the first // selected object global proc dbMultiParent ( ) { string $selected[] = `ls -sl`; int $n = `size $selected`; print $n; int $i; int $pre; for ($i = $n - 1; $i > 0; $i--) { select -r $selected[$i] ; $pre = $i - 1; select -tgl $selected[$pre] ; parent; } for ($i = $n - 1; $i >= 0; $i--) { select -r $selected[$i] ; joint -e -oj yzx -secondaryAxisOrient yup -zso; } }