// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // Description: // Build filter for reference editor outliner based on selected // references in the sceneEditor (file list) // // Input Arguments: // None // // Return Value: // None // global proc refEdUpdateFilter(){ // only update filter if the outliner portion is visible string $outlinerVisible = `optionVar -query refEdEditorVisibility`; if ($outlinerVisible != "refEdSceneEditorButton"){ global string $gReferenceEditorPanel; string $references[] = `sceneEditor -q -selectReference $gReferenceEditorPanel`; int $numReferences = `size $references`; string $mainFilter; int $i; for ($i = 0; $i<$numReferences; $i++){ //get nodes in the reference string $nodes[] = `reference -rfn $references[$i] -q -n`; //get the name of one node and tokenize it to build the //nameSpace - nameSpace will be used to filter string $buffer[]; int $numTokens = `tokenize $nodes[0] ":" $buffer`; string $nameSpace = ""; int $j; for ($j=0; $j<($numTokens-1); $j++){ $nameSpace = ($nameSpace + $buffer[$j] + ":"); } $nameSpace = ($nameSpace + "*"); //create the filter if ($i == 0){ $mainFilter = `itemFilter -classification "builtIn" -byName ($nameSpace)`; } else { string $tempFilter = `itemFilter -classification "builtIn" -byName ($nameSpace)`; $mainFilter = `itemFilter -classification "builtIn" -union $mainFilter $tempFilter`; } } //apply the filter global string $gReferenceEditorOutliner; outlinerEditor -e -filter $mainFilter $gReferenceEditorOutliner; } }