View Full Version : Python Listing Transform Nodes

11 November 2010, 09:45 PM
Hi, im trying to learn coding GUI's for Maya using Python and im trying to write a function which will list all of the transform nodes within a scene. I would greatly appreciate any help, thanks.

p, li { white-space: pre-wrap; }

# function to list the transform nodes in a scene
import maya.cmds as cmds
AllTransform =
print AllTransform

11 November 2010, 03:38 PM
Here's a VERY simplistic example that will get you started.

from maya import cmds as mc

def listTransformsUI():
i= 0
mc.window(width=150, height= 150, title="transforms")
layoutForm = mc.formLayout()
tsl = mc.textScrollList()
items =
while (i < len(items)):
mc.textScrollList(tsl, edit=True, append=items[i])
i = i + 1
mc.formLayout( layoutForm, edit=True, attachForm=[(tsl, 'top', 0), (tsl, 'left', 5), (tsl, 'bottom', 5), (tsl, 'right', 5)] )


CGTalk Moderation
11 November 2010, 03:38 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.