outliner and itemFilters

462 views
Skip to first unread message

thirstydevil

unread,
Oct 7, 2011, 12:19:35 PM10/7/11
to python_inside_maya
I have a itemFilter that is hiding some transforms and their shape in
the default outliner. I can install the filter quite easily through
script to the outliner. But how do I get the filter to play nicely
with all the other combinations of filters the user can choose in the
outliner?

Effectively I want my itemFilter to run last and just filter out the
current view and be visible in the show menu of the outliner.

Digging through the mel files :( I found -

// Invoke any user supplied code. This callback is published
and
// needs to remain consistent in future versions of Maya.
//
if (exists ("outlinerEdMenuUserCallback") )
{
// Use catchQuiet in case no callback is supplied, we
don't want that to
// show an error
catchQuiet( eval("source \"outlinerEdMenuUserCallback
\"") );

}

Anyone got experience with this?

Cheers

-Dave

Richardyzo

unread,
Mar 15, 2014, 6:14:17 PM3/15/14
to python_in...@googlegroups.com
Hi, I know this is old, but I searched for "outlinerEdMenuUserCallback" and found only this related post.

I just managed to put some custom items on the Outliner right-click menu.
From what I searched (and witnessed by reading the OutlinerEdMenu.mel), the only thing this script does is to source another script named "outlinerEdMenuUserCallback".

And that's what I did. I created a script in Maya's Script Path named "outlinerEdMenuUserCallback" and put my menu initialization there:
global string $gOutlinerPopupMenu;
menuItem
-l "MY_LABEL" -c "python(\"import myModule; myModule.myCmd()\")" -p $gOutlinerPopupMenu;

So everytime the Outliner is first created, my custom script get loaded and adds stuff to the Outliner menu.

Hope it helps.
Richard
Reply all
Reply to author
Forward
0 new messages