Align two objects
Mel Scripting January 31st, 2008
Description: This simple script could help you align 2 objects together. I put an option you could turn on if you like the object to be orientated as well. First, select the target object which you want to align to and then shift select the object that will get aligned.
global proc s_alignObjProc()
{
string $sel[]=`ls -sl`;
int $stateCb =`checkBox -q -v alignObjCB`;
if ($stateCb == 0)
{
delete `pointConstraint $sel[0] $sel[1]`;
} else
{
delete `parentConstraint $sel[0] $sel[1]`;
}
}
//Below is a simple window
if (`window -exists alignObjWindow`)
{
deleteUI alignObjWindow;
}
window -t "Align Objects" alignObjWindow;
rowColumnLayout -numberOfRows 2;
button -w 128 -bgc 0.95 0.75 0.75 -label "Align objects" -c s_alignObjProc;
checkBox -al "center" -label "with orientation" alignObjCB;
setParent..;
showWindow alignObjWindow;
December 17th, 2008 at 3:53 am
studing it ,I learn more things,especially “delete `pointConstraint $sel[0] $sel[1]`;”,
thanks
December 17th, 2008 at 10:25 am
You are welcome.
January 30th, 2012 at 1:56 pm
… [Trackback]…
[...] Read More here: foreachloop.com/blog/2008/01/31/align-two-objects [...]…
February 1st, 2012 at 3:57 am
… [Trackback]…
[...] Read More here: foreachloop.com/blog/2008/01/31/align-two-objects [...]…
February 1st, 2012 at 5:06 pm
… [Trackback]…
[...] Informations on that Topic: foreachloop.com/blog/2008/01/31/align-two-objects [...]…
February 2nd, 2012 at 4:50 pm
… [Trackback]…
[...] Find More Informations here: foreachloop.com/blog/2008/01/31/align-two-objects [...]…
February 5th, 2012 at 5:52 pm
… [Trackback]…
[...] Read More here: foreachloop.com/blog/2008/01/31/align-two-objects [...]…