11/10/16

Maya / Vray _ random color for all objects

"- add extra vray attributes to a samplerInfo node (this will expose additional outputs to the samplerInfo)
- connect the samplerInfo.vrayRndomByID to a ramp's vCoord (if you're using a vRamp) OR uCoord (for a uRamp) | or both, if you intend to switch between ramp modes
--> the ramp's position and color values will be the range of colors to be distributed to the objects
--> plug the ramp into a shader and use the same shader on lots of objects"

source

10/3/16

Maya _ render queue batch .bat file

To launch multiple batch render for maya one at a time without render manager and without launching maya, just create a .txt file and rename it .bat, edit it with the following :

C:\Progra~1\Autodesk\Maya2016\bin\render  "C:\Users\xxxx\xxxx\scene01.ma"
C:\Progra~1\Autodesk\Maya2016\bin\render  "C:\Users\xxxx\xxxx\scene02.ma"

PAUSE

5/18/16

MAYA _ replace skinned mesh

To replace a skinned mesh by another : SKin -> Substitute geometry
very useful to replace with a High Res Mesh or when a mesh is messed up (uv,normals) it also keeps the deformer but not the blendshapes.  source A   source B


5/17/16

MAYA _ Ik spring solver

Ik spring solver is useful on  multiple joint chain for proportional or custom rotation of the joints with the ik. Just enter this mel command to be able to create them : ikSpringSolver;


5/16/16

MAYA _ parent object to particle


select particle shape node and a transform node, then in connection editor :

3/12/16

MAYA _ Light linking relationship editor not working

if light linking isn't working with this message:
// Error: file: C:/Program Files/Autodesk/Maya2016/scripts/others/relationshipEditor.mel line 725: No object matches name: shaderBallGeom1
Just close the hypershade ! source

3/8/16

MAYA _ Camera projection mapping not HD format

For a camera texture projection in HD format, nothing special to do but for a non HD format :
- get the ratio of the format (width/height=ratio)
- set the Film Aspect Ratio attribute of the camera to this ratio
- set Fit Resolution Gate to Overscan
- in the projected texture attribute set to Match camera film gate
source

2/26/16

NUKE _ remap gradient

Use STMAP node to remap the color of an image with a gradient. set rgb to UV channel in the node.

1/30/16

MAYA _ Motion path no flip

Sometimes while using motion path, flipping is hard to avoid, here is one solution :
- motion path your main object to the path "path1" blue curve
- duplicate "path1, rename it to "path2", offset it, delete history and edit it to shows the direction pink curve
- create a locator "loc1" and motion path it to the path "path2"
- connect the Uvalue of "path1" to "path2" so they have the same speed
- in the motionpath1 attribute, set follow, object up and in the world up object field enter "loc1"




EDIT : Actually the best method is by far to use a curve on surface as motion path and choose the normal type. To create a curve on surface, first create a surface, then make it live and create a curve on it.


1/22/16

NUKE _ convert 3DTransform to 2DTransform

Reconcile3D node -> create keyframe then link the XY values to a Transform

1/14/16

MAYA / SOuP _ Bmesh to create trees

Apply Bmesh SOuP's node on joint hierarchy to create a base mesh quickly, then adjust the size (not the scale) of each joint to change the width of the BMesh. Can change the position of the joint further, useful for tree/branches.

1/10/16

MAYA / VRAY / MEL _ viewport snapshot in Vray VFB

// Vray VFB viewport snapshot
// create it in maya's renderview then load it in Vray VFB
global proc VrayVFBsnapshot () 
{
 // create snapashot from current viewport camera 
 RenderViewWindow; // open renderview
 string $panel = `getPanel -wf`;
 string $camera = `modelEditor -q -camera $panel`;
 renderWindowRenderCamera snapshot renderView $camera; // create snapshot

 // get path to TMP image
 string $workspaceDir = `workspace -q -fullName`;
 string $imageDir = `workspace -q -fileRuleEntry "images"`;
 string $imagePath =  $workspaceDir  + "/" + $imageDir +  "/" + "TMP_snapshot";
 print $imagePath;
 sysFile -delete ($imagePath+".jpg"); // delete previous snapshot -- Windows
 setAttr "defaultRenderGlobals.imageFormat" 8; // set maya software to .jpg to save it as a jpg
 renderWindowSaveImageCallback "renderView" $imagePath ""; // save snapashot to .jpg file

 // open image in vray vfb
 vrayShowVFB; // open Vray VFB
 vray vfbControl -loadimage ($imagePath+".jpg");
}

1/3/16

NUKE _ merge PNG _ PSDmerge node

Having trouble merging PNG or PSD files with alpha  in nuke?
Use this hidden node to merge them !
nuke.nodes.PSDMerge()
or open a PSD in nuke and click on Breakout Layers and the node will be created.
or tools>other>update  then tools>other>psdmerge

1/1/16

NUKE _ mosaic / pixellate node

Blocky - mosaic effect in nuke
If someone needed a mosaic filter in nuke, no need to turn to 3rd party plugins, or doing resizes, it's right there. Just have to load it, because it's hidden by default. It's called blocky. You can load it in your custom menu.py, by adding these lines, for example:
nuke.createNode("Blocky")
quoted from http://thoughtvfx.blogspot.fr/2011/07/blocky-mosaic-effect-in-nuke.html