Wednesday, July 10, 2013

Sherlock Holmes

First bit of progress on Sherlock Holmes as played by Jeremy Brett. I haven't done a head model straight from Maya in a long time, so, that's what I've decided to do. This first initial stage I'm doing without reference planes in Maya. I'm trying to force myself to really analyze Brett's features and not go into auto-pilot. I'm far from satisfied, but it's a start! Eventually I'll take this into zbrush and line everything up better to some reference before doing skin pores and wrinkles.

Friday, May 3, 2013

maya.cmds help snippet

For a long time I'd leave a mel tab up in the Maya script editor simply to use the help command to print maya help. The help command is also in the maya.cmds module but the syntax is a bit annoying to use.

mel      vs.    python
help ls'ls')

I finally got sick enough of doing this to create a little helper function to place in my

#Convenience function for
def docs(fn):

So now I can just go...


Monday, April 29, 2013


Easily batch process Maya files with any number of modules. mayabatch.actions subpackage comes with a template module.
Command line
python --help

Multiple Worker Processes through multibatch module

Cross-platform support (Haven't tested on Mac or Linux yet but it *should* work.)

Tested on systems with Maya 2012 and 2013

Extensible through actions modules
Command Line Single Process Example:
python --queue --modules mayabatch.actions.actionA mayabatch.actions.actionB
Python Multiprocessing Example:
import os
import mayabatch.multibatch as mb

if __name__ == '__main__':
    path = 'C:/Users/Administrator/Documents/maya/projects/default/'
    filepaths = []
    for root, subdirs, files in os.walk(path):
        for f in files:
            if os.path.splitext(f)[-1] in ['.ma', '.mb']:
                filepaths.append(os.path.join(root, f))
    modules = ['mayabatch.actions.actionA', 'mayabatch.actions.actionB']
    processes = 4
    mb.main(filepaths, processes, modules)
A simple benchmark produced the following results:
50 maya files
4 processes: 10.433 seconds
1 process: 8.145 seconds

350 maya files
4 processes: 15.353 seconds
1 processes: 26.932 seconds
As you can see it's a balancing act between the amount of processes and files. These tests were run on a system where maya's usersetup script is far from ideal for batch processing.


At the moment filepaths for each individual file are placed in the command line. Depending on the complexity of the paths the maximum length of args in a windows command prompt can be reached quickly. Pickling will be introduced into the mix to work around the command line args limit.

Get it from github:

Thursday, February 21, 2013


This script will look at the animation curves of all selected objects in your scene, and delete unnecessary keys. If the value of the previous and next key is the same as the current key, it will mark that key for  deletion. The result of is that it acts like Delete by Type > Static Channels, while also removing unnecessary keys on all your curves. Let me know if you find any bugs!

import maya.cmds as cmds

def clearFlats():
Clear keys that lie on flat sections of animation curves.
If no channels are selected, clear flats on all keyed channels.
    nodes = = True)
    cmds.undoInfo(openChunk = True) #Capture all changes in a single undo
    for node in nodes:
        #Make Sure we have channels to work on
        channels = cmds.channelBox('mainChannelBox',
                                   query = True,
                                   selectedMainAttributes = True)
        if not channels:
            keyable_attrs = cmds.listAttr(node, keyable = True)
            user_attrs = cmds.listAttr(node, userDefined = True)
            if user_attrs:
            channels = [attr for attr in keyable_attrs
                        if cmds.keyframe('{0}.{1}'.format(node, attr),
                                                query = True,
                                                keyframeCount = True)]
            for channel in channels:
                keyValues = cmds.keyframe('{0}.{1}'.format(node, channel),
                                          q = True,
                                          valueChange = True)
                del_index = []
                if len(keyValues) == 1:
                    for i, keyValue in enumerate(keyValues):
                        if i == 0:
                            if keyValue == keyValues[i + 1]:
                        elif i == len(keyValues) - 1:
                            if keyValue == keyValues[i - 1]:
                            if keyValues[i-1] == keyValues[i+1] == keyValue:
                if del_index:
                                attribute = channel,
                                index = del_index)
        except TypeError:
    cmds.undoInfo(closeChunk = True) #Close our undo chunk

if __name__ == '__main__':

Friday, February 1, 2013

Cloud RnD

Various styles of maya fluid clouds rendered in mental ray ~30 seconds per frame at 960x540.

Tuesday, January 29, 2013

Fiber Test

Messing around with fiber mesh on this speed sculpt from this past weekend. The groom tools in ZBrush are sooo nice. I hadn't realized you could use standard brushes with hair until a half hour in, overall ZBrush may just be the most powerful hair grooming tool I've used.

It seems the Groom Long brush is the most versatile, it allows you to only modify hair past the point that you click on a hair. So if you click the middle of a hair, you can groom just the back half. Super useful because it allows you to maintain previously groomed sections of hairs. To get a really specific hairstyle I'll probably still be manually drawing curves in maya...we'll see!