Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
Community
Maya Forum
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Change Default Pivot Postion to Bottom?

15 REPLIES 15
Reply
Message 1 of 16
andymc4997
7123 Views, 15 Replies

Change Default Pivot Postion to Bottom?

Hi, this may seem like a simple issue, especially for a MEL scripter, but I was simply wondering how I can preset the pivot point of any new poly object to align to the bottom. I like to be a bit more precise with my units, so I prefer to uncheck Interactive Creation and type in W H and D. 

 

Thanks in advance!

 

-Andy

15 REPLIES 15
Message 2 of 16
sean.heasley
in reply to: andymc4997

Hi @andymc4997

 

This would take some fancy scripting to have this change by default.

 

If anything, it would probably be easier to have a script be a button that you can press to set the pivot point to the bottom of the mesh when clicked as opposed to when the mesh is created.

 

 

 

 

Message 3 of 16
andymc4997
in reply to: sean.heasley

Hi Sean, and thanks for your reply!

 

A button would be fine as well. I guess I assumed it would not actually be hard to script, so thanks for the input there.

 

The process I currently follow is:

 

- After creating object, orbit and zoom to the bottom.

- Hold the D key and select the bottom-most component of the object to reset the pivot point to it.

- Enter 0 for the Y axis in the Absolute Transform area

 

This does seem easy enough, but when modeling multiple objects, it would save time if each new object's pivot point could be preset to the bottom. I'm in the process of modeling many different pieces of furniture and they need to always be "grounded" to the origin. Hope that makes sense.

 

Thanks again

Message 4 of 16
damaggio
in reply to: andymc4997

sometimes you can hack a little script from the script editor, here's a button from the Bonus tools pivot script.

Use all the time but don't ask me to change anything, I'm not a programmer.

I think you'll like it.

 

 

source bt_alignPivotToBoundingBoxWin; optionVar -q bt_CenterPivFirst; optionVar -q bt_IndividualBB; bt_alignPivotToBoundingBox 4;

python "import bt_zeroTransforms"; python "bt_zeroTransforms.run( mode='offset' )";

deleteUI bboxPivotUI;windowPref -remove bboxPivotUI;

 

 

Message 5 of 16
andymc4997
in reply to: damaggio

Hi damaggio,

 

Gosh, I suppose I should have looked around Bonus Tools more thoroughly, my bad :(. This will at least make it a little easier, and I do like how you can position the pivot to Min and Max locations from the pop up box. But I'm with you on the scripting side. I'm a graphic artist/designer who walks sideways from the weight of my right brain, so, Lol. 

 

Thanks! 

Message 6 of 16
andymc4997
in reply to: andymc4997

To just be clear however... what I would LOVE to happen is that I simply type in my Width Height and Depth figures and BAM, the object sits on the origin lined up to it's base. 

Message 7 of 16
mspeer
in reply to: andymc4997

Hi!

I would be glad if i had more time to do a tutorial on this.

But as a hint: The pivot is not the problem, the pivot of a new object is at ground-level, so there is no need to move it.

Message 8 of 16
andymc4997
in reply to: mspeer

The pivot is at the ground level? It certainly isn't for me, unless I'm just missing something right in front of me. For example, when I create a poly cube, the pivot is in the center, and the object is placed at the origin like so:

 

Capture.JPG

 

I would like for it to be like this:

 

Capture.JPG

Message 9 of 16
mspeer
in reply to: andymc4997

Hi!

 

The pivot is at [0 0 0] that's ground level, Y=0.

Message 10 of 16
andymc4997
in reply to: mspeer

Hi,

 

Perhaps then I didn't make myself clear. I want the base of the object AND the pivot to be at the ground level. 

Message 11 of 16
mspeer
in reply to: andymc4997

Hi!

You made it clear, but as said before currently i only have time for this short hint.

Message 12 of 16
andymc4997
in reply to: mspeer

Ok, completely understood. Time is in short supply.

Message 13 of 16
mb28
in reply to: andymc4997

You can use the following script to move the pivot to the bottom of your model. The MEL script centers the pivot, then grabs the bounding box for your selection and re-applies the centered pivot from X and Z while putting the lowest bounds of your object's bounding box into the Y portion of the pivot.  Enjoy!

 

float $bb[];
float $pivots[];

// center pivot on object
xform -ws -a -cp;
// store bounding box info into float array
$bb = `xform -q -ws -a -bb`;
//store centered pivots into pivot float array
$pivots = `xform -q -ws -a -piv`;
// set new pivots, X, Z from centered pivot, Y from lower bounding box
xform -ws -a -piv $pivots[0] $bb[1] $pivots[2];
Message 14 of 16
FlorianDubiel
in reply to: andymc4997

awesome, after 20 years I found it 🙂 My new Shortcut  Alt+p !!

Message 15 of 16
Labyrinth_Visual
in reply to: mb28

@mb28 Is there a way to tweak this so that it does the same thing to a range of objects at once?  I'm trying to do this for thousands of cards 😬

Message 16 of 16
hein101254
in reply to: andymc4997

Hello everyone, I found this entry after I created my own "multi object solution" to this theme. I hope you've finished your cards by now. Nevertheless, I'm sending you my script. Maybe someone can use it....

 

{

// https://www.hein-liessem.de
string $sel[] = `ls -sl`;

    for($i=0; $i < size($sel); $i++)
    {
    //print($sel[$i]+"\n");
    string $currentObj=$sel[$i];

    select($currentObj);
   CenterPivot;
   FreezeTransformations;

   float $oldpos[] = `getAttr $currentObj.rotatePivot`;
   float $Min[] = `getAttr ($currentObj + ".boundingBoxMin")`;
   float $Max[] = `getAttr ($currentObj + ".boundingBoxMax")`;
   float $sum[];

   $sum[1]=(($Max[1])-($Min[1]));
   $sum[1]= $sum[1]/2;

   xform -os -piv $oldpos[0] $Min[1] $oldpos[2] $currentObj;

   }
}

 

The curly brackets at the beginning and the end of the script prevent the "redeclaration error"

 

Have fun....

Tags (3)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report