Online Portfoilo and Blog

  • wpid-landscape3
  • Screenshot_2014-05-03-13-26-26
  • mandelbrot5
  • brzel_sin_v002
  • Screenshot-1
  • Screenshot
  • chaos11 copy
  • chaos6
  • chaos2
  • _20140115_214459
  • splines3
  • AmberlightArtwork04
  • scale01
  • Planetary Vein_20131231171218694
  • wpid-14325f12a7d_2880x1920.jpg
  • wpid-1387803171658.jpg
  • AmberlightArtwork3
  • DSC_2782
  • poster2_05
  • solar_expressB_1

Latest

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

Gallery

Fractals of the week

new paintings

rushed paintings in few minutes…. just for training

Gallery

fractals of the week

more daily 5 minutes sketches…. the last ones…