Monday, October 17, 2016

hiding Arnold channels on shapes



Man, those keyable and visible channels on mesh and curve shapes are super annoying. I have no idea what they do, and have never really understood why they are all there .. but Arnold adds them, and for some reason. Ignores requests to hide them, which is interesting, cause to hide them, is super easy .. 



 so. I wrote a simple script to hide arnold channels,, It's not automatic, so every new mesh or curve needs to have it run, and sometimes when doing mesh separate and mesh combine operations, a new mesh object is created, so the channels are created fresh on the new object.
 


 I just put the script on my shelf and randomly hit it, like a gerbil hitting the space bar for food in a pysch 101 class experiment. 



You don't need anything selected, it just grabs all nurbs curves , and all mesh shapes, and hides the channels,... ( and of course can be reverse engineered if you ever want to show the channels again ) 

here's the script: 

// stephenkmann@gmail.com
// just a quick way to hide all the arnold channels that are added to shapes
global proc hideArnoldChan()
{
string $meshes[] = `ls -type "mesh"`;
for ($mesh in $meshes   )
    {
    setAttr -keyable false -channelBox false ($mesh + ".ai_shadow_density");
    setAttr -keyable false -channelBox false ($mesh + ".ai_exposure");
    setAttr -keyable false -channelBox false ($mesh + ".ai_diffuse");
    setAttr -keyable false -channelBox false ($mesh + ".ai_specular");
    setAttr -keyable false -channelBox false ($mesh + ".ai_sss");
    setAttr -keyable false -channelBox false ($mesh + ".ai_indirect");
    setAttr -keyable false -channelBox false ($mesh + ".ai_volume");
    setAttr -keyable false -channelBox false ($mesh + ".ai_use_color_temperature");
    setAttr -keyable false -channelBox false ($mesh + ".ai_color_temperature");
    setAttr -keyable false -channelBox false ($mesh + ".scr");
    setAttr -keyable false -channelBox false ($mesh + ".scg");
    setAttr -keyable false -channelBox false ($mesh + ".scb");
    setAttr -keyable false -channelBox false ($mesh + ".intensity");
    setAttr -keyable false -channelBox false ($mesh + ".emitDiffuse");
    setAttr -keyable false -channelBox false ($mesh + ".emitSpecular");
    }
    
    
string $nurbsCrvs[] = `ls -type "nurbsCurve"`;
for ($crv in $nurbsCrvs)
    {
    setAttr -keyable false -channelBox false ( $crv + ".rcurve");
    setAttr -keyable false -channelBox false ( $crv + ".cwdth");
    setAttr -keyable false -channelBox false ( $crv + ".srate");
    setAttr -keyable false -channelBox false ( $crv + ".ai_curve_shaderr");
    setAttr -keyable false -channelBox false ( $crv + ".ai_curve_shaderg");
    setAttr -keyable false -channelBox false ( $crv + ".ai_curve_shaderb");
    }

}

No comments:

Post a Comment