Feedback

What's your question?

By: [ Editor ] Asked

Write color array into a specific vertex color set

I'd like to write color per vertex data into a vertex color set from a deformer, but has some problems specifying the specific color set: the data seems to be added to the currently active color set instead. What is the proper way of doing this? (I'm using MFnMesh.setVertexColors to write the data.)

Add comment viewed 146 times Latest activity 11 months ago

or Cancel

2 answers

  • 0

mr grumpy [ Editor ]

I would've said call MFnMesh::setCurrentColorSetName first, but that probably won't work from a deformer (I haven't tried it). What does work from a node compute is clearColors, setColors, then assignColors, where the assign will take a per-vertex-per-face list of indices. Each of those will let you specify a color set name. The color set will have to exist on the mesh beforehand, you won't be able to create it within the node (well, maybe you can, but I haven't found a way yet), so put a createColorSet node upstream.

or Cancel