about vertex move

frist of all , I hope you forgive me
I am so sorry to ask a lot of questions with my curiosity.
i have Pyramid object
and i slelected 1 face
pls you can see my attched file
1. there is 3 vertexs
2. in that , i would like to move top vertex

topvext x.pos y.pos -> ( last min z vertex ) / 2

so i started this code
but next code , i don;t know at all

faceList = polyop.getFaceSelection selection[1]
faceVerts = polyop.getVertsUsingFace selection[1] faceList
vertPos = for v in faceVerts collect (polyop.getVert selection[1] v)

AttachmentSize
move_topvert.jpg281.45 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
miauu's picture

.

(
	if selection.count == 1 do
	(
		curO = selection[1]
		if classOf curO == Editable_Poly do
		(
			selFaceBA = polyop.getFaceSelection curO
			selFaceVertsBA = polyop.getVertsUsingFace curO selFaceBA
 
			maxZpos = -1e9
			topVertIdx = 0
			for v in selFaceVertsBA do
			(
				vZpos = (polyop.getVert curO v).z
				if vZpos > maxZpos do
				(
					maxZpos = vZpos
					topVertIdx = v
				)
			)
			--	"move top vert"
			if topVertIdx != 0 do
			(
-- 				polyop.moveVert <Poly poly> <vertlist> {<point3 offset>|<point3 offset_array>} node:<node> useSoftSel:<bool>
 
-- 				polyop.setVert <Poly poly> <vertlist> {<point3 pos>|<point3 pos_array>} node:<node=unsupplied>
			)
		)
	)
)
dussla's picture

code work well

really thank you

again thank you

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.