Notifications
Clear all

[Closed] Scaling vertices locally

Hello all,
I need to scale vertices on the local coordinate system, I currently using the code:

theCenter = selection.center  --sets the center as the center of the selection
for v in frameSizeVerts do --for each individial vertex
(
	currentVertPos=polyOp.getVert $ v  --gets current postion of the vertex
	currentVertPos=((currentVertPos*(transMatrix -theCenter))*(scaleMatrix [(val/PrevSizeVal),(val/prevSizeVal),1]))*(transMatrix theCenter)  --changes current positon to new scaled position
	polyOp.setVert $ v currentVertPos  --changes the vertex location to the new location
)
prevSizeVal = val  --sets previous size for later use

but it doesn’t allow me to change the rotation of the object and still move the vertices in the same direction. from what i read i may need to use a space matrix and xformMat of some kind but I’m having a massively hard time find any info on it.
Thanks for any responses

Edit: Figured this out using the *= $.transform