|
I would like to learn some code and add it to my nice Mel Folder that I have created on my desktop. But there is one problem… I need you to give it to me. Alright… enough with the cute talk…
I need to know the mel code to make a pivot tool snap to a different location. I either need the mel to move a pivot tool to a coordinate location, or to move the pivot tool based on the vertex I have selected.
Once I have moved the pivot point I will be able to move onto the next step. I would like to be able to select the object who owns the modified pivot point and snap another objects pivot point to that one while moving the object in the process.
The ultimate objective is to move the pivot points of both objects then snap one object to the other based on pivot points.
|
|
|
|
I have some pictures but i dont know how to post them.
|
|
|
|
Take a look at the xform command in the Mel Command Reference.
|
|
|
|
This is a quick script I made to create a locator at the center of any poly based selection. This might help you along.
//Author: Robert Vignone - 11/06/2009 - http://www.robertvignone.com
//Creates a locator of the center of your selection (Verts/Edges/Faces/PolySurfaces/Grouped Polygons)
//No NURBS!
//Version 1.0
global proc r_getPivot()
{
PolySelectConvert 3;
string $sel[] = `ls -sl`;
string $clus = `CreateCluster`;
string $tmp[] = `ls -sl`;
float $loc[] = `xform -q -ws -piv $tmp`;
delete $tmp;
string $mkLocator = `CreateLocator`;
string $myLctr[] = `ls -sl`;
setAttr ($myLctr[0] + “.translateX") $loc[0] ;
setAttr ($myLctr[0] + “.translateY") $loc[1] ;
setAttr ($myLctr[0] + “.translateZ") $loc[2] ;
rename $myLctr “tehPivot”;
}
r_getPivot;
Robert Vignone
http://www.robertvignone.com
Win 7 | I7 @ 3.6ghz | 24GB DDR3| GTX580 |
|
|
|