Heribert Raab

Online Portfoilo and Blog

fractals of the week

Maya Fluid alpha issue with Container Scale?

sometimes when you fluids container size is too big and you get wired alpha channel issues in mental ray like this:
container_alpha

there is an easy fix to this. just turn off “pass custom alpha channel” in custom entries option of the rendersettings. in some cases you should only overlapping fluids container in one render layer.

alphachannel

Maya Speed Attribute Python Script

this script add a speed attribute to the selected object and calculates it in realtime. Very handy for setup effects, animating vehicles etc.. github link

import maya.cmds as cmds
import math

Psel = cmds.ls( selection=True )
try:

nodeT = cmds.nodeType( Psel[0] )
print nodeT
if nodeT == ‘transform':
checkAttr = cmds.objExists(Psel[0]+’.speed’)
print checkAttr
if checkAttr == True:
listexpr = cmds.listConnections(Psel[0]+’.speed’)
if listexpr == None :
ex1 = ‘float $lastPosX = `getAttr -t (frame-1) ‘+Psel[0]+’.tx`;’
ex2 = ‘float $lastPosY = `getAttr -t (frame-1) ‘+Psel[0]+’.ty`;’
ex3 = ‘float $lastPosZ = `getAttr -t (frame-1) ‘+Psel[0]+’.tz`;’
ex4 = Psel[0]+’.speed = abs (mag (<<‘+Psel[0]+’.translateX,’+Psel[0]+’.translateY,’+Psel[0]+’.translateZ>>)- mag (<<$lastPosX,$lastPosY,$lastPosZ>>) );’
exAll = ex1+ex2+ex3+ex4
cmds.expression( o=Psel[0], s=exAll)
else:
cmds.delete(listexpr[0])
ex1 = ‘float $lastPosX = `getAttr -t (frame-1) ‘+Psel[0]+’.tx`;’
ex2 = ‘float $lastPosY = `getAttr -t (frame-1) ‘+Psel[0]+’.ty`;’
ex3 = ‘float $lastPosZ = `getAttr -t (frame-1) ‘+Psel[0]+’.tz`;’
ex4 = Psel[0]+’.speed = abs (mag (<<‘+Psel[0]+’.translateX,’+Psel[0]+’.translateY,’+Psel[0]+’.translateZ>>)- mag (<<$lastPosX,$lastPosY,$lastPosZ>>) );’
exAll = ex1+ex2+ex3+ex4
cmds.expression( o=Psel[0], s=exAll)

else:
print “test”
cmds.addAttr( Psel[0],longName=’speed’ )
ex1 = ‘float $lastPosX = `getAttr -t (frame-1) ‘+Psel[0]+’.tx`;’
ex2 = ‘float $lastPosY = `getAttr -t (frame-1) ‘+Psel[0]+’.ty`;’
ex3 = ‘float $lastPosZ = `getAttr -t (frame-1) ‘+Psel[0]+’.tz`;’
ex4 = Psel[0]+’.speed = abs (mag (<<‘+Psel[0]+’.translateX,’+Psel[0]+’.translateY,’+Psel[0]+’.translateZ>>)- mag (<<$lastPosX,$lastPosY,$lastPosZ>>) );’
exAll = ex1+ex2+ex3+ex4
print exAll
cmds.expression( o=Psel[0], s=exAll)

else:
print ‘—> select transform !’

except TypeError :
print ‘—> select transform !’

this script adds apeed attribute to selected object and display it in maya opengl view. When you select different object you have change the frame to get the update. gitbhub link

import maya.cmds as cmds
import math

def getSpeed(*args):

res = 0
Psel = cmds.ls( selection=True )
try:

