[Closed] pivot alignment
link to max version from 2010 to 2013 + exported 3ds
if you can open one of the max scene… you’ll find 3 layers.
-body object imported from sat. you can see how the script affect them
-imported 3ds… pivot are aligned
-imported 3ds instanced… turning it on you’ll notice the slightly difference after instancing, just on some of the pieces, because of the slightly difference in realignment.
thank you
So now you’re talking about ALIGNING pivots and not about FLIPPING, aren’t you?
your script reorient the pivots, it align the pivot by checking the geometry and it’s orientations (i guess). on some geometries it generates pivots that compared to other are just flipped, the other script correct this.
but on other geometries, the pivots looks like they were not just flipped but show a small rotation on all axis.
if you check on the 3ds layer, you’ll notice that the geometries are all quads, no errors in them and the script generates these slightly differences too.
on small little geometries, it’s not a problem, because the difference after instancing is very little… but on big parts it becomes visible.
i hope to have answered to your question.
hi, yesterday a guy came with a suggestion that seam to have near by fixed the slightly difference in the pivots positions.
here the explanation and the script:
“…but if I can guess, I think it might be because max centered the pivots to the center of bounding boxes, which is different when the bounding boxes are oriented different ways in relation to the object. So it should help to center them pior exporting (not possible) or via script. Something like add all the positions of all the
object points and divide by their count; this is how I would do it
(untested and might not work at all; needs all selected objects to be
editable poly):
(
fn centerObjPivot obj =
(
local verts = obj.verts as bitarray
local sum = 0
for vert in verts do
sum += polyop.getVert obj vert
obj.pivot = sum / verts.count
)
local objs = selection as array
for obj in objs do
centerObjPivot obj
)
“
well it seams to work, this the way i got it working:
> 1 select geometries
> 2 reset XForm
> 3 run the above script
> 4 running a collapse stack script
> 5 running your reorienting pivots scripts
> 6 center pivots from hierarchy panel in max
> 7 run a instance script
> 8 done
the position difference after instancing is really minimal, see image, the in blue one is the not edited geometry. and this happen in the case of a complex geometry… .
it doesn’t work as solution for bodyobjects, obviously after having converted the bodyobjects into editablepoly or have added editpoly modifier, wont work.