Exporting Vertex Colors to Texture via MEL


#1

I’m writing a bunch of data to vertex colors and need to export them as per-pixel textures. This works great if I go into the Paint Vertex Color Tool settings and export manually by hand, but why isn’t there an easy way to do this with scripting?

The command in question is artExportAttrMapCB … There is not a lot of information online when I search and definitely no information in the docs. I’ve done some digging in the

string $pathFilename = “C:/temp/myExport.tif”;
string $meshObject = “pPlane1”;
int $x = 32;
int $y = 64;

artSetToolAndSelectAttr( “artAttrCtx”, “mesh.” + $meshObject + “.vertexColorRGB” );
artExportAttrMapCB ("artAttrPaintVertexCtx -efm 1 -eft “TIFF” -fsx " + $x + " -fsy " + $y) $pathFilename “map”;

This code only works if I have manually exported the map by hand from the tool settings dialogue, after that this works perfectly fine. This is unfortunately not desired.

I’ve dug all around in the artisanCallback.mel script found in the \Maya2016\scripts\others\ were the artExportAttrMapCB proc is, unfortunately there isn’t much info to help debug how to get this to work :frowning:

Anyone have any luck on this?

Seth