I didn't find a simple way to display a flat shaded viewport. So here is a simple script to toggle the viewport with a flat shaded view, usefull to see silouhette when animating. This mel script create a global render layer with a surface shader material override, to change the flat color just modify the surface shader.
// TOGGLE FLAT - using render layer global proc toggleFlat () { if (`editRenderLayerGlobals -q -currentRenderLayer` == "defaultRenderLayer") { // Check if Render Layer FLat exists or create it if (`objExists "RL_FLAT"`) { editRenderLayerGlobals -currentRenderLayer RL_FLAT; } else { createRenderLayer -n "RL_FLAT" -number 1 -makeCurrent -global; // SHADER /// string $shadName = "SH_FLAT"; // Check if Shader doesn't exists and create it if (!`objExists $shadName`) { $shader = `shadingNode -n $shadName -asShader surfaceShader`; setAttr ($shader + ".outColor") -type double3 0.7 0.7 0.7; } hookShaderOverride("RL_FLAT", "", "SH_FLAT"); editRenderLayerGlobals -currentRenderLayer RL_FLAT; } headsUpMessage "FLAT ON"; } else { editRenderLayerGlobals -currentRenderLayer defaultRenderLayer; headsUpMessage "FLAT OFF"; } } toggleFlat ();
No comments:
Post a Comment