PDA

View Full Version : outlinerEditor + itemFilter


Jugdish
03-18-2006, 02:27 PM
I have a custom outlinerEditor with an itemFilter that is filtering out all texture file nodes whose file paths match a certain regular expression. Now my question is how to get the itemFilter to dynamically update so that when I change the file path of one of these nodes, it will re-evaluate the filter and add/remove items from the outlinerEditor dynamically. I've tried attaching the filter to a selectionConnection node (something Alias "strongly discourages") instead of connecting it directly to the outlinerEditor, but this doesn't work. So here's the code I've got right now:


global proc int badPathFilter(string $name) {
if (`objectType $name` == "file") { // file texture nodes
string $path = `getAttr ($name+".ftn")`;
if (!gmatch($path,"C:/*"))
return 1;
}
return 0;
}

global proc showBadPathWindow() {
string $nodeFilter = `itemFilter -byScript badPathFilter`;
string $attrFilter = `itemFilterAttr -byNameString "fileTextureName"`;
window;
frameLayout;
string $panel = `outlinerPanel`;
string $outliner = `outlinerPanel -query -outlinerEditor $panel`;
outlinerEditor -edit
-filter $nodeFilter
-showAttributes true
-showAttrValues true
-attrFilter $attrFilter
-autoExpand true
-showDagOnly false
-ignoreDagHierarchy true
-showNamespace true
-highlightActive true
-dropIsParent false
$outliner;
showWindow;
}

CGTalk Moderation
03-18-2006, 02:27 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.