Hello, I am noob in 3dsMax Scripting.
I wrote a script to convert all vertex color to white. it works ok if I only select one object.
But If I select more than one object. It causes an Error. like this
Unknown property: “setVertColor” in undefined
here is the script.
Fn setAllVertexColor arrObj ColorSel:[1, 1, 1, 1] =
(
for eachObj in arrObj do
(
print eachObj
--print (classOf eachObj)
if (classOf eachObj == Editable_mesh) or (classOf eachObj == Editable_Poly) do
(
local VertexCount = eachObj.verts.count
--print VertexCount
v = PaintLayerMod()
addModifier eachObj v
s = v.AcquirePaintState eachObj
for ver in 1 to VertexCount do
(
s.setVertColor ver ColorSel
)
v.ApplyPaintState eachObj s
collapseStack eachObj
)
)
)
x = selection as Array
setAllVertexColor x
Can any one help me identify where am I missing.