Notifications
Clear all

[Closed] pivot alignment

Post max file anyway. Why not?

on which max version are you?

link to max version from 2010 to 2013 + exported 3ds

https://www.dropbox.com/s/3zdt8yskgg3ac84/pivot%20test.zip

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

I’ll check it next week

great, thank you…

So now you’re talking about ALIGNING pivots and not about FLIPPING, aren’t you?

1 Reply
(@jinj)
Joined: 11 months ago

Posts: 0

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.

Page 7 / 7