Not sure how many people are going to use something like this, but I thought I’d share just in case.
Considering the network for the mip_ shaders (in this case for compositing) is ridiculous, this helps it along. This network is based on what’s seen here:
http://forums.cgsociety.org/showthread.php?f=87&t=541718&page=2&pp=15&highlight=mip_cameramap
Select camera and run.
global proc setMipBG(){
string $sel[] = `ls -sl`;
string $selShapes[] = `listRelatives -f $sel[0]`;
string $camPath = $selShapes[0];
// GLOBAL NODES //
string $emptyAlpha = `mrCreateCustomNode -asUtility "" mib_color_alpha`;
setAttr ($emptyAlpha+".factor") 0;
// CAMERA NODES //
string $cEnv = `mrCreateCustomNode -asUtility "" mip_rayswitch_environment`;
string $cHdr = `mrCreateCustomNode -asUtility "" mip_mirrorball`;
setAttr ($cHdr+".degamma") 2.2;
// MATERIAL NODES //
string $mEnv = `mrCreateCustomNode -asUtility "" mip_rayswitch_environment`;
string $mCmap = `mrCreateCustomNode -asUtility "" mip_cameramap`;
setAttr ($mCmap+".degamma") 2.2;
string $ms = `mrCreateCustomNode -asShader "" mip_matteshadow`;
// CAMERA CONNECTIONS //
connectAttr -f ($cEnv+".message") ($camPath+".miEnvironmentShader");
connectAttr -f ($emptyAlpha+".outValue") ($cEnv+".background");
connectAttr -f ($emptyAlpha+".outValueA") ($cEnv+".backgroundA");
connectAttr -f ($cHdr+".outValue") ($cEnv+".environment");
connectAttr -f ($cHdr+".outValueA") ($cEnv+".environmentA");
// MATERIAL CONNECTIONS //
connectAttr($emptyAlpha+".outValue") ($mEnv+".background");
connectAttr($emptyAlpha+".outValueA") ($mEnv+".backgroundA");
connectAttr($mCmap+".outValue") ($mEnv+".environment");
connectAttr($mCmap+".outValueA") ($mEnv+".environmentA");
connectAttr ($mEnv+".outValue") ($ms+".background");
connectAttr ($mEnv+".outValueA") ($ms+".backgroundA");
}
Feel free to tear it up, but for me I run this script when I’m ready to start the rendering-for-compositing home stretch. Gets the nodes connected up (sans textures/shading groups) and I can apply it to different cameras/export with ease.