I've heavily modified this script to work with our module system.  This is
briefly why...

On startup part of our module code fire's a python script that parse's an
xml file to automaticaly build the menu for that module.  Anything added by
the menu code will add a doctag to the menu item.  This doctag contains the
module name and the xml menu element name.

I've modified menuItemToShelf to understand doctags.  When it finds one of
our doctags it add's it to the shelf button as we see fit.  Also adding a
doctag to the shelf button its self.  On start-up all our shelf buttons are
collected and updated with the new code from the xml.

Essentialy giving us one place to manage our new feature entry points.

-Dave

On Fri, Aug 7, 2009 at 7:25 PM, Sylvain Berger <[email protected]>wrote:

> cool idea... i will investigate this further...
>
> Thanks
>
> On Fri, Aug 7, 2009 at 2:21 PM, John Creson <[email protected]> wrote:
>
>> scripts/startup/menuItemToShelf.mel
>>
>> is called to do this action,
>>
>> You may be able to do something in here, like ask
>>
>> whatIs myMenuItem;
>>
>> and if it is unknown, assume it is Python?
>>
>>
>> On Fri, Aug 7, 2009 at 1:32 PM, sberger <[email protected]> wrote:
>>
>>>
>>> So I created this menu in the main menubar in python...the commands
>>> attached to these python menuItem are python commands.
>>>
>>> When select the item in the menu, the python command execute
>>> correctly... when I do a shift+CTRL click an item to make a shelf
>>> button, it create a mel shelf button!!!
>>>
>>> Anyone know how to tell maya that this menuItem should create a python
>>> command in the shelf?
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
> --
> "A pit would not be complete without a Freeman coming out of it."
> The Vortigaunt
>
>
> >
>

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

Reply via email to