Wednesday, September 30, 2015

Autodesk Vision Series 2015

I think it is time to relax and let Autodesk be our entertainer. Okay, you might think I`m biased (or paid by Autodesk which is not the case unfortunately) I spend  most of my time using Maya. Of course I`m biased. I wish I had more time to do cool stuff with other softwares like Modo, Houdini, ZBrush, Dynamo, Krita and learn more about  Blender, Substance Painter and DesignerPhotoshop, AfterEffects, Photoscan, PFTrack, FinalCut, Flix, Mari, Nuke, Hiero, Katana, Arnold, Renderman, OpenColorIO, ShotGun, Tactic, fTrack, USD, OSL, MU, Python, C++, JavaScript, never ending story...

Anyway, just relax and watch these videos:

Virtual production


Rendering and the cloud


The topic is Procedural Content Creation and the software is 3DS Max. I have to admit it is a bit disappointing for me because we waiting soo long ago a system like that in Maya. Okay, there is SOuP so Autodesk bosses think we don`t need proceduralism any more because we already have it.



And last but not least: Editorial



Maya Rigging - Analyze stretching and compression with SOuP tensionMap

As we all know that SOuP maya plugin package has the tensionMap node. What it does is that colour coding the stretching or compression occurs on the deformed surface. It can be used for a lot of things. For example it can triggers blendShapes based on the surface compression or stretching.

I found it was useful to analyse how skinClusters (skin deformation) and blendShapes (morphed geometries) affected on the result surface. I made a short video to demonstrate this.



To utilize the tensionMap node easily I wrote a simple python script. We have to select the deformed mesh first and the original mesh after. It might be tricky to find those nodes in the node graph as you see below.



So here is the script:


 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")  

I hope it works fine for you.