nodeT = cmds.nodeType( Psel[0] )
print nodeT
if nodeT == ‘transform':
checkAttr = cmds.objExists(Psel[0]+’.speed’)
print checkAttr
if checkAttr == True:
listexpr = cmds.listConnections(Psel[0]+’.speed’)
if listexpr == None :
ex1 = ‘float $lastPosX = `getAttr -t (frame-1) ‘+Psel[0]+’.tx`;’
ex2 = ‘float $lastPosY = `getAttr -t (frame-1) ‘+Psel[0]+’.ty`;’
ex3 = ‘float $lastPosZ = `getAttr -t (frame-1) ‘+Psel[0]+’.tz`;’
ex4 = Psel[0]+’.speed = abs (mag (<<‘+Psel[0]+’.translateX,’+Psel[0]+’.translateY,’+Psel[0]+’.translateZ>>)- mag (<<$lastPosX,$lastPosY,$lastPosZ>>) );’
exAll = ex1+ex2+ex3+ex4
cmds.expression( o=Psel[0], s=exAll)
else:
cmds.delete(listexpr[0])
ex1 = ‘float $lastPosX = `getAttr -t (frame-1) ‘+Psel[0]+’.tx`;’
ex2 = ‘float $lastPosY = `getAttr -t (frame-1) ‘+Psel[0]+’.ty`;’
ex3 = ‘float $lastPosZ = `getAttr -t (frame-1) ‘+Psel[0]+’.tz`;’
ex4 = Psel[0]+’.speed = abs (mag (<<‘+Psel[0]+’.translateX,’+Psel[0]+’.translateY,’+Psel[0]+’.translateZ>>)- mag (<<$lastPosX,$lastPosY,$lastPosZ>>) );’
exAll = ex1+ex2+ex3+ex4
cmds.expression( o=Psel[0], s=exAll)

else:
print “test”
cmds.addAttr( Psel[0],longName=’speed’ )
ex1 = ‘float $lastPosX = `getAttr -t (frame-1) ‘+Psel[0]+’.tx`;’
ex2 = ‘float $lastPosY = `getAttr -t (frame-1) ‘+Psel[0]+’.ty`;’
ex3 = ‘float $lastPosZ = `getAttr -t (frame-1) ‘+Psel[0]+’.tz`;’
ex4 = Psel[0]+’.speed = abs (mag (<<‘+Psel[0]+’.translateX,’+Psel[0]+’.translateY,’+Psel[0]+’.translateZ>>)- mag (<<$lastPosX,$lastPosY,$lastPosZ>>) );’
exAll = ex1+ex2+ex3+ex4
print exAll
cmds.expression( o=Psel[0], s=exAll)

else:
print ‘—> select transform !’

except TypeError :
print ‘—> select transform !’
res = cmds.getAttr(Psel[0]+’.speed’)
return res
try:
cmds.headsUpDisplay( ‘SpeedHUD’, section=1, block=0, blockSize=’small’, label=’Speed’, command=getSpeed, event=’timeChanged’, nodeChanges=’attributeChange’ )
except RuntimeError:
cmds.headsUpDisplay(‘SpeedHUD’, remove=True)

 

Ratchet and Clank trailer

what i am currently working on :

i’ve worked on 4 shots in the trailer.

sculptris head

i found Sculptirs on my hard disk and this lead me to quick and dirty 3d sketch

Fractals of the week

new paintings

rushed paintings in few minutes…. just for training

fractals of the week

more daily 5 minutes sketches…. the last ones…

mandebulb

testing Mandelbulb volume rendering inside maya:

procedural scripting

i trying to get more art out of the procedural power of houdini

5 line in houdini and instance cubes on it (rendered in mantra):

brzel_sin_v002

 

 

5 minutes sketches

maya tip: passing on deformed particle and geomtrie

nonlinear deformers or scuplting on geo/partilces are great to tweak your sims. but it will not written into the cache file. the deformation gets always added on top of the cache. this is little bumpy, example: if wanna use the deformed nParticle to emitt into a fluids container.
in this case, you can use the new node editor to plug the outGeometry of the deformer into you depending geo/nodes like the fluids emitters. easy !

Screenshot-1

one way doodles

during the bus drive usin a nice app to draw on galaxy note. it contains cools brushs and canvas to paint on, but no undo.
if i make mistake, i have work/paint around…

Maya playblast tool2

here is an improved version of the playblast script. Jean Denis pointed out the playblasting of more cameras is sequential and parallel. (thanks for that!) which would extreme slow in heavy scene with complex characters or large cache file. the new version of the script capture all cameras on each frame at the same time.  this way, maya have evaluate once on each frame and not do extra evaluation for each camera.  this way you can playblast simulations with different camera without caching.

