Notifications
Clear all

[Closed] polyOp.setVert – change 1 coord?

Hi, I was wondering if there is a simple way to change 1 coord of selected verts in a Epoly object. the polyOp.setVert method accepts a point3, but I want to only change 1 axis, so how could I do this?

The way I used to do it was use $.selectedVerts and set their pos.x attribute, but that wont work on a poly object with certain modifiers on top. Also if you get the current modifier from the stack and use that, the selectedVerts property doesnt exist for some reason.

Any ideas?

3 Replies

hi,

maybe this is too simple but is that what your looking for?

bleet = polyOp.getVertSelection $
for i in bleet do

(

blah = polyop.getvert $ i

blah += [0,0,2]

polyOp.setVert $ i blah

)

mark

hmm, but doesnt your example add 2 units to the z axis? I just want to Set the value to an absolute, not relative.

thanks

hi,
you didn’t specify that in the original question!
anyway here is the answer

bleet = polyOp.getVertSelection $

for i in bleet do

(

blah = polyop.getvert $ i

blah.z = 10

polyOp.setVert $ i blah

)