CODE
//This creates three shaders namely
//lumi_shader, average_grey_shader, range_shader
//and hooks them to three planes
//Step1: Browse and hook a color image to file1 node
//Step2: Render to see results
//Warning Creating a new file
file -f -new;
// Create file texture with texture placement //
shadingNode -asTexture file;
shadingNode -asUtility place2dTexture;
connectAttr -f place2dTexture1.coverage file1.coverage;
connectAttr -f place2dTexture1.translateFrame file1.translateFrame;
connectAttr -f place2dTexture1.rotateFrame file1.rotateFrame;
connectAttr -f place2dTexture1.mirrorU file1.mirrorU;
connectAttr -f place2dTexture1.mirrorV file1.mirrorV;
connectAttr -f place2dTexture1.stagger file1.stagger;
connectAttr -f place2dTexture1.wrapU file1.wrapU;
connectAttr -f place2dTexture1.wrapV file1.wrapV;
connectAttr -f place2dTexture1.repeatUV file1.repeatUV;
connectAttr -f place2dTexture1.offset file1.offset;
connectAttr -f place2dTexture1.rotateUV file1.rotateUV;
connectAttr -f place2dTexture1.noiseUV file1.noiseUV;
connectAttr -f place2dTexture1.vertexUvOne file1.vertexUvOne;
connectAttr -f place2dTexture1.vertexUvTwo file1.vertexUvTwo;
connectAttr -f place2dTexture1.vertexUvThree file1.vertexUvThree;
connectAttr -f place2dTexture1.vertexCameraOne file1.vertexCameraOne;
connectAttr place2dTexture1.outUV file1.uv;
connectAttr place2dTexture1.outUvFilterSize file1.uvFilterSize;
///////////////////////////////////////////////////////////////
// Luminance Shader , rgb to luminance
// Luminance = 0.3 * red + 0.59 * green + 0.11 * blue
// (perceptually based weights)
///////////////////////////////////////////////////////////////
// Create Luminance node
shadingNode -asUtility luminance;
// Connect file1.outColor to luminance1.value. //
connectAttr -force file1.outColor luminance1.value;
//Now create lumi_shader
shadingNode -asShader lambert -n lumi_shader;
sets -renderable true -noSurfaceShader true -empty \
-name lumi_shaderSG;
connectAttr -f lumi_shader.outColor lumi_shaderSG.surfaceShader;
//Connect outValue of luminance1 to all color channels in lumi_shader
connectAttr -force luminance1.outValue lumi_shader.colorR;
connectAttr -force luminance1.outValue lumi_shader.colorG;
connectAttr -force luminance1.outValue lumi_shader.colorB;
///////////////////////////////////////////////////////////////
//Average Grey Shader, rgb averaged to create greyscale image
//We may want to average the colors instead of using luminance node
///////////////////////////////////////////////////////////////
//Create plusMinusAverage node
shadingNode -asUtility plusMinusAverage;
//Connect each of the outcolor (R,G,B) to 1d inputs
connectAttr -force file1.outColorR plusMinusAverage1.input1D[0];
connectAttr -force file1.outColorG plusMinusAverage1.input1D[1];
connectAttr -force file1.outColorB plusMinusAverage1.input1D[2];
//Set the operation to average
setAttr plusMinusAverage1.operation 3;
//Now create average_grey_shader
shadingNode -asShader lambert -n average_grey_shader;
sets -renderable true -noSurfaceShader true -empty \
-name average_grey_shaderSG;
connectAttr -f average_grey_shader.outColor \
average_grey_shaderSG.surfaceShader;
//Connect output1D to all color channels (R,G,B)
//of the average_grey_shader
connectAttr -force plusMinusAverage1.output1D \
average_grey_shader.colorR;
connectAttr -force plusMinusAverage1.output1D \
average_grey_shader.colorG;
connectAttr -force plusMinusAverage1.output1D \
average_grey_shader.colorB;
///////////////////////////////////////////////////////////////
// Range Shader, Change the range of colors to get new effect
// This will create the image with magenta push
///////////////////////////////////////////////////////////////
//Create setrange node
shadingNode -asUtility setRange;
//Connect outcolor of file to this node
connectAttr -force file1.outColor setRange1.value;
//Set range parameters
setAttr "setRange1.oldMaxX" 1;
setAttr "setRange1.oldMaxY" 1;
setAttr "setRange1.oldMaxZ" 1;
setAttr "setRange1.minX" 0.0;
setAttr "setRange1.minY" 0.25; //reduce green range
setAttr "setRange1.minZ" 0.0;
setAttr "setRange1.maxX" 1.0;
setAttr "setRange1.maxY" 0.5; //reduce green range
setAttr "setRange1.maxZ" 1.0;
//Create a range_shader
shadingNode -asShader lambert -n range_shader;
sets -renderable true -noSurfaceShader true -empty \
-name range_shaderSG;
connectAttr -f range_shader.outColor range_shaderSG.surfaceShader;
//Connect outvalue of setRange1 to color channel of shader
connectAttr -force setRange1.outValue range_shader.color;
///////////////////////////////////////////////////////////////
// Create three planes and hook the shaders,
///////////////////////////////////////////////////////////////
nurbsPlane -ch on -o on -po 0 -ax 0 1 0 -w 1 -lr 1 -n lumi_plane;
move -a -2 0 0;
sets -e -forceElement lumi_shaderSG;
nurbsPlane -ch on -o on -po 0 -ax 0 1 0 -w 1 -lr 1 -n average_plane;
move -a 0 0 0;
sets -e -forceElement average_grey_shaderSG;
nurbsPlane -ch on -o on -po 0 -ax 0 1 0 -w 1 -lr 1 -n range_plane;
move -a 2 0 0;
sets -e -forceElement range_shaderSG;
select -r file1;//Browse to hook a color image
//Render to see results
QUOTE(ewerybody @ 06/05/08, 01:44 AM) [snapback]286727[/snapback]
ehmm.. thats news to me. Have an example yourself?
PS: ewerybody there is no need to scoff at this idea: You have also proposed things like this. For example "1k Mel Competition, lets see what you can do"