Maya Scripts?

Isn’t this the reason to have a blog? To post stuff that might help people? Yes Mom, I am going to give it a try! I am going to do my best!!!

Ok, my best wasn’t good enough. No code for you my friend. Blame WordPress’s insistence to removing spaces in text.

LATER: Hah, eat this, WordPress!

After the break, a small python script to quickly create a renderlayer with a name:

import maya.cmds as mc

gorbenWindow = mc.window()
if(mc.window(gorbenWindow, query=True, exists=True)):
   mc.deleteUI(gorbenWindow)

gorbenWindow = mc.window(width=400, height=400, title="New Render Layer")
mc.columnLayout(width=400, columnWidth = 10, rowSpacing = 1)
outputField = mc.textFieldButtonGrp(label='Layer Name', buttonLabel = "Create", buttonCommand = 'doProc()', text='', changeCommand='doProc()')

def doProc():
   mc.createRenderLayer(name=mc.textFieldButtonGrp(outputField, query=True, text=True))
   mc.deleteUI(gorbenWindow)

mc.showWindow(gorbenWindow)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>