This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Create a Facing Ratio Shading Network and remap to two Ramp Textures | |
shadingNode -asUtility samplerInfo -n "mySamplerInfo"; | |
shadingNode -asUtility reverse -n "myReverse"; | |
connectAttr -f mySamplerInfo.facingRatio myReverse.inputX; | |
connectAttr -f mySamplerInfo.facingRatio myReverse.inputY; | |
connectAttr -f mySamplerInfo.facingRatio myReverse.inputZ; | |
shadingNode -asUtility rgbToHsv -n "myRgbToHsv"; | |
connectAttr -f myReverse.output myRgbToHsv.inRgb; | |
shadingNode -asTexture ramp -n "myRamp_01"; | |
shadingNode -asTexture ramp -n "myRamp_02"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.cmds as cmds | |
##Warning labels | |
warningStars = "***" | |
warningText = "There is more than one child" | |
translateWarning = "*** Translate != 0 ***" | |
rotateWarning = "*** Rotate != 0 ***" | |
scaleWarning = "*** Scale != 0 ***" | |
emptyWarning = "I'm empty inside :(" | |
shapeNameWarning = "**The transform and shape do not share a name**" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##Select an object and run to get a list of Shaders assigned to that object | |
##Select a new object and press "Assign" to assign the listed shader to the new object | |
##Uncheck "Close after assignment" to assign shaders to objects one after another | |
import maya.cmds as cmds | |
def getShadersFromSelected(): | |
getShaders = [] | |
cmds.hyperShade(shaderNetworksSelectMaterialNodes = True) | |
assignedToObject = cmds.ls(sl = True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##Use the rotation of an object as an on off switch | |
from math import sin | |
x = 0 | |
while x < 360: | |
## | |
a = ( ( sin( ( ( (x+270)/360 )*4 )*1.57 )/2 )+0.5 ) | |
## This is the important part ^^^^^ | |
a = round(a, 3) | |
print (x,a) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## random is for testing only | |
from random import uniform | |
## x represents any given value within a desired range | |
## m represents the minimum value within the range | |
## ma is the maximum | |
## in this example, a random number is chosen within the range of 10 to 235 | |
## the tool will convert the random number to a value between 0 and 1 | |
x = round(uniform(10, 235), 2) | |
m = 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Tear off a selected camera and set all objects display to OFF except POLYGONS | |
//Select a Camera in the Outliner/Hypergraph | |
//Hover mouse over current view (eg., Persp) and tap CTRL/CMD | |
//Click button to run command | |
$camera = `ls -sl`; | |
$panel = `getPanel -wf`; | |
$activeCam = `modelPanel -q -cam $panel`; | |
$tearCam = $camera[0]; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
polyCube -w 10 -h 10 -d 10 -sx 1 -sy 1 -sz 1 -ax 0 1 0 -cuv 4 -ch 1 -n "ball"; | |
polySmooth -dv 2; | |
for( $i=0; $i<98; ++$i ) { | |
float $randRad = rand(1.0, 2.5); | |
vector $vertPos = `pointPosition ball.vtx[$i]` ; | |
float $vertX = $vertPos.x; | |
float $vertY = $vertPos.y; | |
float $vertZ = $vertPos.z; | |
float $randMV = rand(0.1, 0.5); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//DepthShaderTool | |
//Move the nearPoint locator to the closest point in the renderable camera's field of view. | |
//Move the farPoint locator to the farthest point in the renderable camera's field of view. | |
//Assign the shader to all objects in the scene (optionally create a new render layer and shader override). | |
//Adjust the position of the near and farPoint to adjust the values of white and black in the render. | |
$cameras = `ls -sl`; | |
if ( size($cameras)==0 ) { | |
print "**Please select a camera**"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Create an Area Light | |
CreateAreaLight; | |
rename "testAreaLight"; | |
setAttr "testAreaLight.scaleZ" 10; | |
setAttr "testAreaLight.scaleX" 10; | |
setAttr "testAreaLight.scaleY" 10; | |
setAttr "testAreaLightShape.areaLight" 1; | |
setAttr "testAreaLightShape.decayRate" 1; | |
//create and connect a PhysLight Node |
NewerOlder