Notifications
Clear all

[Closed] display vertex colors

 rdg

How to display vertex colors in the viewport with max script?

b = box()
convertToPoly b
addModifier b (vertexpaint())

I found no way to toggle the “vertex color display – shaded button” …
But there is maybe onther way.

thank you.

Georg

2 Replies

If you are just trying to show the vertex colors in the viewport you can use:

setCVertMode <node> <boolean>

You’ll have to force a viewport refresh afterwards.

–Jon

 rdg

Node Common Properties, hm.

-- create a box and convert it to poly
b = box()
convertToPoly b
-- apply shades of gray
for i = 1 to polyOp.getNumFaces b do (
	val = (random 0 255)
	polyOp.setFaceColor b 0 #{i} (color 0 (255-val) val)
)
-- instance a standardmaterial with vertexColor in diffuse and apply
m = standard()
m.diffusemap = vertex_color()
b.material = m
-- set the display modes to display vertex colors
setCVertMode b true
setShadeCVerts b true

-- required
select b
redrawViews()
-- ---
clearSelection()