I have a set of polygons selected (called myFaces
). After that, I know I must convert the selection to vertices with
verts = polyop.getVertsUsingFace $ myFaces
and then apply any transformation using the center of those verts.
How do I calculate the center of those vertices?
Edit: I specifically need to use vertices and not faces.
There's no shortcut, you have to calculate the center yourself, i.e.
fn getSubObjCenter obj verts center:[0, 0, 0] =
(
for vert in verts do
center += polyOp.getVert obj vert node:obj
center / verts.numberSet
)
obj = selection[1]
verts = polyOp.getVertsUsingFace obj #all
getSubObjCenter obj verts