SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.


SM Forums / Maya Questions / Programming / set pivot on lowest vertex

Programming MEL Scripts, Expressions & Programming Related Topics

Join the conversation. Reply to post
 
Thread Tools
08-01-2016, 10:59 AM   #1
kmthrong
Registered User
 
Join Date: Jan 2016
Posts: 3
set pivot on lowest vertex
Hi I wanna set pivot on the lowest vertex of an object.So what I wanna do is not that confusing but cause I'm not a programmer I shall ask this so I know that I have to use min command so first how to get all vertex transformation of the object?I mean for getting the transformation of 1 vertex for example vertex 1 I can use this:
string $obj = "myObject";
float $pos[] = `xform -q -ws -t ($obj + ".vtx[1]")`;
So here I wanna get All of vertexes and if I write ($obj + ".vtx") It won't work and errors so I have to first get All of transformations as I think then I use min command like:
min $pos
But again doesn't work cause $pos is all X Y Z but I only want min command for Xs to find the minimum so it won't work another problem is min command works like this:
min -4 -6
/result:-6/
But when I print
print $pos;
I get:
-6.96213
13.486041
-65.218454
On three separate lines which won't work again plz help me.
  Reply with quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Precise Editing: Pivot Point diazdevinr Maya Modeling 3 25-07-2017 12:50 AM
Cannot permanently set the pivot of my group! AtaurRaziq Animation 1 25-01-2016 12:06 AM
very simple Melscript needed...move selected object to origin (0,0,0) juggler7 Maya Basics & Newbie Lounge 35 14-07-2015 02:12 AM
Textures not linking to tutorial maya.... dan003 Maya Basics & Newbie Lounge 2 07-03-2015 11:08 PM
set display size vertex Axel Maya Basics & Newbie Lounge 1 22-06-2005 02:21 AM