This will get the selected channels in the main channel box and append them to the list chList:

# ----- Start script ------

import maya.cmds as cmds
import maya.mel as mel

def getChannels (*args):

gChannelBoxName = mel.eval('$temp=$gChannelBoxName')
chList = cmds.channelBox (gChannelBoxName, q=True, sma = True)
if chList:
for channel in chList:
print channel
else:
print 'No channels selected!'
return False

getChannels()

On Sep 3, 2010 2:06pm, mt <[email protected]> wrote:
thanks damon, but I need to be able to 'reproduce' the mmb

functionality based on attributes selected in another tool.

That's why I thought the most reliable way would be to be able to auto-

select attributes in the channelBox.













On Sep 3, 10:01 pm, damon shelton [email protected]> wrote:

> I could suggest looking at HUD sliders instead, Maya's channelBox doesn't

> have the functionality to select attributes only query selected attributes

>

> HUDsliders don't do MMB but does give you fast access from the viewport

>

>

>

> On Fri, Sep 3, 2010 at 1:02 PM, mt [email protected]> wrote:

> > yes I'm trying to select attributes in a channelBox, so I can use the

> > mmb slider function.

> > Not only for transforms but for all attributes (the original maya

> > channelBox behaviour)

>

> > Anyone has an idea how to do it?

>

> > On Sep 3, 6:29 pm, John Creson [email protected]> wrote:

> > > You're trying to perform the selection?

> > > Not read the selection?

> > > right?

>

> > > On Fri, Sep 3, 2010 at 1:25 PM, damon shelton [email protected]>

> > wrote:

> > > > is this to allow for the usage of the middle mouse virtual slider

> > function?

>

> > > > when in a move mode, by clicking on one of the directional handles of

> > any

> > > > manipulator allows you to middle mouse drag after that in only that

> > axis, or

> > > > all three when you are in the transform mode

> > > > if you are trying to do it for attrs other than the default transforms

> > then

> > > > that is another story.

>

> > > > On Fri, Sep 3, 2010 at 4:59 AM, Nicolas Combecave
> > [email protected]>

> > > > wrote:

>

> > > >> I'd be very interested to hear about this too. We had to find a

> > > >> workaround, which involved selectionLists and dragAttrContext to

> > manipulate

> > > >> channelBoxAttrs, but it was way more complicated than selecting

> > directly the

> > > >> attribute via select -r persp.translateX for example, and being able

> > to use

> > > >> the virtual slider...

>

> > > >> Nicolas

>

> > > >> On Fri, Sep 3, 2010 at 12:56 PM, martin tomoya [email protected]>

> > wrote:

>

> > > >>> Does anyone know a way to select attributes in the channelBox from a

> > > >>> python script?

>

> > > >>> --

> > > >>>http://groups.google.com/group/python_inside_maya

>

> > > >> --

> > > >>http://groups.google.com/group/python_inside_maya

>

> > > > --

> > > >http://groups.google.com/group/python_inside_maya

>

> > --

> >http://groups.google.com/group/python_inside_maya



--

http://groups.google.com/group/python_inside_maya

--
http://groups.google.com/group/python_inside_maya

Reply via email to