****************************************************************************** * This file shows how to write a mental ray shader * that uses maya light linking. * Although mental ray for maya translates the light linking relationship * to the light list of the shader, * it can be still useful to modify the shader itself, * especially when the shader is used by muliple objects with different light linking. * * This exmple takes mib_illum_lambert as a starting point * (can be found at maya6.5/devkit/mentalray/shaders/public-baseshaders/baselambert.c) * and adds code for the light linking. * A header file mayaapi.h should be included which can be found at * maya6.5/devkit/mentalray/include * If Windows is the working environment, * mayabase.lib needs to be linked in addition to shader.lib. * Both libraries are located at * C:/Program Files/Alias/Maya6.5/devkit/mentalray/lib/nt *****************************************************************************/ connectAttr lightLinker1.message mib_illum_lambert_mayaLightlink1.lightLink; addAttr -ln "miLightLink" -at bool mib_illum_lambert_mayaLightlink1; setAttr "mib_illum_lambert_mayaLightlink1.mode" 2;