This gets you a large chunk of the way...:
import maya.cmds as cmds
import maya.mel as mm
cmds.window()
cmds.formLayout( 'form' )
cmds.channelBox( 'dave' )
cmds.formLayout( 'form', e=True, af=(('dave', 'top', 0), ('dave', 'left',
0), ('dave', 'right', 0), ('dave', 'bottom', 0)) )
cmds.showWindow()
cmds.popupMenu('someStupidMenu',p='dave',pmc=lambda *args:
mm.eval('generateChannelMenu someStupidMenu 1'))
unfortunately that last piece of the way may involve most of the work - I've
only had a glance, but it looks like theres some weird UI name issue when it
tries to build your custom menu and, unless theres a quick workaround, you
may need to re-implement the generateChannelMenu mel command (might not be a
bad idea anyway, doing evals of mel scripts in python always leaves a funny
taste in my mouth). At least, for the most part, it should be a literal
translation of the MEL found with a "whatIs generateChannelMenu", then just
fix whatever's not working.
On Tue, Sep 7, 2010 at 4:47 PM, mt <[email protected]> wrote:
> Hi Taylor,
>
> Using pyqt and pymel.
> Right click on the attribute names (allowing to key/lock/mute etc
> selected attrs)
>
>
>
> On Sep 7, 1:04 am, Taylor Carrasco <[email protected]> wrote:
> > Do you mean the attributes them selves (say the label for the attribute
> or
> > the textfield, assuming youre using PyQt) -
> > Are you using Mel?
> >
> > We need some more info on this one here...
> >
> >
> >
> > On Tue, Sep 7, 2010 at 2:47 AM, mt <[email protected]> wrote:
> > > Do you guys know why a new channelBox created via script doesn't have
> > > a right-click attribute menu? Do I need to reimplement it, or is there
> > > a better way of having it working like it does on the maya-default
> > > mainChannelBox?
> >
> > > --
> > >http://groups.google.com/group/python_inside_maya
>
> --
> http://groups.google.com/group/python_inside_maya
>
--
http://groups.google.com/group/python_inside_maya