Accessing reserved names

46 views
Skip to first unread message

bill

unread,
Feb 1, 2008, 3:16:11 PM2/1/08
to python_inside_maya
Hi, this is my first post :)


I am trying to get a list of the selected main attributes from the
"mainChannelBox"


myattr = channelBox(q=1 ,sma=1 ,name = 'mainChannelBox')

this does not work

(by the way, I'm using Pymel and have successfully loaded the pymel
commnds)

thanks,

Bill

colas

unread,
Feb 1, 2008, 4:25:07 PM2/1/08
to python_inside_maya
hi Bill,
try myattr = channelBox('mainChannelBox',q=1 ,sma=1 )

Chadrik

unread,
Feb 1, 2008, 8:11:09 PM2/1/08
to python_inside_maya
also, if using pymel, you can use the object-oriented approach, for
readability's sake:

chnbx = ChannelBox('mainChannelBox')
chnbx.getSelectedMainAttributes()
chnbx.setNiceNames(False)
# etc etc

bill

unread,
Feb 4, 2008, 7:41:06 PM2/4/08
to python_inside_maya
Colas and Chadrik. Thanks!

IS there a list of reserved words like the aforementioned
'mainChannelBox'

Chadrik

unread,
Feb 4, 2008, 9:11:17 PM2/4/08
to python_inside_maya
'mainChannelBox' is just the name of an instance of a ui element of
type channelBox. it just happens to be the only instance of this ui
type in the default maya ui layout. 'mainChannelBox' is not a
reserved word, but 'channelBox' is a command for accessing instances
of channelBox ui widgets. you can use the lsUI command to list ui
elements, but it is not nearly as useful or as precise as the ls
command for listing nodes, so don't get your hopes up.



pink...@gmail.com

unread,
Dec 11, 2014, 3:22:08 PM12/11/14
to python_in...@googlegroups.com
very late to this thread but you can also grab the main channel box with:

melGlobals['gChannelBoxName']
Reply all
Reply to author
Forward
0 new messages