how to scale a separate face for EditablePoly ???

good day.

Try to scale a separate face for EditablePoly
I try like this....

p = convertToPoly(Plane())
polyop.setFaceSelection p #{1}
scale $.selectedFaces [2,2,2]

returns - undefined

???

Comments

Comment viewing options

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

cool, but correctly write

cool, but correctly write so

(
local faceSel = #{1}
local poly = convertToPoly (Plane isSelected:on)
subObjectLevel = 4
polyop.setFaceSelection poly faceSel
local verts = polyop.getVertsUsingFace poly faceSel
local scaleTM = scaleMatrix [2,2,2] * inverse (maxOps.getTransformGizmoTM())
polyop.setVert poly verts (for v in verts collect (polyop.getVert poly v node:poly) * scaleTM) node:poly
)

Swordslayer's picture

polyop.getVerts

For any max version newer than 2018.2 that's the method you'd use, only for older max versions you'd go with getting the verts one by one.

Any's picture

cool.....

cool.....

Swordslayer's picture

 

(
	local faceSel = #{1}
	local poly = convertToPoly (Plane isSelected:on)
	subObjectLevel = 4
	polyop.setFaceSelection poly faceSel
 
	local verts = polyop.getVertsUsingFace poly faceSel
	local scaleTM = scaleMatrix [2,2,2] * inverse (maxOps.getTransformGizmoTM())
	local vertsPos = polyop.getVerts poly verts node:poly
	polyop.setVert poly verts (for v in vertsPos collect v * scaleTM) node:poly
)	

Comment viewing options

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