TIPS CG
5/27/20
5/16/20
8/4/19
AE // extend mask
MinMax effect - sometimes allow to remove black border on mask (ie normal AOV mask)
for better result add a remove color matting Effect just after
for better result add a remove color matting Effect just after
4/25/19
AE // unpremult (kind of)
Use the effect remove color matting (create an alpha before with shift channel or other if no alpha exist)
4/19/19
3/16/19
WINDOWS // SHELL - duplicate folder structure without files
XCOPY source destination /T /E
https://windows.developpez.com/cours/ligne-commande/?page=page_9
https://windows.developpez.com/cours/ligne-commande/?page=page_9
4/9/18
MAYA // Playblast banding issues
When playblasting, there are banding issues, gradient/lighting not smooth, add the environnement variable in the maya.env file (in the pref folder of maya)
MAYA_FLOATING_POINT_RT_PLAYBLAST = 1
MAYA_FLOATING_POINT_RT_PLAYBLAST = 1
3/8/18
MAYA - PYTHON - WINDOWS // rename file with replace string
# rename files in directory replace string by another
import os
#r at the beginning of the path so the filename starting with a number sont bien reconnu - raw string literals
renamePath = r"O:\_WORK\PERSO\__SCRIPTS\01_MAYA\_SHELF_custom\shelf_geo_icons"
renamePath = renamePath.replace('\\','/')
# loop and rename
if (renamePath != '') :
for filename in os.listdir(renamePath):
if (len(filename.split('.'))==2): # check if file is not a folder (if it contains an extension)
print filename
newName = filename.replace("ttt","") # replace
os.rename(os.path.join(renamePath, filename), os.path.join(renamePath, newName))
import os
#r at the beginning of the path so the filename starting with a number sont bien reconnu - raw string literals
renamePath = r"O:\_WORK\PERSO\__SCRIPTS\01_MAYA\_SHELF_custom\shelf_geo_icons"
renamePath = renamePath.replace('\\','/')
# loop and rename
if (renamePath != '') :
for filename in os.listdir(renamePath):
if (len(filename.split('.'))==2): # check if file is not a folder (if it contains an extension)
print filename
newName = filename.replace("ttt","") # replace
os.rename(os.path.join(renamePath, filename), os.path.join(renamePath, newName))
3/7/18
MAYA // toggle pan Zoom shortcut
Very handy, set the same shortcut for these commands :
while pressing in continue you can 2D zoom and pan in the camera.
while pressing quickly it enbale/disable the 2D pan zoom
while pressing in continue you can 2D zoom and pan in the camera.
while pressing quickly it enbale/disable the 2D pan zoom
2/8/18
CHROME // Vimeo - acces to videos from profile with a bookmark
Now we can't directly acces to all videos of a profile in Vimeo like we could in the past.
We can acces it adding "/videos" to the url to get back this page. As this is a bit tedious to do it manually, we can create a bookmark on the chrome bar and add this function instead of the url :
javascript:(function(){location.href=location.href+("/videos");})();
or
javascript:(function(){location.href+="/videos";})();
We can acces it adding "/videos" to the url to get back this page. As this is a bit tedious to do it manually, we can create a bookmark on the chrome bar and add this function instead of the url :
javascript:(function(){location.href=location.href+("/videos");})();
or
javascript:(function(){location.href+="/videos";})();
9/17/17
MAYA // reorder channel attributes keeping connection
"Actually is very simple to reorder them, just right click on the attribute delete it and then hit undo, your attribute will be the last one in the list."
source
source
8/30/17
7/4/17
MAYA // toggle click and drag
selectPref -clickDrag (!`selectPref -q -clickDrag`);
useful for animation in some case to click and drag an object with one click
useful for animation in some case to click and drag an object with one click
7/2/17
MAYA // procedurally extrude all faces even if topology change
Useful for adding thickness to animated mesh, add an extrude then edit the component list :
setAttr "polyExtrudeFace4.inputComponents" -type "componentList" 1 "f[*]";
source
setAttr "polyExtrudeFace4.inputComponents" -type "componentList" 1 "f[*]";
source
MAYA // offset an animation with a node - frameCache
to offset an animation with a node, create a frameCache node, connect an animated channel to its stream channel, and use the past or future values for the offset.
Connection has to be done with scripting :
connectAttr frameCache1.past[14] key.translateY; -> will offset of 14 frames
source
Connection has to be done with scripting :
connectAttr frameCache1.past[14] key.translateY; -> will offset of 14 frames
source
MAYA // Twist start end IK spline without advanced twist controls
twist from start :
set attribute on ikHandle like this : twist = roll * -1
for example, roll=150 and twist=-150
setup exemple where MD_invert_roll_1, input2X is set to -1
set attribute on ikHandle like this : twist = roll * -1
for example, roll=150 and twist=-150
setup exemple where MD_invert_roll_1, input2X is set to -1
6/3/17
VRAY // environnement variable
source
utilize the threads on systems with more then 64 but if want to no reset affinity thread VRAY_USE_THREAD_AFFINITY=0
limit the number of threads that V-Ray uses VRAY_NUM_THREADS
utilize the threads on systems with more then 64 but if want to no reset affinity thread VRAY_USE_THREAD_AFFINITY=0
limit the number of threads that V-Ray uses VRAY_NUM_THREADS
5/13/17
VRAY // Diffuse pass not flat color
Sometimes the Diffuse RE of V-ray is not full flat colors but has some sort of shading/fresnel.
That is normal as it's the Diffuse Filter RE and is affected by reflections. To have full flat colors on compositing do the following :
Diffuse RE divided by the invert of the Reflection Filter RE
source
That is normal as it's the Diffuse Filter RE and is affected by reflections. To have full flat colors on compositing do the following :
Diffuse RE divided by the invert of the Reflection Filter RE
source
4/6/17
Youtube _ Chrome // speed video more than x2
Useful for speeding long tutorial video :
- open the video on Youtube
- on chrome press F12 to open the Dev Tools -> consol Tab and paste this changing the value
document.getElementsByTagName("video")[0].playbackRate = 3.5
source
- open the video on Youtube
- on chrome press F12 to open the Dev Tools -> consol Tab and paste this changing the value
document.getElementsByTagName("video")[0].playbackRate = 3.5
source
4/1/17
MAYA 2017 / Dash features - power attribute editor function
example : Alt + right-click anywhere in the Channel Box.
r(number) Assigns a random number between 0 and 'number'.
source : maya help
r(number) Assigns a random number between 0 and 'number'.
source : maya help
2/13/17
AFTER EFFECTS // text layer display name of current visible layer
http://www.motionscript.com/design-guide/source-name.html
txt = ""; for (i = 1; i <= thisComp.numLayers; i++){ if (i == index) continue; L = thisComp.layer(i); if (! (L.hasVideo && L.active)) continue; try{ txt = L.source.name; }catch(err){ txt = L.name } break; }
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
- 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
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
7/20/16
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
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
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
// 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
- 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
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.
- 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 !
or tools>other>update then tools>other>psdmerge
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:
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
10/2/15
MAYA _ jiggle batch render
If bug when batch rendering jiggle :
Edit > Keys > Bake Simulation (use the option box)
Tick the "Control Points" option to bake the animation onto each vertice, and untick "Keep unbaked keys".
source
Edit > Keys > Bake Simulation (use the option box)
Tick the "Control Points" option to bake the animation onto each vertice, and untick "Keep unbaked keys".
source
8/6/15
HOUDINI _ Divers
Export houdini color to Alembic via colorSet for Maya
- in houdini create anattribute promote and promote group Cd from Point to new class Vertex.
- in Maya use the mel command to import alembic :
AbcImport -mode import -rcs "/folder/Color.abc";
source
- in houdini create anattribute promote and promote group Cd from Point to new class Vertex.
- in Maya use the mel command to import alembic :
AbcImport -mode import -rcs "/folder/Color.abc";
source
7/22/15
MAYA _ IK pole vector constraint joints move
Sometimes when applying pole vector constraint on a RP IK, the joints move, here is the fix :
"The fix, as it turns out, is really easy. Before you apply the pole vector constraint, you need to place your controller (whatever is going to drive the pole vector) exactly between the start of the IK chain, and the end effector, e.g., the shoulder and the wrist. This is quickly done by selecting the start and end joints, and then the controller, and creating a point constraint (do not maintain offset). Then delete the constraint. Next, use an aim constraint to point the controller directly at the middle joint (say, the elbow). Delete the constraint. Then you just need to move the controller along its pointing axis a little ways, to push it away from the bones. For example, if your aim vector for the constraint was +X, then push your controller a few units forward in its local X axis. Now you can create the pole vector and the joints shouldn’t snap at all."
from http://www.toadstorm.com/blog/?p=129
"The fix, as it turns out, is really easy. Before you apply the pole vector constraint, you need to place your controller (whatever is going to drive the pole vector) exactly between the start of the IK chain, and the end effector, e.g., the shoulder and the wrist. This is quickly done by selecting the start and end joints, and then the controller, and creating a point constraint (do not maintain offset). Then delete the constraint. Next, use an aim constraint to point the controller directly at the middle joint (say, the elbow). Delete the constraint. Then you just need to move the controller along its pointing axis a little ways, to push it away from the bones. For example, if your aim vector for the constraint was +X, then push your controller a few units forward in its local X axis. Now you can create the pole vector and the joints shouldn’t snap at all."
from http://www.toadstorm.com/blog/?p=129
6/27/15
VRAY 3 _tips
Multi tile Uv texture -> just use one filetexture node then in the filename insert <UVTILE> and Vray will change it with the corresponding UV coordonate.
ex : path\color_<UVTILE>.jpg -> path\color_u1_v1.jpg
More info on the help
ex : path\color_<UVTILE>.jpg -> path\color_u1_v1.jpg
More info on the help
6/24/15
MAYA _ nHair
To create nHair from custom curves :
- create guide curve
- select curve then nhair -> assign hair system
- select mesh then nhair -> create hair (optionbox choose the hairsytem)
To display the guidecurve after just uncheck intermediateobject in the attribute editor of their shape
- create guide curve
- select curve then nhair -> assign hair system
- select mesh then nhair -> create hair (optionbox choose the hairsytem)
To display the guidecurve after just uncheck intermediateobject in the attribute editor of their shape
6/19/15
MAYA 2016 _ new / tips
modeling :
holding ctrl Key + moving componenent : move along normal
multicut Tool : holding Ctrl+Shift : 90 degree cut / hloding shift : percent display
edit pivot + clic sur component : snap and align pivot
After creating a polygon primitive, you must activate the Show Manipulator Tool (Hotkey: T) before the In-View Editor appears.
Ctrl + 1 : toggle isolate
Alt + D : deselect
settings/preference :
animation -> evaluation parralel and check GPU Override (faster for vertex animation/ skin)
display -> material loading Mode -> Parallel to avoid lag at scene opening when lot of shader
color management -> input color space rule : for texture color space, also check in attribute editor for file node to chose individual colorspace
single blendshape deformer:
create blendshape deformer on one mesh then windows - animation editor - blendshape, add new target clic on edit then edit the mesh uncheck edit and repeat to create blendshape directly on mesh.
dR_setActiveTransformAxis 3; // reset current manipulator handle to 3 axis
outlinerEditor -edit -expandAllItems 0 outlinerPanel1; // collapse all in docked outliner
holding ctrl Key + moving componenent : move along normal
multicut Tool : holding Ctrl+Shift : 90 degree cut / hloding shift : percent display
edit pivot + clic sur component : snap and align pivot
After creating a polygon primitive, you must activate the Show Manipulator Tool (Hotkey: T) before the In-View Editor appears.
Ctrl + 1 : toggle isolate
Alt + D : deselect
settings/preference :
animation -> evaluation parralel and check GPU Override (faster for vertex animation/ skin)
display -> material loading Mode -> Parallel to avoid lag at scene opening when lot of shader
color management -> input color space rule : for texture color space, also check in attribute editor for file node to chose individual colorspace
single blendshape deformer:
create blendshape deformer on one mesh then windows - animation editor - blendshape, add new target clic on edit then edit the mesh uncheck edit and repeat to create blendshape directly on mesh.
dR_setActiveTransformAxis 3; // reset current manipulator handle to 3 axis
outlinerEditor -edit -expandAllItems 0 outlinerPanel1; // collapse all in docked outliner
6/9/15
NUKE / PYTHON _ copy text from .txt file and paste into the DAG
create a .txt file containing a nuke group or nodes (copy from nuke and paste as a text) then use this function in nuke to create a node from it
import nuke from PySide import QtGui def FromTxtToNukeNode(): with open ("O:/_WORK/.../textfile.txt", "r") as myfile: data=myfile.read() #get the text in the .txt file as a string variable QtGui.QApplication.clipboard().setText(data) # set to clipboard nuke.nodePaste("%clipboard%") # paste into nuke DAG
6/3/15
NUKE _ rotate normal
set cut_paste_input [stack 0]
version 8.0 v5
push $cut_paste_input
Expression {
temp_name0 expA
temp_expr0 r*v1+g*v2
temp_name1 expB
temp_expr1 (1-r)*v1+g*v2
temp_name2 expC
temp_expr2 (1-r)*v1+(1-g)*v2
temp_name3 expD
temp_expr3 r*v1+(1-g)*v2
channel0 rgba
expr0 "\[\nif \{\[value val]<=1\} \{return expA\} else \{\nif \{\[value val]<=2\} \{return expB\} else \{\nif \{\[value val]<=3\} \{return expC\} else \{\nif \{\[value val]<=4\} \{return expD\}\n\}\}\}\n]"
name Exp_rot_Normal
tile_color 0x73168eff
gl_color 0xffffffff
label "_\n"
note_font "Verdana Bold"
note_font_color 0x1a131cff
selected true
xpos 142
ypos -215
addUserKnob {20 control}
addUserKnob {7 val l valeur R 0 4}
addUserKnob {7 v1}
v1 {{"\[\nif \{\[value val]<=1\} \{return 1-val\} else \{\nif \{\[value val]<=2\} \{return val-1\} else \{\nif \{\[value val]<=3\} \{return 3-val\} else \{\nif \{\[value val]<=4\} \{return val-3\}\n\}\}\}\n]"}}
addUserKnob {7 v2}
v2 {{"\[\nif \{\[value val]<=1\} \{return val\} else \{\nif \{\[value val]<=2\} \{return 2-val\} else \{\nif \{\[value val]<=3\} \{return val-2\} else \{\nif \{\[value val]<=4\} \{return 4-val\}\n\}\}\}\n]"}}
}
version 8.0 v5
push $cut_paste_input
Expression {
temp_name0 expA
temp_expr0 r*v1+g*v2
temp_name1 expB
temp_expr1 (1-r)*v1+g*v2
temp_name2 expC
temp_expr2 (1-r)*v1+(1-g)*v2
temp_name3 expD
temp_expr3 r*v1+(1-g)*v2
channel0 rgba
expr0 "\[\nif \{\[value val]<=1\} \{return expA\} else \{\nif \{\[value val]<=2\} \{return expB\} else \{\nif \{\[value val]<=3\} \{return expC\} else \{\nif \{\[value val]<=4\} \{return expD\}\n\}\}\}\n]"
name Exp_rot_Normal
tile_color 0x73168eff
gl_color 0xffffffff
label "_\n"
note_font "Verdana Bold"
note_font_color 0x1a131cff
selected true
xpos 142
ypos -215
addUserKnob {20 control}
addUserKnob {7 val l valeur R 0 4}
addUserKnob {7 v1}
v1 {{"\[\nif \{\[value val]<=1\} \{return 1-val\} else \{\nif \{\[value val]<=2\} \{return val-1\} else \{\nif \{\[value val]<=3\} \{return 3-val\} else \{\nif \{\[value val]<=4\} \{return val-3\}\n\}\}\}\n]"}}
addUserKnob {7 v2}
v2 {{"\[\nif \{\[value val]<=1\} \{return val\} else \{\nif \{\[value val]<=2\} \{return 2-val\} else \{\nif \{\[value val]<=3\} \{return val-2\} else \{\nif \{\[value val]<=4\} \{return 4-val\}\n\}\}\}\n]"}}
}
5/30/15
MAYA / VRay _ sprite texture pixelated
If sprite particles get pixelated with Vray (when they scale) :
Vray -> Global Option -> Materials -> uncheck texture filter map
Vray -> Global Option -> Materials -> uncheck texture filter map
5/20/15
MAYA / MEL_ offset animation multiple objects
// Proc to offset animation keyframe - two mode random or increment // select controllers and run the command : OffsetKeyFrame random 6 or OffsetKeyFrame increment 2 global proc OffsetKeyFrame (string $type, int $value) { string $sel[] = `ls -sl`; if ($type == "increment") { int $val = 0; for ($item in $sel) { keyframe -e -iub true -r -o over -tc $val $item; $val += $value; } } else if ($type == "random") { for ($item in $sel) { int $rnd = rand(0,$value); keyframe -e -iub true -r -o over -tc $rnd $item; } } select -r $sel; }
5/18/15
MAYA_ Bake camera mapping / projection
I had problems to bake camera projection to 2D texture and for any reason Vray texture bake wasn't working properly. Here are the two solution I found :
- Baking the texture (but a bit blurry)
select the mesh and shader then in hypeshade -> edit -> convert to fileTexture (Maya Software)
- Create a texture reference object ( may not work well with animated deformation on mesh)
select the mesh then -> rendering -> texturing -> create texture reference object
- Baking the texture (but a bit blurry)
select the mesh and shader then in hypeshade -> edit -> convert to fileTexture (Maya Software)
- Create a texture reference object ( may not work well with animated deformation on mesh)
select the mesh then -> rendering -> texturing -> create texture reference object
4/28/15
MAYA _ perspective camera bug
To reset perspective camera when it goes away pressing f :
Select an object then : View panel -> View -> Look at selection
Select an object then : View panel -> View -> Look at selection
4/22/15
MAYA _ delete multiple shapes node for one transform
Sometime it occurs that one transform node has multiple shape node, to clean it and keep only one shape node :
File -> Optimize scene size -> Deformers
File -> Optimize scene size -> Deformers
4/4/15
MAYA_clean motion path to constrain on curve
1. Create your motionPath as you normally would
2. Select the "motionPath1" node in you Channel Box inputs and you should see "U Value" and it should be keyframed. Select that attribute and Break Connections to kill the animation. This "U Value" is just like "Parameter" in PointOnCurveInfo nodes in that it will move your connected object along your curve using values 0-1. You think it would be that simple but you will likely get Cycle Check errors.
3. To clean up the setup and avoid errors you can use the connection editor to connect motionPath1 (allCoordinates "xyz") to the translate "xyz" values of whatever object you have attached to your path, and then simply delete the 3 addDoubleLinear nodes that are no longer necessary.
This leaves you with your curve->motionPath->attachedObject and also gives you all the other options that are built into the motionPath node like Follow, Twist, etc. I usually attach locators to motionPaths rather than directly attach objects and also like to use setRange nodes to expand the 0-1 value of "U value" to something more friendly to interact with like 0-10 or 0-100
Image in the Node Editor:
andrewandoru.com/images/motionpathrigging.jpg
andrewandoru.com/images/motionpathrigging.jpg
source - Andrew Hake
3/24/15
3/12/15
MAYA _ Skin with a curve
To skin with a curve and deform with the control vertex :
- select a joint and the mesh -> bind skin -> smooth skin
- select the curve and the mesh -> edit smooth skin -> add influence option : check Use geometry
- go to the skin cluster and check Use component
- select a joint and the mesh -> bind skin -> smooth skin
- select the curve and the mesh -> edit smooth skin -> add influence option : check Use geometry
- go to the skin cluster and check Use component
1/27/15
NUKE / PYTHON _ Toggle heavy node by class
def disableHeavyNodes(): # Toggle value / 1 disable - 0 enable # RSMB / frischluft / sapphire zblur-zdefocus-glow global tgl try: tgl = not tgl except NameError: tgl = 1 nodeArray = ['OFXcom.revisionfx.rsmb3_vectors_v3','OFXcom.revisionfx.rsmb3_v3', 'OFXcom.frischluft.openfx.depthoffield_v1','OFXcom.frischluft.openfx.outoffocus_v1', 'OFXcom.genarts.sapphire.blursharpen.s_zblur_v1','OFXcom.genarts.sapphire.blursharpen.s_zdefocus_v1','OFXcom.genarts.sapphire.lighting.s_glow_v1'] for a in nuke.allNodes(): if a.Class() in nodeArray : a['disable'].setValue(tgl)
1/4/15
NUKE / PYTHON _ snippets
nuke.selectedNode().Class() def reloadReads(): for myNode in nuke.allNodes("Read") : myNode["reload"].execute() print "--> Reads reloaded"
12/12/14
MAYA / VRAY _ wave with distanceTex node
To procedurally create wave near object :
- create a VRayDistanceTex, a ramp and a shader.
- add object to distTex_set
- set the ramp like below.
- connect VRayDistanceTex.outColorR to ramp.Vcoord
- connect ramp to shader diffuse.
As it's heavy to calculate, it's better to bake it to a texture file map before rendering a long animation.
12/11/14
MAYA _ can't do planar mapping uv / OBJ group problem
Sometimes, there is some buggy mesh on which Maya can't apply a planar mapping and when trying to export and import obj to clean the mesh we get this warning :
"Your OBJ file contains faces shared by multiple groups. Maya cannot create multiple objects for this file. A single mesh object will be created instead. The OBJ group information will be captured in Maya sets."
Here is a trick (for multiple objects) :
export to OBJ turning groups and point groups option off then import it in Maya then mesh > separate.
12/10/14
MAYA _ same uv square size multiple mesh
In UV texture editor : polygons > layout and set "Prescale" to "World".
maya help
12/1/14
MAYA _ Particle
Volume noise fitting particle
http://www.djx.com.au/blog/2008/07/21/particlesamplerinfo-smoke/
See the particule after converting to mesh :
nParticleShape > attribute editor > object display > unchek intermediate object
When converted to mesh increse the max triangle resolution
Delete particule with an uniform field : https://www.youtube.com/watch?v=fZWa43u8KB4
create an uniform field, set lifespan > lifespanPP only, add expression before dynamics in lifespanPP
if(nParticle_verreShape.inputForce[0] >= 0.0001)
{nParticle_verreShape.lifespanPP = 0.0;}
Multiple emitters for same nParticuleShape :
Select nParticle, shift select emitter > nParticule > Use selected emitter
or
duplicate emitter using CTRL+d then Window -> Relationship Editors -> Dynamic Relationships, select the particles in the left side of the window, check Emitters in the upper part of the right window, and select both emitters. source
Change particule color with age - Vray
Add Vray per particle attribute export to nParticleShape.
Scroll down to extra attribute and check "age".
Assign a shader with a U ramp in diffuse (delete the placement node of the ramp) to the particle.
Create a particleSampler node and connect to ramp : particlesampler.age -> ramp.uCoord.
Randomize particule color - Vray
Add user scaler 1pp attribute to nParticleSHape
add runtime before dynamics expression to it : nParticleShape.userScalar1PP = rand(1);
Add Vray per particle attribute export to nParticleShape.
Scroll down to extra attribute and check "userScalar1PP"
Assign a shader with a U ramp in diffuse (delete the placement node of the ramp) to the particle.
Create a particleSampler node and connect to ramp : particlesampler.userScalar1PP -> ramp.uCoord.
Sprite
For simple setup use nParticles -> sprite Wizard.
For sequence file texture without spriteWizard in file node animate image number and check interactive sequence caching.
if random on birth, create spriteNumPP et expression nParticleShape1.spriteNumPP = int(rand(1,4));
For scale add dynamic attribute sprite scaleX PP and spritescale Y PP, right click and create ramp
For random rotate add attribute sprite twist PP and add creation expression nParticleShape1.spriteTwistPP = rand(-180,180);
pour animer rotation dans runtime expression :
nParticleShape1.spriteTwistPP += 1;
Display age (or other attribute) in viewport
particleShape -> shading -> numeric
attribute name : age
attribute name list
Move bad particle to hide them (dirty way)
Select individual particle (right click -> particle) then add a cluster to them and move the cluster !
http://www.tokeru.com/mayawiki/index.php?title=Particles
Steppy movement (ex : when attach emitter to motion path)
Create cache : evaluate every 0.2 and save every 5 and change the subframe in nucleus if needed.
http://www.djx.com.au/blog/2008/07/21/particlesamplerinfo-smoke/
See the particule after converting to mesh :
nParticleShape > attribute editor > object display > unchek intermediate object
When converted to mesh increse the max triangle resolution
Delete particule with an uniform field : https://www.youtube.com/watch?v=fZWa43u8KB4
create an uniform field, set lifespan > lifespanPP only, add expression before dynamics in lifespanPP
if(nParticle_verreShape.inputForce[0] >= 0.0001)
{nParticle_verreShape.lifespanPP = 0.0;}
Multiple emitters for same nParticuleShape :
Select nParticle, shift select emitter > nParticule > Use selected emitter
or
duplicate emitter using CTRL+d then Window -> Relationship Editors -> Dynamic Relationships, select the particles in the left side of the window, check Emitters in the upper part of the right window, and select both emitters. source
Change particule color with age - Vray
Add Vray per particle attribute export to nParticleShape.
Scroll down to extra attribute and check "age".
Assign a shader with a U ramp in diffuse (delete the placement node of the ramp) to the particle.
Create a particleSampler node and connect to ramp : particlesampler.age -> ramp.uCoord.
Randomize particule color - Vray
Add user scaler 1pp attribute to nParticleSHape
add runtime before dynamics expression to it : nParticleShape.userScalar1PP = rand(1);
Add Vray per particle attribute export to nParticleShape.
Scroll down to extra attribute and check "userScalar1PP"
Assign a shader with a U ramp in diffuse (delete the placement node of the ramp) to the particle.
Create a particleSampler node and connect to ramp : particlesampler.userScalar1PP -> ramp.uCoord.
Sprite
For simple setup use nParticles -> sprite Wizard.
For sequence file texture without spriteWizard in file node animate image number and check interactive sequence caching.
if random on birth, create spriteNumPP et expression nParticleShape1.spriteNumPP = int(rand(1,4));
For scale add dynamic attribute sprite scaleX PP and spritescale Y PP, right click and create ramp
For random rotate add attribute sprite twist PP and add creation expression nParticleShape1.spriteTwistPP = rand(-180,180);
pour animer rotation dans runtime expression :
nParticleShape1.spriteTwistPP += 1;
Display age (or other attribute) in viewport
particleShape -> shading -> numeric
attribute name : age
attribute name list
Move bad particle to hide them (dirty way)
Select individual particle (right click -> particle) then add a cluster to them and move the cluster !
http://www.tokeru.com/mayawiki/index.php?title=Particles
Steppy movement (ex : when attach emitter to motion path)
Create cache : evaluate every 0.2 and save every 5 and change the subframe in nucleus if needed.
11/28/14
MAYA _ surface attach/rivet
To create a locator that follow a face, in plugin manager load muscle, select two edges on your mesh, then :
Animation > Muscle > Bonus Rigging > Surface Attach
or use a follicule
vimeo.com/47456885
Animation > Muscle > Bonus Rigging > Surface Attach
or use a follicule
vimeo.com/47456885
11/20/14
AFTER EFFECTS _ tips
To launch a second instance of After effects :
"C:\Program Files\Adobe\Adobe After Effects CC 2015.3\Support Files\AfterFX.exe" -m
type it in cmd (windows) or save it in a .bat file and double click.
Shortcuts
b / n work area end / start
- / = zoom in/out timeline
ctrl shift h Toggle Layer Controls in viewport
shift F4 toggle parent column
F4 toggle column
ctrl a select all
ctrl shift a / F2 deselect all
ctrl L lock layer
ctrl shift t open effect panel for selected layer
ctrl shift p open dialog box for position of selected layer
ctrl+ increase scale selected layer
ctrl- decrease scale selected layer
shift F3 toggle graph editor/layer mode
ctrl shift d split layer according time position
shift + / shift - change blending mode
[ in point(start) of the layer
] out point (end) of the layer
Alt Ctrl Shift N Split the frame containing the active viewer and create a new locked viewer
x focus selected layer
Ctrl+Alt+B Set work area to duration of selected layers
Shift+Esc Toggle between two recent composition
Ctrl+Alt+U To choose which layer controls to show in a view, shortcut for : choose View > View Options
Alt+Shift+M Set key on mask path for selected layer
L Toggle waveform on timeline
To manually edit/add shortcuts, edit the .txt file located here:
C:\Users\UserName\AppData\Roaming\Adobe\After Effects\*.*\Adobe After Effects *.* Shortcuts.txt
- "ToggleTabPanelMaximize" = "(RParen)"
- "TimeTrimIn" = "(Ctrl+Alt+Shift+I)"
- "TimeTrimOut" = "(Ctrl+Alt+Shift+O)"
- for azerty keyboard, add "Pad" before numbers ex : 1 -> Pad1
Easy crop comp : select region of interest then composition - crop comp to region of interest
Preserve underlying transparency (small T check) = clipping mask in Photoshop
ctrl + double click pan behind tool = pivot to center
Some expressions
"C:\Program Files\Adobe\Adobe After Effects CC 2015.3\Support Files\AfterFX.exe" -m
type it in cmd (windows) or save it in a .bat file and double click.
Shortcuts
b / n work area end / start
- / = zoom in/out timeline
ctrl shift h Toggle Layer Controls in viewport
shift F4 toggle parent column
F4 toggle column
ctrl a select all
ctrl shift a / F2 deselect all
ctrl L lock layer
ctrl shift t open effect panel for selected layer
ctrl shift p open dialog box for position of selected layer
ctrl+ increase scale selected layer
ctrl- decrease scale selected layer
shift F3 toggle graph editor/layer mode
ctrl shift d split layer according time position
shift + / shift - change blending mode
[ in point(start) of the layer
] out point (end) of the layer
Alt Ctrl Shift N Split the frame containing the active viewer and create a new locked viewer
x focus selected layer
Ctrl+Alt+B Set work area to duration of selected layers
Shift+Esc Toggle between two recent composition
Ctrl+Alt+U To choose which layer controls to show in a view, shortcut for : choose View > View Options
Alt+Shift+M Set key on mask path for selected layer
L Toggle waveform on timeline
To manually edit/add shortcuts, edit the .txt file located here:
C:\Users\UserName\AppData\Roaming\Adobe\After Effects\*.*\Adobe After Effects *.* Shortcuts.txt
- "ToggleTabPanelMaximize" = "(RParen)"
- "TimeTrimIn" = "(Ctrl+Alt+Shift+I)"
- "TimeTrimOut" = "(Ctrl+Alt+Shift+O)"
- for azerty keyboard, add "Pad" before numbers ex : 1 -> Pad1
Easy crop comp : select region of interest then composition - crop comp to region of interest
Preserve underlying transparency (small T check) = clipping mask in Photoshop
ctrl + double click pan behind tool = pivot to center
Some expressions
loopOut(type = "continue");
loopOut(type = "cycle", numKeyframes = 2)
loopOut(type = "pingpong", numKeyframes = 2)
loopOut(type = "offset", numKeyframes = 2)
# force fps animation
posterizeTime(8);
value
# round value
Math.round(effect("Slider Control")("Slider"))
# keep only one decimal
effect("Slider Control")("Slider").value.toFixed(1)
#copy animation from layer and offset time
thisComp.layer(1).position.valueAtTime(time-1)
11/16/14
MAYA / MEL _ flat shaded viewport
edit : Now in Maya 2015 there is an option for that in the viewport -> lighting -> use flat lighting.
I didn't find a simple way to display a flat shaded viewport. So here is a simple script to toggle the viewport with a flat shaded view, usefull to see silouhette when animating. This mel script create a global render layer with a surface shader material override, to change the flat color just modify the surface shader.
I didn't find a simple way to display a flat shaded viewport. So here is a simple script to toggle the viewport with a flat shaded view, usefull to see silouhette when animating. This mel script create a global render layer with a surface shader material override, to change the flat color just modify the surface shader.
// TOGGLE FLAT - using render layer global proc toggleFlat () { if (`editRenderLayerGlobals -q -currentRenderLayer` == "defaultRenderLayer") { // Check if Render Layer FLat exists or create it if (`objExists "RL_FLAT"`) { editRenderLayerGlobals -currentRenderLayer RL_FLAT; } else { createRenderLayer -n "RL_FLAT" -number 1 -makeCurrent -global; // SHADER /// string $shadName = "SH_FLAT"; // Check if Shader doesn't exists and create it if (!`objExists $shadName`) { $shader = `shadingNode -n $shadName -asShader surfaceShader`; setAttr ($shader + ".outColor") -type double3 0.7 0.7 0.7; } hookShaderOverride("RL_FLAT", "", "SH_FLAT"); editRenderLayerGlobals -currentRenderLayer RL_FLAT; } headsUpMessage "FLAT ON"; } else { editRenderLayerGlobals -currentRenderLayer defaultRenderLayer; headsUpMessage "FLAT OFF"; } } toggleFlat ();
11/7/14
11/3/14
NUKE _ $gui
- keep subdivision of 3D objects low in GUI, high in render ($gui?10:100)
- keep motion blur sampling low in GUI, high in render ($gui?3:20)
-"$gui" in expressions will return 1 in the UI and 0 at render time. Great for enabling nodes only when rendering on the farm (use it in the disable knob or Switch node).
source
- keep motion blur sampling low in GUI, high in render ($gui?3:20)
-"$gui" in expressions will return 1 in the UI and 0 at render time. Great for enabling nodes only when rendering on the farm (use it in the disable knob or Switch node).
source
11/2/14
NUKE/PYTHON _ toggle fullscreen viewer
def FullscreenViewer(): m = nuke.menu( 'Viewer' ).findItem( 'Toolbars/Bottom' ) m.invoke() m = nuke.menu( 'Viewer' ).findItem( 'Toolbars/Top' ) m.invoke()
11/1/14
NUKE _ find shortcut .py file
Edit shortcut without using menu.py
edit : nukeinstaldir\plugins\nukescripts\toolbars.py
edit : nukeinstaldir\plugins\nukescripts\toolbars.py
10/29/14
Links
maya:
My Oh Maya!
fevrierdorian.com
cum-md.blogspot.fr
polygonspixelsandpaint.tumblr.com
berniebernie.fr/wiki
mayapy.wordpress.com
mayamel.tiddlyspot.com
http://ewertb.soundlinker.com/mel/mel.php
adrianomuraca.blogspot.fr
http://therenderblog.com
http://scriptsandtidbits.blogspot.fr
http://www.3dbuzz.com/forum/threads/157484-Maya-Demystified-The-Hidden-Marking-Menus
http://www.toadstorm.com/blog/
http://nymayausersgroup.blogspot.fr/
http://ianwaters.co.uk/wp/ MASH
http://bindpose.com RIGGING
Soup
mayaspiral.blogspot.fr
http://www.tokeru.com/mayawiki/index.php?title=Soup
Houdini
http://www.tokeru.com/mayawiki/index.php?title=Houdini
http://ihoudini.blogspot.fr
http://odforce.net/
http://www.andynicholas.com/?cat=41
https://vimeo.com/user2030228
http://berniebernie.fr/wiki/Houdini_101
https://sites.google.com/site/fujitarium/Houdini
http://houdinitricks.com/
http://houdinibasic.blogspot.fr/2007/09/houdini-lesson-1.html
https://jurajtomori.wordpress.com/
V-ray:
https://github.com/BigRoy/mayaVrayCommandDocs/wiki
http://deex.info/wordpress2/vray-for-maya-tricks-and-tips/
nuke:
http://hagbarth.net
http://www.fevrierdorian.com/wiki/Commandes_de_base_(Nuke)
http://chrisglew.com/nuke/pythonscripts/
chrisglew.com
satheeshnuketutorials.blogspot.fr
http://www.tomas-lefebvre.com/#tools
after effects
Jr.Canest's AE Expression document
berniebernie.fr/wiki
My Oh Maya!
fevrierdorian.com
cum-md.blogspot.fr
polygonspixelsandpaint.tumblr.com
berniebernie.fr/wiki
mayapy.wordpress.com
mayamel.tiddlyspot.com
http://ewertb.soundlinker.com/mel/mel.php
adrianomuraca.blogspot.fr
http://therenderblog.com
http://scriptsandtidbits.blogspot.fr
http://www.3dbuzz.com/forum/threads/157484-Maya-Demystified-The-Hidden-Marking-Menus
http://www.toadstorm.com/blog/
http://nymayausersgroup.blogspot.fr/
http://ianwaters.co.uk/wp/ MASH
http://bindpose.com RIGGING
Soup
mayaspiral.blogspot.fr
http://www.tokeru.com/mayawiki/index.php?title=Soup
Houdini
http://www.tokeru.com/mayawiki/index.php?title=Houdini
http://ihoudini.blogspot.fr
http://odforce.net/
http://www.andynicholas.com/?cat=41
https://vimeo.com/user2030228
http://berniebernie.fr/wiki/Houdini_101
https://sites.google.com/site/fujitarium/Houdini
http://houdinitricks.com/
http://houdinibasic.blogspot.fr/2007/09/houdini-lesson-1.html
https://jurajtomori.wordpress.com/
V-ray:
https://github.com/BigRoy/mayaVrayCommandDocs/wiki
http://deex.info/wordpress2/vray-for-maya-tricks-and-tips/
nuke:
http://hagbarth.net
http://www.fevrierdorian.com/wiki/Commandes_de_base_(Nuke)
http://chrisglew.com/nuke/pythonscripts/
chrisglew.com
satheeshnuketutorials.blogspot.fr
http://www.tomas-lefebvre.com/#tools
after effects
Jr.Canest's AE Expression document
berniebernie.fr/wiki
10/9/14
MAYA _ Wire deformer rotation issue
When using a wire deformer with clusters there is rotation/twisting issue, to avoid :
- parent clusters, baseWire and Geo to the same controller
source
- parent clusters, baseWire and Geo to the same controller
source
9/27/14
MAYA/VRAY/PYTHON _ fallof - occlusion shader
create a fallof and occlusion shader for Vray using python
#____________ FALLOF ____________# def shFallof(): # gamma node cmds.shadingNode('gammaCorrect',asUtility=True, n='GammaTemp') cmds.setAttr('GammaTemp.gammaX', 0.455) cmds.setAttr('GammaTemp.gammaY', 0.455) cmds.setAttr('GammaTemp.gammaZ', 0.455) #Creates Ramp cmds.shadingNode('ramp', asTexture=True, n='facingRampTemp') # Remove middle color of ramp cmds.removeMultiInstance( 'facingRampTemp.colorEntryList[1]', b=True ) #Modify Ramp cmds.setAttr('facingRampTemp.colorEntryList[2].color', 0,0,0, type='double3' ) cmds.setAttr('facingRampTemp.colorEntryList[0].color', 1,1,1, type='double3' ) cmds.setAttr('facingRampTemp.colorEntryList[2].position', 1) cmds.setAttr('facingRampTemp.interpolation', 1) #Creates Sampler Info node cmds.shadingNode('samplerInfo', asUtility=True, n='facingSamplerTemp') #Connects Ramp and Sampler cmds.connectAttr('facingSamplerTemp.facingRatio', 'facingRampTemp.vCoord', f=True) cmds.connectAttr('facingRampTemp.outColor', 'GammaTemp.value', f=True) # connect it to a surface shader cmds.shadingNode('surfaceShader', asShader=True, n='SH_TMP_Fallof') cmds.connectAttr('GammaTemp.outValue', 'SH_TMP_Fallof.outColor', f=True) # Select Ramp cmds.select('facingRampTemp', r=True) #Renames nodes so you can use the script as many times as you want cmds.rename('facingRampTemp', 'facingRamp_F') cmds.rename('facingSamplerTemp', 'facingSampler_F') cmds.rename('SH_TMP_Fallof', 'SH_Fallof') cmds.rename('GammaTemp', 'gammaCorrect_F') shFallof() #____________ OCCLU ____________# def shOcclu(): # surface shader cmds.shadingNode('surfaceShader', asShader=True, n='SH_TMP_Occlu') cmds.shadingNode('VRayDirt', asShader=True, n='VrayDirt_TMP') cmds.connectAttr('VrayDirt_TMP.outColor', 'SH_TMP_Occlu.outColor', f=True) #Renames nodes so you can use the script as many times as you want cmds.rename('SH_TMP_Occlu', 'SH_Occlu') cmds.rename('VrayDirt_TMP', 'VrayDirt_O') shOcclu()
MAYA _ float value annotation in viewport
Annotation node can't have float value, only string. So to display a value in viewport:
- dynamic- particles - particle tools : create one particle
- select particle shape and add a float attribute toto
- particleshape - render attribute - particle render type : numeric
- attribute name : toto
- then connect any value (like scaleX) to toto
- dynamic- particles - particle tools : create one particle
- select particle shape and add a float attribute toto
- particleshape - render attribute - particle render type : numeric
- attribute name : toto
- then connect any value (like scaleX) to toto
9/21/14
MAYA/MEL _ toggle
//Toggle Isolate Selected in Current Panel $currentPanel = `getPanel -withFocus`; $state = `isolateSelect -q -state $currentPanel`; if ($state == "0") { enableIsolateSelect $currentPanel 1; } else { enableIsolateSelect $currentPanel 0; } // Toggle SHaded WIreframe string $panel = `getPanel -wf`; modelEditor -e -wos ( !`modelEditor -q -wos $panel` ) $panel; //ToggleOutliner: if ( `window -exists outlinerPanel1Window` ) deleteUI -window outlinerPanel1Window; else tearOffPanel "Outliner" "outlinerPanel" false;
MAYA/MEL _ second outliner
tearOffPanel "Outliner1" "outlinerPanel" false; tearOffPanel "Outliner2" "outlinerPanel" false;
MAYA/VRAY _ linear workflow
Render and VFB settings
For texture map add a Vray texture input gamma attribute
Create a standard gray shader : Vray MTL with gamma correct node in diffuse, 0.5 value color and gamma value 0.455
Subscribe to:
Posts (Atom)