[Closed] Align pivot to vetex numbers
Hi!
I need a script to align pivot to a fixed vertex number of multiple objects.
Here is the situation: we have 100 planes, they are rotated and skewed as a result of a path deform so I can’t use Soulburn PivotUI placer script because their bounding boxes are not aligned to the planes. I know that every plane has the vertex number 6 where I want the pivot to be. So I think it could be possible to write a script to align the pivot to every object’s 6th vertex.
Can you help me?
Thank you!
Select the planes and use:
- for editable_poly objects
for o in selection do o.pivot = polyop.getVert o 6
- for editable_mesh objects
for o in selection do o.pivot = meshop.getVert o 6
- for primitives
for o in selection do
(
addModifier o (Edit_Mesh())
o.pivot = meshop.getVert o 6
deleteModifier o 1
)
Hi Kostadin this is a coincidence, we have same number of post:)
@stecca You can translate this in one line
for o in selection where isKindOf o geometryClass and not isKindOf o TargetObject do o.pivot = (getVert o.mesh 6)*o.transform
My bad. Shorter version works
for o in selection do o.pivot = o.center+(getVert o.mesh 6)
BTW we talk about “c” in my name:)
Cheers friend.
it should not work in case of any rotation. the previous version was better. just needed a little correction.