[Closed] worldAlignPivot scaled obj
please help –
-
how to worldAlignPivot object if the object is nouniformal scaled?
-
how to get correct obj.min.z if the obj was rescaled and if I don’t want to use ResetXForm obj?
-
how to remove ResetXForm keeping the objects previous transform, rotation and scale – without collapsing?
2 – loop through all verts and find the one with lower Z position.
3 – you want to remove ResetXform without collapsing the stack, but keep the object’s transformation the same as when the ResetXform was applied?
1: I think you must collapse at least the scale part of the transform to accomplish this. You should look into the matrix3 type and it’s properties and methods.
2: don’t you? I at least get different result after a scale, but didn’t look into it much…
3: you could do something like this:
tmp=$selection[1].modifiers[1].gizmo.transform
tmp2=$selection[1].position
deletemodifier $selection[1] 1
$selection[1].transform=tmp
$selection[1].position=tmp2
Thank you, Neuro69!
I’m satisfied with 3rd point! Thank you so, much!
The last question now I have is with the main 1st question. How to collapse the scale part of the transform?
Well, in order to collapse the scale, you have to manipulate the vertices in some way, either directly or through applying/collapsing the XForm. Script for the last option:
resetxform $selection[1]
collapsestack $selection[1]
worldAlignPivot $selection[1]
However, if you want to combine this with restoring the original transform, I’m perhaps a bit out of my depth…but it seems to me that all thats really missing is to apply the original rotation? That is, rotate the object first by the negative of the original rotation, resetxform/collapse and then rotate forward? Or rotate the pivot directly, if possible… some combination of .transform and .objectOffsetRot/.objectOffsetTransform.