i am using the active viewport for each camera to keep resolution constant. (and it avoid maya viewport issues).

* just made a little update to free maya after player is showing up

** another update: i added 2 more botton’s for houdini “mplay” tool. if you have houdini installed (even the demo version) it will bring up a mplay app and play until 4 cameras simultaneity in one window. (row or quas view)
tip: with shortcut “s” you link all view together and zoom synchronously

*** you use rv tile option (menu tools–>tile) to view all cameras side by side. i set it to default in the script

**** bugfix with timerange

Screenshot
download it here

// written ny Heribert Raab heribertraab@gmail.com
// the tool create outliner with contain just cameras
// clicking on each camera switches through camera on your active viewport
// playblast botton will playblast all selected camera with aktiv viewport and load them into fcheck or rv

global proc playB(string $player)
{
string $select[] = `ls -sl`;

// setup playblast dir
//string $path = “/tmp/test/”;
string $frames2[] ;
string $fl[] = `renderSettings -firstImageName -fullPathTemp`;
string $f2[] = `renderSettings -firstImageName`;
string $path = substituteAllString($fl[0], $f2[0], “”);
int $min = `playbackOptions -q -minTime`;
int $max = `playbackOptions -q -maxTime`;
int $fr = $max – $min;

int $f;
string $all;
string $play;
string $scene = `file -q -sn -shn`;
string $scname = substituteAllString($scene, “.”, “_”);

for ($f=$min;$f <$max;$f++)
{
// playblast selected Cameras
$numInts = size($select);
$ridNum = $numInts +1;
int $i=0;
string $seq[];

for ($i=0;$i < $numInts; $i++)
{
lookThru ($select[$i]);
$frames2[$i] = $path+$scname+”_”+$select[$i];
//print ($frames2[$i]+”.”+$f+”\n”);
playblast -st $f -et $f -forceOverwrite -format image -fp 4 -compression “jpg” -f($frames2[$i]) -viewer 0 -offScreen -percent 100 -quality 70;
}
}
$all = stringArrayToString($frames2, “.* “);

//image player command
$play = ($player+” “+$all+”*”);

if ($player ==”mplay”) $play= ($player+” -V 2 2 -g “+$all+”* &”);
if ($player ==”mplay2″) $play= (“mplay -V 4 1 -g “+$all+”* &”);
if ($player ==”rv”) $play_rv = ($player+” -tile “+$all+”* &”);
if ($player ==”fcheck”) {$play = ($player+” -S “+$all+”* &”);}

print $play;print “\n”;
system( $play );
}

global proc look(){lookThru `ls -sl`;}

string $filterP = `itemFilter -byType camera `;

window cameras;
frameLayout -labelVisible false ;
string $panel = `outlinerPanel`;
columnLayout -adjustableColumn true;
button -label “Playblast selected Cams with RV” -command “playB rv”;
button -label “Playblast selected Cams with Fcheck” -command “playB fcheck”;
button -label “Playblast selected Cams with mPlay quad” -command “playB mplay”;
button -label “Playblast selected Cams with mPlay row” -command “playB mplay2″;

string $outliner = `outlinerPanel -query -outlinerEditor $panel`;
outlinerEditor -edit
-mainListConnection “worldList”
-selectionConnection “modelList”
-f $filterP
-selectCommand look
-showSetMembers true
-setFilter defaultSetFilter
$outliner;
showWindow;

maya effects outliner

its not always easy to find effects-related nodes in bigger maya scene files

this effects outliner shows only “effects”items and adds an handy dynamic Relationshipeditor botton.
(python script)
download it here

import maya.cmds as cmds
import math

# written ny Heribert Raab heribertraab@gmail.com
# create outliner window with show only effect related item’s

#setup filter with nodetypes
filterDyn = cmds.itemFilter(byType=(‘fluidEmitter’,’pointEmitter’,’rigidBody’,’nRigid’,’fluidShape’,’nParticle’,’nucleus’,’particle’,’nCloth’,’rigidConstraint’))

#delete allready open effects outlines
renUI = ‘EffectsOutliner’
if cmds.window(renUI, exists = True):
cmds.deleteUI(renUI)
def dynEditor(*args):
cmds.DynamicRelationshipEditor()

