ScriptSpot

Forum topic · General Scripting

how to scale a separate face for EditablePoly ???

By Any · 2020-08-09

Description

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 (4)

Any · 2020-08-11

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
)

polyop.getVerts

Swordslayer · 2020-08-11

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 · 2020-08-10

cool.....

Swordslayer · 2020-08-10

(
	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
)