Zeroing out. Or in.

Today I wrote a little tool that simply groups whatever you have selected, for the purposes of cleaning up transforms. Also works with multiple objects selected and groups them all under a group in the same worldspace as the first selected object. Grab the code here and place it on your shelf. import maya.cmds as […]

Generative coding

I keep coming back to procedural generation. Something about the unpredictable nature of parametric design really piques my interest. I’ve begun scripting a system that will be the basis of a generative project, here it is: import maya.cmds as cmds import random curveNumber = 1 curveName = ‘string’ + str(random.randrange(1,100)) count = 0 for i […]

Naming and renaming

During the last job I was on, we were receiving rigs from another company. These rigs did not always match our hierarchy and naming conventions, so, part of my job was to recompile these rigs to match our conventions. One common and potentially time consuming job was the renaming of control curves. We would receive […]

Saving time

I spent today putting finishing touches on a script that saves a new version of the current scene. and a button icon to go with! Grab the script here and pop it on your shelf. ################################################################################################ ################################################################################################ ### Save new version of current scene ### ### By Alastair Richardson ### ### May, 2013 ### ### […]

Notepad ++

I use Notepad ++ as my script editor when I’m working on large coding projects. Because when Maya crashes it takes any unsaved script changes with it! But being used to the MEL command highlighting in the Maya script editor I went hunting and turned up this: http://www.creativecrash.com/downloads/applications/syntax-scripting/c/mel-language-definition-for-notepad- Then I picked up a Maya-ish theme […]

Cluster tool

I wrote a bit of code that will create a cluster on polygon geometry regardless of selection type, eg face, edge or vertex. Speeds things up a little. import maya.cmds as cmds def makeCluster(): selection = cmds.ls(sl=True) for i in selection: string = str(i) try: object,selected = string.split(‘.’) sel,CVnum = selected.split(‘[‘) if sel == ‘e’: […]