Thursday, October 6, 2011

R.I.P. Steven Paul "Steve" Jobs (February 24, 1955 – October 5, 2011)


SAN FRANCISCO | Thu Oct 6, 2011 10:01am IST

(Reuters) - Steve Jobs, the transcendent Silicon Valley entrepreneur who reinvented the world's computing, music and mobile phone industries and changed the daily habits of millions around the globe, died on Wednesday at the age of 56.

Friday, July 15, 2011

A Small Python Module: Get latest directory

  • import os
  • import time
  • import operator
  • def latestDir(path):
  •     alist={}
  •     now = time.time()
  •     directory=os.path.join(path,"")
  •     os.chdir(directory)
  •     for file in os.listdir("."):
  •         if os.path.isdir(file):
  •             timestamp = os.path.getmtime( file )
  •             # get timestamp and directory name and store to dictionary
  •             alist[os.path.join(os.getcwd(),file)]=timestamp
  •     # sort the timestamp
  •     for i in sorted(alist.iteritems(), key=operator.itemgetter(1)):
  •         latest="%s" % ( i[0])
  •     print "newest directory is ", latest
  •     return latest


Example USE:
scanPath = 'D:/dushyantka'
latestDir (scanPath)

!

Wednesday, June 8, 2011

Nuke | Python

Diving into python these days, customizing Foundry Nuke a lil, 'll get back here... soon.

...

Thursday, March 24, 2011

Source order in Maya

Source order in maya is a bit more complex .... (Edit: and it makes me totally confused!!!)

First up - if you have set system based environment variables to wherever your maya installation resides, -which is normally done by the maya installer when your installation goes as intended- then maya finds the following folder containing MEL scripts in this order:

- program-folder: print(`getenv "MAYA_LOCATION"`+"/scripts/*");

- user script-directory: print( `internalVar -userAppDir`+"scripts");

- maya version specific script-directory: print( `internalVar -userScriptDir`);

although the may-version specific scripts-folder gets sourced last i prefer to put my scripts in the second location, because i don't need to copy any scripts to any new directory when another maya-version comes out- this directory gets sourced by them all!

so there's really no need to specifically source a scripts like that, unless of course you want to RUN the script on maya-startup!

that's something competely different, though!

it is considered good practice however not to run scripts by simply sourcing them. that has to do with the automatic sourcing process described above: every script in those folders get sourced on maya startup- make no mistake about that! so, better do it like this:

eval( "source ""+`internalVar -uad` + "scripts/nicescript.mel"") ;

and if this were a shelfbutton, or if you wanted to run it on startup, you would add the call to the function as well:

nicescript();

in early versions of maya your version of the 'source' command worked like you typed it; nowadays 'source' often fails for reasons that escape me right now, but with 'eval' i never had these problems!

!

Friday, March 18, 2011

Github repositories up and running

This has repositories for the nkPass project and the imageloaders which has the DPX loader for Maya.

happy gitting.

Tuesday, February 15, 2011

Comprehensive Renamer: Maya Rename Script

Comprehensive Renamer: Maya Rename Script


Download Here (CreativeCrash)


One more rename script for Maya, written in mel, I'am trying to make it as feature rich as possible, so all requests are welcome.


Copyright (C) 2011 Dushyant Kumar Kashyap
MEL script for MAYA 8.0+
File: comprehensiveRenamer.mel
Desc: This is a simple mel script that allows the user to rename multiple Objects.
With lots-n-lots of options.
Author: Dushyant Kumar Kashyap (dushyantk@gmail.com)


Usages:  Just Source Script, it will call the required procedure automatically.



   

Tuesday, February 8, 2011

Save Incremental Version



