using Maya setRange to control incandescence

Posted by on May 20, 2010 in code, Maya, MEL, rendering | No Comments

setRange is a utility node that allows you to take values in one range, and map them into another range. Here is an example of setRange being used to remap the value of the translateY attribute to new values that control the incandescence of a shader.

This MEL script will create and attach a shader to selected objects, which links the translateY value of a Maya object to the incandescence of the shader.

The setRange utility is placed in between to control the output value range going into the shader. In this case, if the object’s translateY value is 10 the output will be 2, 1.25, 2, which produces a bright magenta color, if used as RGB values.

Using Maya hsvToRgb to cycle through the color spectrum

Posted by on May 20, 2010 in code, Maya, MEL, rendering, tips | No Comments

HSV to RGB is a utility node that allows you to convert an HSV (Hue-Saturation-Value) color into an RGB (Red-Green-Blue) color.

.inHsvR ranges from 0 to 360, representing degrees of a circle. We can use this to animate a shader to run through all the rainbow colors.

This MEL script will create and assign this shader network to selected objects.

Create Maya shaders that react to key frames

Posted by on May 16, 2010 in code, how to, Maya, MEL, rendering | No Comments

This MEL script was written specifically to automatically generate shaders for the equalizer in the animation below.

The script is set up to generate and assign shaders and attach the .translateY attribute of selected objects to the incandescence of the newly generated shader. Also creates a network that cycles the colors a bit at the same time.

Here is a snapshot of the network:

Get the script.

Maya Render Settings, File Name Prefix

Posted by on Apr 30, 2010 in Maya, rendering | No Comments

Adding a path to the File Name Prefix dialog in the Render Settings will force Maya to write the sub directories specified:

You can write, for instance: subdir/renderPass1/myRen.

This will write files called myRen.####.ext into the directory path images/subdir/renderPass1/, as long as you are set up to render into the images directory.

You can use % to indicate variable values:

%s: scene name
%c: camera
%l: render layer

Example: %s/%c/%l/%s_%l

My Maximum PC May 2010 Cover

Posted by on Mar 31, 2010 in graphics, rendering | No Comments

Maximum PC May 2010 Cover

Acuvue Product Launch Video

Posted by on Mar 31, 2010 in animation, rendering | No Comments

Created at Elastic Creative in San Francisco. I was tasked with texture, lighting, and rendering.

Maya fresnel texture connections MEL script

Posted by on Mar 17, 2010 in code, Maya, MEL, rendering | One Comment

Connect this network to the reflectivity attribute of a shader to get the fresnel effect, ie reflections that increase in intensity as the rendered surface turns away from the camera.

Use this script to generate the fresnel network. Connect the ramp’s outAlpha to the Reflectivity attribute of your material.

string $myRamp = `shadingNode -asTexture ramp`; 
string $myNode = `shadingNode -asUtility place2dTexture`; 
connectAttr ($myNode + ".outUV") ($myRamp + ".uv"); 
connectAttr ($myNode + ".outUvFilterSize") ($myRamp + ".uvFilterSize"); 
removeMultiInstance -break true ( $myRamp + ".colorEntryList[1]"); 
setAttr ($myRamp + ".colorEntryList[0].color") -type double3 .5 .5 .5 ; 
setAttr ($myRamp + ".colorEntryList[0].position") 0; 
setAttr ($myRamp + ".colorEntryList[2].color") -type double3 0.1 0.1 0.1 ; 
setAttr ($myRamp + ".colorEntryList[2].position") 1; 
setAttr ($myRamp + ".interpolation") 4; 
string $mySamplerInfo = `shadingNode -asUtility samplerInfo`; 
connectAttr -f ($mySamplerInfo + ".facingRatio") ($myRamp + ".uCoord"); 
connectAttr -f ($mySamplerInfo + ".facingRatio") ($myRamp + ".vCoord");

Select a material that has a “Reflectivity” attribute then run this script. The proper connections will be made automatically.

string $selShader[] = `ls -sl`;
string $myRamp = `shadingNode -asTexture ramp`; 
string $myNode = `shadingNode -asUtility place2dTexture`; 
connectAttr ($myNode + ".outUV") ($myRamp + ".uv"); 
connectAttr ($myNode + ".outUvFilterSize") ($myRamp + ".uvFilterSize"); 
removeMultiInstance -break true ( $myRamp + ".colorEntryList[1]"); 
setAttr ($myRamp + ".colorEntryList[0].color") -type double3 .5 .5 .5 ; 
setAttr ($myRamp + ".colorEntryList[0].position") 0; 
setAttr ($myRamp + ".colorEntryList[2].color") -type double3 0.1 0.1 0.1 ; 
setAttr ($myRamp + ".colorEntryList[2].position") 1; 
setAttr ($myRamp + ".interpolation") 4; 
string $mySamplerInfo = `shadingNode -asUtility samplerInfo`; 
connectAttr -f ($mySamplerInfo + ".facingRatio") ($myRamp + ".uCoord"); 
connectAttr -f ($mySamplerInfo + ".facingRatio") ($myRamp + ".vCoord");

connectAttr ($myRamp + ".outAlpha") ($selShader[0] + ".reflectivity");

Falling Diamonds

Posted by on Mar 15, 2010 in animation, default, rendering | No Comments

Part of a Thai music video in tribute to Petchara, a star of the 60’s, and featuring Weir, a current star. I was tasked with adding cg diamonds falling from above.

Yellow Diamond

Posted by on Jan 7, 2010 in gallery, rendering | No Comments

For Viraj Co Ltd.

Load More