Difference between revisions of "ApplyNewMaterialWithFile"
From scripting
(Created page with " global proc ApplyNewMaterialWithFile(string $ObjName, string $NewLambertName, string $FileLoc, int $iii, float $R, float $G, float $B) { string $nicklambert = $NewLambertNam...") |
|||
Line 35: | Line 35: | ||
''More information on materials and shaders, read pages 128-141 in [http://stores.lulu.com/nickpisca YSYT]. | ''More information on materials and shaders, read pages 128-141 in [http://stores.lulu.com/nickpisca YSYT]. | ||
− | [[Category: | + | [[Category:MEL]] |
Latest revision as of 04:51, 22 April 2017
global proc ApplyNewMaterialWithFile(string $ObjName, string $NewLambertName, string $FileLoc, int $iii, float $R, float $G, float $B) { string $nicklambert = $NewLambertName+$iii; string $nickObjShape[] =` listRelatives pPlane1`; string $nicklambertSG = $NewLambertName+$iii+"SG"; string $nicklambertoutcolor = $NewLambertName+$iii+".outColor"; string $nicklambertSGsS = $NewLambertName+$iii+"SG.surfaceShader"; string $nicklamberttrans = $NewLambertName+$iii+".transparency"; string $nicklambertIncan = $NewLambertName+$iii+".incandescence"; string $nicklambertColor = $NewLambertName+$iii+".color"; string $nickfile = $NewLambertName+"File"+$iii; string $nickPlace2d = $NewLambertName+"Place2d"+$iii; shadingNode -asTexture file -n $nickfile; shadingNode -asUtility place2dTexture -n $nickPlace2d; string $PF[] = {".coverage",".translateFrame",".rotateFrame",".mirrorU",".mirrorV",".stagger",".wrapU",".wrapV",".repeatUV",".offset",".rotateUV",".noiseUV",".vertexUvOne",".vertexUvTwo",".vertexUvThree",".vertexCameraOne"}; for ($PFcount=0;$PFcount<size($PF);$PFcount++) { connectAttr -f ($nickPlace2d+$PF[$PFcount]) ($nickfile+$PF[$PFcount]); } connectAttr ($nickPlace2d+".outUV") ($nickfile+".uv"); connectAttr ($nickPlace2d+".outUvFilterSize") ($nickfile+".uvFilterSize"); AEassignTextureCB ($nickfile+".fileTextureName") "C:/Documents and Settings/BLAST/Desktop/Files/Trans.jpg" "image"; setAttr ($nickfile+".colorGain") -type double3 $R $G $B ; shadingNode -asShader lambert -n $nicklambert; //renderCreateBarCB -asShader "surfaceShader" lambert; sets -renderable true -noSurfaceShader true -empty -name $nicklambertSG; connectAttr -f $nicklambertoutcolor $nicklambertSGsS; sets -e -forceElement $nicklambertSG $ObjName; setAttr $nicklambertColor -type double3 $R $G $B; defaultNavigation -force true -connectToExisting -source $nickfile -destination $nicklambertIncan; defaultNavigation -force true -connectToExisting -source $nickfile -destination $nicklamberttrans ; }
More information on materials and shaders, read pages 128-141 in YSYT.