Here's a small code to save an Incremental version of your maya file, so basically, no need to go to Save-As-> type the Name Again, just Copy the code in a MEL Shelf button: and every-time you need make an Incremental save, hit that Button.
  1. global proc incrementalSave()
  2. {
  3. string $f=`file -q -sn`; // get file name
  4. string $ft[]=`file -q -typ`; // file type (mayaAscii, etc.)

  5. if ($f!="")
  6. {

  7. // * extracting base filename (path/basename) and version number *

  8. string $n[],$ext="";

  9. if (tokenize($f,".",$n)) $ext=$n[size($n)-1];
  10. if (size($n)>1) $f=substring($f,1, size($f)-size($ext)-1 );
  11. if ($ext!="") $ext=("."+$ext);

  12. int $x=0, $m=1, $v=0, $d=0, $w=1;

  13. while($x==0)
  14. {
  15. string $e=substring($f,size($f),size($f)); // last character (as string)

  16. if (gmatch($e,"[0-9]")) // last character was a number?
  17. {
  18. $v+=($m*(int)$e);
  19. $m*=10;
  20. $d++; // (count number of digits)
  21. $f=substring($f,1,size($f)-1); // chop last character
  22. }
  23. else $x=1;
  24. }

  25. // * renaming current file (with incremented version number) *

  26. $v++; // increment version number
  27. string $vs=("000000000"+(string)$v);

  28. if ($d<1) $d=2; if ($d>8) $d=8;

  29. $vs=substring($vs,size($vs)-$d+1,size($vs));

  30. $f=($f+$vs+$ext);

  31. if (`confirmDialog -t "Save [+]" -m ("Save Scene As '"+$f+"' ?") -b "Ok" -b "Cancel" -cb "Cancel" -ds "Cancel"`!="Cancel")
  32. {
  33. file -rename $f;

  34. if (`file -q -ex $f`)
  35. {
  36. if (`confirmDialog -t "File Already Exists" -m ("Overwrite already existing file '"+$f+"'?") -b "Yes" -b "No" -cb "No" -ds "No"`!="Yes")
  37. $w=0;
  38. }

  39. if ($w)
  40. {
  41. //FileMenu_SaveItem;
  42. warning("projMan: Saving File...");
  43. evalEcho("file -save");
  44. addRecentFile($f,$ft[0]); // add to the recent files list
  45. }
  46. }
  47. }
  48. else projectViewer SaveAs;
  49. }
  50. incrementalSave;

Thursday, February 3, 2011

Learn to Code: The Full Beginner's Guide

Learn to Code: The Full Beginner's Guide is 4.5-part intro series on Javascript from LifeHacker. It might be useful for using expressions in After Effects. And it doesn't leave you hanging since the epilogue shares some best pactices and additional resources.

Here's a sample movie:


 

Friday, January 21, 2011

Photo Metric Light Setup 0.1.2 (maya script)

Ok, so here’s what I’ve come-up with recently, This script can be used, to generate a simple Photo Metric Light Setup.

Download Here (CreativeCrash)

It works 100% accurate only if there’s no Other Area Light in the Scene.
This limitation is due to the fact that I am still working on fetching th newly created areaLight-name in a variable. (THIS IS FIXED ;)

Rest all works fine I guess, just source the script and it’ll create a setup for you. I’ll try to enhance it with UI and other stuff as and when I get time. Please check if I’ve left anything else.

EDIT: January 22, 2011: I’ve done changes to make it work everytime-and-everywhere with Existing Lights (with Maya 2011+ ). So everything's perfect now.

And if CreativeCrash ditches you, check this link: http://area.autodesk.com/forum/autodesk-maya/mel/photometric-light-creation/

EDIT: January 24, 2011:
(1) When it creates the light, the “Illuminates by default” option is unchecked, so the light is not active, This is fixed now.
(2) It creates a new mia_exposure_simple node each time the button is pressed. It should first check and see if an expsure node already exists on a camera and if so, not create a new one. Fixed.
(3) It should have been mia_exposure_photographic node instead of mia_exposure_simple. That's fixed too.


EDIT: January 31, 2011:
now this scripts connects mia_exposure_photographic to all cameras in Scene/


And CreativeCrash link is working perfectly. Finally they approved the file ;)