Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Get the name of the selected node only if it's a joint
- string $select[] = `ls -sl -type joint`;
- // Check to make sure we have at least one joint selected
- if (size($select) == 0)
- error ("You have no joints selected.\n");
- // Strip the join name to a base name
- string $basename = startString($select[0],((size($select[0]))-4));
- // Take the base name and make two pads
- group -empty -name($basename + "pad1");
- group -name($basename + "pad0");
- // Combine the base name and pad name
- string $dpad0 = $basename + "pad0";
- // Set the root pad's rotation to the selected joint's
- setAttr ($dpad0 + ".rotateX") (getAttr($select[0] + ".jointOrientX"));
- setAttr ($dpad0 + ".rotateY") (getAttr($select[0] + ".jointOrientY"));
- setAttr ($dpad0 + ".rotateZ") (getAttr($select[0] + ".jointOrientZ"));
- // Do the same for translate
- setAttr ($dpad0 + ".translateX") (getAttr($select[0] + ".translateX"));
- setAttr ($dpad0 + ".translateY") (getAttr($select[0] + ".translateY"));
- setAttr ($dpad0 + ".translateZ") (getAttr($select[0] + ".translateZ"));
- // Parent the selected joint under the child pad
- parent $select[0] $dpad1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement