ScriptSpot home

Forum topic · General Scripting

how to scale a separate face for EditablePoly ???

By andrej · 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)
andrej

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
)

Reply to andrej
Vojtech Cada

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.

andrej

cool.....

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