colorAtPoint Maya command

Posted by on Apr 8, 2012 in animation, MEL | No Comments

Expressions for transforming nodes via pixel values.

string $cubes2[] = `ls -type transform "newCube*"`;
for( $each in $cubes2) {
float $u = `getAttr($each + ".translateX")`;
float $v = `getAttr($each + ".translateZ")`;
float $capValueF[] = `colorAtPoint -o RGB -u (($u+40)/80) -v (($v+40)/80) file1`;
setAttr ($each + ".scaleY") (($capValueF[0]+$capValueF[1]+$capValueF[2])*10);
setAttr ($each + "Lam.incandescenceR") $capValueF[0];
setAttr ($each + "Lam.incandescenceG") $capValueF[1];
setAttr ($each + "Lam.incandescenceB") $capValueF[2];
}
flushUndo;

Errol Morris

Posted by on Jan 21, 2012 in blog, film | No Comments

Errol Morris is a documentary filmmaker famous for his investigatory films.

Check out an engaging interview with Morris here.

Filmography:

Gates of Heaven (1978)
Vernon, Florida (1981)
The Thin Blue Line (1988)
The Dark Wind (1991)
A Brief History of Time (1991)
Fast, Cheap and Out of Control (1997)
Mr. Death: The Rise and Fall of Fred A. Leuchter, Jr. (1999)
First Person (2000)
The Fog of War: Eleven Lessons from the Life of Robert S. McNamara (2003)
Standard Operating Procedure (2008)
Tabloid (2010)

Step Printed Slow Motion

Posted by on Jan 21, 2012 in blog, film | No Comments

Step printed effect. Wong Kar Wai in slow motion.

An interesting thread about this technique at Cinematography.com.

An essay about Wai’s films. Includes some commentary about the step print effect in his films.

Rest and Relaxation

Posted by on Jan 14, 2012 in apps, blog, language, travel | No Comments

การพักผ่อน และการผ่อนคลาย = Rest and Relaxation

20121214-220242.jpgImage of Koh Phi Phi.

Example of ComicBook! App in action.

Posted by on Jan 6, 2012 in blog | No Comments

20120106-223345.jpg

See a video here.

Vegas CES

Posted by on Jan 6, 2012 in blog | No Comments

Traveling to Vegas, January 10th through the 16th, for the Consumer Electronics Show. We will be featured in the Samsung booth, showing off our app ComicBook!.

Check out ComicBook! here.

WordPress display links, hide title

Posted by on Dec 30, 2011 in web, wordpress | No Comments

Display all links in a particular WordPress links category, but hide the category title:

<?php wp_list_bookmarks('category=224&categorize=0&title_li='); ?>

Uses the wp_list_bookmarks function.

http://codex.wordpress.org/Template_Tags/wp_list_bookmarks

Python import modules

Posted by on Dec 30, 2011 in python | No Comments

Simple workaround to setting the environment variable, so that you can import custom modules saved at the specified path.

import os,sys
sys.path.append('/path/to/modules/')

Else to set the environment variable on the Mac by adding:

export PYTHONPATH=/path/to/modules/

to the .bashrc file

Python file renaming

Posted by on Dec 10, 2011 in python | No Comments

A renaming script that I use to rename photos, rendered animation, or video frames. Warning, this script will rename your files! There is no undo. Use with care. Constructive comments about Python usage very welcome.

Will work on Unix-like operating systems, not sure about Windows.

# Python renamer script: creates a function called pyrename(). pyrename() will rename all files in a given folder.
# Usage: Put all the files you want to rename in an isolated folder. The function can be called by typing pyrename().
# Warning, this script will rename your files. There is no undo. Use with care. 
def pyrename():
    'Put all the files you want to rename in an isolated folder. The function can be called by typing pyrename().'
    import os

    #function to ignore the hidden . files in a directory. Note the use of the 'yield' keyword
    def listdir_nohidden(path):
        for f in os.listdir(path):
            if not f.startswith('.'):
                yield f
                
    path = raw_input('path to folder?: ')
    #get the files from the folder and put the filenames in a list called files
    theFiles  = listdir_nohidden(path)
    files = []
    for f in theFiles:
        files.append(f)

    #user supplied values
    print 'Want to replace a character or string in your file names?'
    want_to_replace = raw_input('Type y or n. Or to completely rename type w: ')
    if want_to_replace == 'y':
        replace = raw_input('Type the character or string that you want to replace (FYI can be a space!): ')
        replace_with = raw_input('Type the character or string that you want to replace with: ')
    elif want_to_replace == 'w':
        replace = ''
        replace_with = raw_input('Type new name: ')
    else:
        replace = ''
        replace_with = ''   

    if want_to_replace != 'w':
        want_numbers = raw_input('Want your files numbered? type y or n: ')
        if want_numbers == 'y':
            zeros = raw_input('Type the amount of padding zeros you need (using a single integer, like 4): ')
        else:
            zeros = 0

    if want_to_replace == 'w':
        zeros = raw_input('Type the amount of padding zeros you need (using a single integer, like "4"): ')

    ext = raw_input('Please type the three letter extension you want to use ex: jpg (NOT the .): ')
    

    #remove extension, put the filenames in a list called names
    names = []
    for f in files:
        if f[-4] == '.':
            names.append(f.replace(f[-4:], ''))
        else:
            names.append(f)

    #add new names, add user supplied extension, put the filenames in a list called namesPlusEx
    namesPlusEx = []
    count = 0
    for f in names:
        if want_to_replace == 'w':
            namesPlusEx.append(f.replace(f, replace_with)+ (('.%.')+zeros+('d'))% count +'.'+ ext) 
        elif want_to_replace != 'w' and want_numbers == 'y':
            namesPlusEx.append(f.replace(replace, replace_with)+ (('.%.')+zeros+('d'))% count +'.'+ ext)
        else:
            namesPlusEx.append(f.replace(replace, replace_with)+'.'+ ext)
        count += 1

    #rename the actual files
    c=0
    for f in files:
        os.rename(path+'/'+f, path+'/'+namesPlusEx)
        c+=1

    print 'You have re-named %d files' % len(files)

rename.py

The following script will remove the first four characters of all files in a specified folder. You may alter the script to remove other characters by altering this line: names.append(f.replace(f[0:4], ”)) change the 0:4 to another bit as defined by python slice notation.


# Python renamer script: creates a function called pyrename(). pyrename() will rename all files in a given folder.
# Usage: Put all the files you want to rename in an isolated folder. The function can be called by typing pyrename().
# Warning, this script will rename your files. There is no undo. Use with care.
def pyrename():
    'Put all the files you want to rename in an isolated folder. The function can be called by typing pyrename().'
    import os
    
    #function to ignore the hidden . files in a directory. Note the use of the 'yield' keyword
    def listdir_nohidden(path):
        for f in os.listdir(path):
            if not f.startswith('.'):
                yield f
    
    path = raw_input('path to folder?: ')
    #get the files from the folder and put the filenames in a list called files
    theFiles  = listdir_nohidden(path)
    files = []
    for f in theFiles:
        files.append(f)
    

    #remove extension, put the filenames in a list called names
    names = []
    for f in files:
        names.append(f.replace(f[0:4], ''))

    #rename the actual files
    i=0
    for f in files:
        os.rename(path+'/'+f, path+'/'+names[i])
        i+=1

    print 'You have re-named %d files' % len(files)




Load More