Call function when a maya ui is openend

9 views
Skip to first unread message

Arvid Schneider

unread,
May 14, 2014, 9:30:58 AM5/14/14
to python_in...@googlegroups.com
Hey guys, 
what I am trying to achieve is to add custom menu items to the Outliner window. Its easily done by this line:
pm.menuItem('setMenuItemA', l = 'Add Selection to Set', c = "y = utm.Scenes(); y.addRemoveSetMembers('add')", p = setMenu)

The issue is it cant be added if the outliner isnt visible in the maya parent window. So whenever the outliner is closed, the menu is deleted. 
To make it work, the menu has to be added everytime the outliner is called. 

I was thinking scriptjob..but couldnt find any events. Does someone have an idea, or a different approach?

( I dont want to alter the mel files ) 
Reply all
Reply to author
Forward
0 new messages