cmds.window(‘EffectsOutliner’,title=’EffectsOutliner’)
cmds.frameLayout( labelVisible=False,)
panel = cmds.outlinerPanel()
outliner = cmds.outlinerPanel(panel, query=True,outlinerEditor=True)
cmds.outlinerEditor( outliner, edit=True, mainListConnection=’worldList’, selectionConnection=’modelList’, filter=filterDyn , showShapes=True, showAttributes=False, showConnected=False, showAnimCurvesOnly=False, autoExpand=True, showDagOnly=True, ignoreDagHierarchy=True, expandConnections=False, showNamespace=True, showCompounds=True, showNumericAttrsOnly=False, highlightActive=True, autoSelectNewObjects=False, doNotSelectNewObjects=False, transmitFilters=False, showSetMembers=True, setFilter=’defaultSetFilter’ )

cmds.columnLayout( adjustableColumn=True )
cmds.button( label=’DynamicRelationshipEditor’, command=dynEditor)
cmds.showWindow()

Procedural drawings

Quick doodles I did on the bus

image

image

image_3_20140221213741932

fractals.procedural of the week 07

fractals.procedural of the week 06

fractals.procedural of the week 05

fractals.procedural of the week 04

exploring new little tool named fractaline.  interesting concept, putting all tranforms into connected line.  very intuitive to use.

fractals.procedural of the week 03

chaotics splines:

fractals.procedural of the week 02

fractals.procedural of the week 01

Ljapunow Fractals

2D Mandelbrot exploring

continuing my fractal noise quest.

2D fractal Christmas stars

I am playing with some apps on my tablet

houdini style in maya

bullet2qWith new Node Editor in maya (since version 2013) , it open up for new kind setup’s.  If you simple map attribudes of particles into custom locator, you are able to work more visual with expression in the node editor. it feels similar to houdini vex or VOP SOP network editors. its much smoother way to work, specially  if hand off rigs and setup to other TD’s. it was possinle to this kind setup in maya’s old grapheditor but the painful and slow. it redraws all connection at any change and with a complex setup it slow down your working speed.

procedual splines with fields

i am having fun with software called “amberlight”. i should recreate this of procedural stuff in 3d Application like houdini, maya or modo –> this could be a interresstiong look with raytracer.

Reference for vfx part 1

currently i am working on FX book. here a little sub chapter of it.

To create special effects digital you don’t have to recreate or simulate physically correct like in real world. its not possible anyway. you do not need fancy, custom made solvers. in most cases you just need ordinary standard tools which every 3D package has. First you have to understand, how nature works from visual viewpoint.
the most important thing before you start an effect is, to research: References. you should get as many References as possible. lets use a waterfall / watersplashes as an example. Many fx-artists use videos as visual Reference, but they do not analyze it or do it wrong. most Reference videos give you an idea how your endresult should look like, but you have to remember most of videos are shot in 24 or 30 fps. that means you see motionblurred frames, but you will work opengl viewport of 3d software, with means without motionblur. if recreate you a simulation based on movie, it will ready have motionblured look and the renderengine will add a motionblur at rendertime and this makes your fx streaky (you double the motionblur).

most of the time i go out shot reference video or pictures by myself. l prefer my Nikon v1 Camera. Its cheap (300$), have highend lenses, do superslow motion videos and shot with 1/16000 shuttertime. but any DsLR,with 1/4000 shutter, should do the Trick  as well. With shuttertime of 1/4000 or 1/16000, you will get a frame of your reference without motionblur. as you see in the example:

(click on the images and look at the shuttertime on bottom of the images)
if you use “highspeed” images as reference for your scene to create shapes for droplets, you get more realistic look of your effect. your rendersoftware will add correct motionblur.

closeup look at droplets: motionblur (1/160 shutter) and without motionblur (1/8000 shutter)

DSC_2810 DSC_2811

after you got proper references, you need to read your reference images and extract information to understand visual language. as you can see there are not just bunch blurred particle falling down. there a lot of clumbing “blobb’ing” going on. more details how to read and analyze the reference,  i will explain it in part 2