Development of the animation for special creatures in Cloudy with a Chance of Meatballs 2
ILM raised the standards of the breakdown clips. Check this out how it looks about the movie Battleship:
Character design on the film Rise of the Guardians:
def AddTensionMaterial(Selection):
"""
== DESCRIPTION ==
It creates a lambert material diffuse color input from the vertex color map.
The color map is from SOuP tensionMap with applies an RGB color code to represent tension on the surface of the geometry.
Basic color code:
Green - relaxed
Blue - stretch
Red - compression
There is no error handling currently. SOuP plugin has to be loaded.
=== Limitations ===
It considers only the current modifiers.
=== Side Effects ===
Assign verex color set
== INPUT ARGUMENTS ==
+ List - Selection - Mesh nodes has to be selected in order -> select the deformed mesh first and the original one after
+
== RETURN ==
None
== TOOLTIP ==
Select the stretched or compressed shape node and the original (non-stretched or compressed)
shape then run the code like this:
AddTensionMaterial(cmds.ls(sl = 1))
"""
shapeResult = Selection[0]
shapeOriginal = Selection[1]
tensMap = cmds.shadingNode("tensionMap", asUtility = 1, n = "tensionColorMap")
lastDefomerOutput = cmds.listConnections(shapeResult + ".inMesh", source = 1, destination = 0, plugs = 1 )[0]
cmds.polyColorPerVertex(shapeResult, relative = 1, r = 0.5, g = 0.5, b = 0.5, a = 1, colorDisplayOption = 1)
cmds.connectAttr(lastDefomerOutput , tensMap + ".inGeometry")
cmds.connectAttr(shapeOriginal + ".worldMesh[0]", tensMap + ".restGeometry")
cmds.connectAttr(tensMap + ".outGeometry", shapeResult + ".inMesh", f = 1)
mrVertC = cmds.shadingNode("mentalrayVertexColors", asTexture = 1, n = "mrVertCol")
cmds.connectAttr(shapeResult + ".colorSet[0].colorName", mrVertC + ".cpvSets[0]", force = 1)
tensionShader = cmds.shadingNode("lambert", asShader = 1, n = "tensionMat")
cmds.connectAttr(mrVertC + ".outColor", tensionShader + ".color")
cmds.nodeType("blinn1", inherited = 1)
# Result: [u'shadingDependNode', u'lambert', u'reflect', u'blinn'] #
cmds.ls(type = "shape")
cmds.ls(type = "geometryShape")
lambertTypeMaterialList = cmds.ls(type = "lambert")
lambertMaterialList = []
for item in lambertTypeMaterialList:
if cmds.nodeType(item) == "lambert":
lambertMaterialList.append(item)
# Result: [u'lambert1', u'lambert2'] #
def GetCommonClass(SelectedNodeList):
'''
== DESCRIPTION ==
Get the common type of the passed object list which is the first item in the inheritance diagram.
For eg. if we test a directionalLight and a nurbsCurve type nodes together the inheritance diagram are like this:
[u'containerBase', u'entity', u'dagNode', u'shape', u'geometryShape', u'deformableShape', u'controlPoint', u'curveShape', u'nurbsCurve']
[u'containerBase', u'entity', u'dagNode', u'shape', u'light', u'renderLight', u'nonAmbientLightShapeNode', u'nonExtendedLightShapeNode', u'directionalLight']
And we can see the first common type is the 'shape'.
== INPUT ARGUMENTS ==
+ list - SelectedNodeList - Maya node list
+
== RETURN ==
string - the first common type
== DEPENDENCIES ==
- maya.cmds
-
'''
if SelectedNodeList:
nodeTypeList = []
nodeTypeSet = set()
for item in SelectedNodeList:
nodeTypeList = cmds.nodeType(item, inherited = 1)
print nodeTypeList
if len(nodeTypeSet) != 0:
nodeTypeSet.intersection_update(set(nodeTypeList))
if len(nodeTypeSet) == 0:
print "There is no common type within selection."
return None
else:
nodeTypeSet.update(set(nodeTypeList))
commonTypeIndexList = []
for commonType in nodeTypeSet:
commonTypeIndexList.append(nodeTypeList.index(commonType))
firstCommonType = nodeTypeList[sorted(commonTypeIndexList)[-1]]
return firstCommonType
else:
return None
[ expr [value last] - [value first] ]
length: [ expr [value last] - [value first] ]f
cmds.displayColor("headsUpDisplayLabels", 16, dormant = 1)
try:
cmds.displayColor("headsUpDisplayLabels", 16, dormant = 1)
except RuntimeError:
pass