Thursday, March 25, 2010

Cleaning graph layouts

When working in slim and using an auto maya shading group > slim script, slim will generate a graph layout for every node. For me, I like to work with a single graph layout, like in Shake. You could delete the layouts one by one, or you can read on, it'll be slightly different what with all the different pipelines. Here's my workflow, 1. reference the rigging file 2. save as 3. export the maya shaders into slim, it'll generate all the necessary connections, textures > diffuse > delux > ensemble, and a billion layouts. 4. in slim, select all your nodes, thus grouping all the nodes into one graph, and rename the graph to "all" 5. export your slim palette, our company has an auto export script which will export the palette, the attach mel, the meta file, and the aov all at once. If not, you'll have to manually do this part. 6. find your palette, open with text editor, search for layouts, it look something like this, graphlayouts { layout Diffuse_layout { arrangemethod auto roots 1400_DXwEjq30000 traversemethod upstream scroll {{} {}} transforms {1 {0 0}} } 7. delete all the layouts between graphlayout {} except the one you made, "all". 8. save. open, attach the palette.

Friday, March 12, 2010

texture, object, uniform mattes

define AOVs by specifying primvars with the correct type. uniform if its the same color throughout the surface, ie holdout mattes varying if it has different colors through the surface.


output varying color matte_name;  

extern color matte_name = v1;
result = 0; 

To specify per object mattes would be to use attribute() and match() functions to assign colors to groups or single objects. For example,


string xxoo; attribute("identifier:name", xxoo); 
if (match("cubeShape10",xxoo)) 
    extern color matte_cubes = color(r,0,0);
else if (match("cubeShape20", xxoo)) 
    extern color matte_cubes = color(0,g,0); 
else if (match("coneShape30",xxoo)) 
    extern color matte_cones = color(r,0,0);

 So, the above code writes to two mattes, cubes and cones, in which cubeShape10 will be red and cubeShape20 will be green in matte_cubes.