Notifications
Clear all
[Closed] Setting Vertex Colors in MAXScript
Jan 16, 2008 5:45 am
I need to be able to set vertex colors programmatically. Here is an example of the code I am trying to run and the error that I get. Can anyone help me out?
verts = #([1,1,0],[-1,1,0],[-1,-1,0],[1,-1,0])
faces = #([1,2,3],[1,3,4])
m = mesh vertices:verts faces:faces
setvertcolor m 1 [1,50,200]
– Runtime error: Mesh Color-per-vertex vertex index out of range: 1
2 Replies
Jan 16, 2008 5:45 am
Have a look at setnumcpvverts in the reference.
verts = #([1,1,0],[-1,1,0],[-1,-1,0],[1,-1,0])
faces = #([1,2,3],[1,3,4])
m = mesh vertices:verts faces:faces
setNumCPVVerts m m.numverts
defaultVCFaces m
setvertcolor m 1 [1,50,200]