[Closed] Help with Aligning all objects Pivots
hello,
I would like to select all the objects and align all of their pivots to (0,0,0)
for i in 1 to 10 do
(
sphere radius:(i*10) position:[i^2*10, 0, 0]
torus radius1:(i^2*10) radius2: 2 segs: 32
)
As you can see i have mastered the art of translocating and extracting key intel from the mind of maxscripts creator. This has proven invaluable for my quest to rule the maxscript world.
Any tips or hints would be stellar.
If i had to guess I would probably use WorldAlignPivot
so maybe select $object WorldAlignPivot;
(obviously this doesn’t work, i was just hoping i didn’t have to write each name of every object)
What do you mean by align all of their pivots to (0,0,0) ?
Do you want all pivots to be at world 0,0,0
In this case you can use:
selection.pivot = [0,0,0]
The pivots of all of the selected objects will be at world [0,0,0]
Or you can set the position of the pivot when the obejcts are created:
(
for i in 1 to 10 do
(
sphere radius:(i*10) position:[i^2*10, 0, 0] pivot:[0,0,0]
torus radius1:(i^2*10) radius2: 2 segs: 32 pivot:[0,0,0]
)
)
Or if your objects are already created and you have them in an array then you can use:
(
objArr = for i in 1 to 10 collect
(
sphere radius:(i*10) position:[i^2*10, 0, 0]
)
--
objArr.pivot = [0,0,0]
)
WorldAlignPivot works this way
WorldAlignPivot selection[1]
-- or
WorldAlignPivot $Teapot01
--or
WorldAlignPivot selection
--or
WorldAlignPivot #($Teapot001, $Sphere001, $Box001)
:buttrock: :applause:
yes, you nailed it. I wanted the geometry objects’ pivots all set to the 0 world axis.
This brings up an interesting question to me,
looking at a sphere object in the autodesk maxscript geometry class page
http://docs.autodesk.com/3DSMAX/16/ENU/MAXScript-Help//index.html?query=sphere
there is no sign of a pivot property for a sphere.
Can you call properties on geometry class objects, such as a sphere, that are nested higher? Like properties that are in the Node or Wrapper levels?
Thanks for the help, i’m really shaky on arrays right now, so i used the pivot property at the end of my sphere and torus.