// =========================================================================== // 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: // Creates a list of influences with a filter attached to it // The list contains the influences associated to a specified skin cluster // global string $skinClusterInflPinList[];// There is only one pin list shared by all the instances of // the influences list // This wont cause any corruption // and should not cause any workflow issue proc int skinClusterInflFindParentIndex( int $influenceIndex, int $currentRoot, string $influences[], int $parents[], int $findIntermediateNodes, string $intermediateNodes[] ) { // Searches the potentialParents list to see if any of there nodes is a parent of $influence // If a parent is found then the intermediateNodes list is populated in between node (if $findIntermediateNodes is true) // If no parent is found, this method returns -1 and it does not populate the $intermediateNodes list // Note1: Intermediate nodes are nodes which are not a skin influences, but which exist in the dag hierarchy // between objects that are skin influences. // Note2: $intermediateNodes is populated in inverse order, childs first because this si more comvenient // to proceed that way // Note3: We assume that the nodes are aready in hierarchical order, if not some branches will just not be connected // This proc is intented to be called by skinClusterInflFindInfluenceNodes // // Search only the last branch string $influence = $influences[$influenceIndex]; int $influenceParent = $currentRoot; if( ($currentRoot == -1)||(!`isParentOf $influences[$currentRoot] $influence`) ) { // New Root $currentRoot = $influenceIndex; $influenceParent = -1; } else { $influenceParent = $influenceIndex-1; while( $influenceParent>$currentRoot ) { if( `isParentOf $influences[$influenceParent] $influence` ) { // Closest parent found break; } else { $influenceParent = $parents[$influenceParent]; } } } if( $influenceParent != -1 && $findIntermediateNodes ) { // Parent found, populate the intermediate nodes list string $parent = firstParentOf( $influence ); while( $parent != "" ) { if( `isSameObject $influences[$influenceParent] $parent` ) { break; } $intermediateNodes[size($intermediateNodes)] = $parent; $parent = firstParentOf( $parent ); } } $parents[$influenceIndex] = $influenceParent; return $currentRoot; } // #influenceTypes are // 0 joint influence (with color and hold state) // 1 other influenceInfluences (hold but no color) // 2 intermediate node (just displayed in hierarchy mode, used to preserve hierarchy) // proc skinClusterInflFindInsertItermediateNodes( string $valuesInverted[], int $position, string $influences[], int $parents[], int $influenceType[] ) { int $valuesSize = size($valuesInverted); if( $valuesSize > 0 ) { // Create space to insert the new elements for( $ii = size( $influences )-1; $ii>=$position; $ii-- ) { $influences[$ii+$valuesSize] = $influences[$ii]; $influenceType[$ii+$valuesSize] = $influenceType[$ii]; $parents[$ii+$valuesSize] = -1; // Remaining items parents arent identified yet, they can be set to -1 } // Insert the new elements for( $jj = $valuesSize-1; $jj>=0; $jj-- ) { $influences[$position] = $valuesInverted[$jj]; $influenceType[$position] = 2; $parents[$position+1] = $position; // Note: Original $parents[$position] remains intact because we never modified it $position++; } } } // Return a collection of influences whih is connected to $skinCluster // The return is composed of 4 arrays all having the same size and where each influence have // the same indexe in all 4 arrays // $inflList: full name of the influence // $shortName: non unique userfrienfly name // $parent: Indexed of the parent item, -1 mean root item // $type: 0-joint, 1-other influence type or 2-Intermediate node needed to built the parenting tree // $sortList: The type of sorting to use 1 - alphabatically 2- Heirarchical 3- Flat // global proc skinClusterInflFindInfluenceNodes( string $skinClusters[], string $inflList[], string $inflListShortNames[], int $inflListParents[], int $influenceType[], int $sortList ) { // Get all the influence objects. for all the clusters at once string $connections[]; if( size( $skinClusters ) == 1 ) { $connections = `skinCluster -q -inf $skinClusters[0]`; } else { for( $cluster in $skinClusters ) { string $tmpConnections[] = `skinCluster -q -inf $cluster`; int $prevSize = size( $connections ); int $connSize = $prevSize; for( $influence in $tmpConnections ) { int $duplicate = false; for( $ii = 0; $ii< $prevSize; $ii++ ) { if( $influence == $connections[$ii] ) { $duplicate = 1; break; } } if( !$duplicate ) { $connections[ $connSize++ ] = $influence; } } } } if ( 2 == $sortList ) { // Sort the conenctions because building of the tree assumes that thsy are hierarchy sorted // and they arent at this point // This is done by sorting the long names with their path alphabatically int $num = size( $connections ); string $sortedConnections[]; // A space and the original index of the transform are appended at the end of the name // This is to be able to refer to the short names array once the long names will have been sorted. // DO NOT REPLACE THE SPACE BY SOMETHING ELSE // The space being one of the frst character in the ASCII table // ensure that the long names dont get badly sorted because of that extension at the end of the name // for( $ii = 0; $ii < $num; $ii++ ) { $sortedConnections[$ii] = longNameOf( $connections[$ii] )+" "+$ii; } $sortedConnections = sort( $sortedConnections ); // Converting back to short names for( $ii = 0; $ii < $num; $ii++ ) { string $tokens[]; int $nbTokens = `tokenize $sortedConnections[$ii] " " $tokens`; int $srcIndex = $tokens[$nbTokens-1]; $sortedConnections[$ii] = $connections[$srcIndex]; } $connections = $sortedConnections; } // Set influence type string $infl, $conn; int $numInfls = 0; for( $conn in $connections ) { $inflList[$numInfls] = $conn; $influenceType[$numInfls] = 1; if (`objectType -isType "joint" $conn`) { $influenceType[$numInfls] = 0; } $inflListParents[$numInfls] = -1; $numInfls++; } // Extract intermediate object if displaying hierarchy // and initialise the $inflListParents array if ( 2 == $sortList ) { // Assuming it is already sorted by hierarchy, just initialise the parents list // This sort will also insert intermediate nodes the missing hierarchical nodes // that arent part of the cluster int $rootIndex = -1; for( $ii = 0; $ii < size($inflList) ; $ii++) { string $intermediateNodes[]; clear( $intermediateNodes ); $rootIndex = skinClusterInflFindParentIndex( $ii, $rootIndex, $inflList, $inflListParents, 0, $intermediateNodes ); if( size($intermediateNodes) > 0 ) { // Insert any new intermediate node skinClusterInflFindInsertItermediateNodes( $intermediateNodes, $ii, $inflList, $inflListParents, $influenceType ); $ii += size($intermediateNodes); } } // Update array sizes $numInfls = size( $inflList ); } // Now try to make a short name to make the // names easier for the user to read. string $buffer[]; int $usingShortNames = 0; for ($ii = 0; $ii < $numInfls; $ii++) { clear($buffer); int $numTokens = tokenize($inflList[$ii],"|",$buffer); if (0 == $numTokens ) { $inflListShortNames[$ii] = $inflList[$ii]; } else { $inflListShortNames[$ii] = $buffer[$numTokens-1]; $usingShortNames++; } } // Deal with names which are now duplicated // because they got shortened - basically copy // the long name to resolve it. // Note: O(N^2) algorithm. Does not seems to be a bottle neck // if it becomes a problem the order can be reduced by itentifying the duplicated from a sorted // list of the short names for ($ii = 0; $ii < $numInfls; $ii++) { if( $inflListShortNames[$ii] != $inflList[$ii] ) { int $duplicated = 0; for ($jj=$ii+1;$jj<$numInfls;$jj++) { // Check if they are the same. if( $inflListShortNames[$ii] == $inflListShortNames[$jj] ) { $duplicated = 1; $inflListShortNames[$jj] = $inflList[$jj]; $usingShortNames--; } } if( $duplicated ) { $inflListShortNames[$ii] = $inflList[$ii]; $usingShortNames--; } } } // Sort the list of influences alphabatically if needed // note: not compatible with the hierarchical mode // note2: N2 order algorighm. does not seem to impact performances at this point // To reduce the orde here we can either append the original index at the end of each shortname // or we could do a binary search in the sorted list for each item in the original list // if( 1 == $sortList ) { // Sort alphabatically string $sortedShort[] = sort($inflListShortNames); string $sortedInfl[]; int $sortedType[]; int $sortedParents[]; for ($ii = 0; $ii < $numInfls; $ii++) { for ($jj = 0; $jj < $numInfls; $jj++) { if( $sortedShort[$ii] == $inflListShortNames[$jj] ) { $sortedInfl[$ii] = $inflList[$jj]; $sortedParents[$ii] = $inflListParents[$jj]; $sortedType[$ii] = $influenceType[$jj]; break; } } } $inflListShortNames = $sortedShort; $inflList = $sortedInfl; $inflListParents = $sortedParents; $influenceType = $sortedType; } } global proc skinClusterInflUpdateSelectionColors( string $treeView ) { global string $gAartSkinCurrentInfluence; float $mainSelectColor[]; float $softSelectColor[]; $mainSelectColor[0] = 0.40; $mainSelectColor[1] = 0.55; $mainSelectColor[2] = 0.70; $softSelectColor[0] = 0.29; $softSelectColor[1] = 0.32; $softSelectColor[2] = 0.34; if( `treeView -exists $treeView` ) { // Go thru the selection and update the colors string $selectList[] = `treeView -query -selectItem $treeView`; for ($item in $selectList) { if( $gAartSkinCurrentInfluence == $item ) { treeView -e -selectionColor $item $mainSelectColor[0] $mainSelectColor[1] $mainSelectColor[2] $treeView; } else { treeView -e -selectionColor $item $softSelectColor[0] $softSelectColor[1] $softSelectColor[2] $treeView; } } } } proc string skinClusterInflGetPinControlFromTreeView( string $pTreeView ) // Returns the PinControl from the TreeView name // This method depends on the construction of the list layouts // Iflayout is modified, this function must be freviewed { if( `treeView -exists $pTreeView` ) { string $parentLayout = `treeView -q -parent $pTreeView`; if( `layout -exists $parentLayout` ) { string $pinControl = $parentLayout+"|pinButton"; if( `iconTextCheckBox -exists $pinControl` ) { return $pinControl; } } } return ""; } proc string skinClusterInflGetFilterLayoutFromTreeView( string $pTreeView ) // Returns the FilterLayout from the TreeView name // This method depends on the construction of the list layouts // Iflayout is modified, this function must be freviewed { if( `treeView -exists $pTreeView` ) { string $parentLayout = `treeView -q -parent $pTreeView`; if( `layout -exists $parentLayout` ) { string $childs[] = `layout -q -childArray $parentLayout`; string $filterLayout = $childs[1]; if( `layout -exists $filterLayout` ) { return $filterLayout; } } } return ""; } proc skinClusterInflFilter( string $pTreeView ) { string $pinControl = skinClusterInflGetPinControlFromTreeView( $pTreeView ); if( ($pinControl == "") || !`iconTextCheckBox -q -value $pinControl` ) { filterUIRefreshView $pTreeView; } else { // Filter using the list global string $skinClusterInflPinList[]; string $items[] = `treeView -q -children "" $pTreeView`; for( $item in $items ) { int $lVisible = false; for( $pinItem in $skinClusterInflPinList ) { if( $pinItem == $item ) { $lVisible = true; break; } } treeView -e -itemVisible $item $lVisible $pTreeView; } } } global proc skinClusterInflPopulate( string $skinClusters[], string $treeView, int $addDQasJoint ) // // Description: // Creates a menu that shows all the paintable joints. // { // This loop seems to indicate that he code can handle more than one cluster at a time but // I'm not sure that the rest of the code will correclty handle that case // TODO: determine if it should be supported and either remove the capability of make it more robust // // Preserve current selection of the treeView, // Once the list will have built we will try to reapply that selection string $currentListSelection[]; if ( `treeView -q -ex $treeView` ) { $currentListSelection = `treeView -q -selectItem $treeView`; } if ( size($skinClusters) <= 0 ) { //cleanup the list if it exists. if ( `treeView -q -ex $treeView` ) treeView -e -ra $treeView; return; } // Clean up the existing list treeView -e -ra $treeView; // Create a list of all influence objects names. string $inflList[], $inflListShortNames[]; int $inflListParentIndexes[]; int $inflTypes[]; int $inflIdx = 0; int $sortList = `optionVar -q sortSkinPaintList`; skinClusterInflFindInfluenceNodes( $skinClusters, $inflList, $inflListShortNames, $inflListParentIndexes, $inflTypes, $sortList); // ================================= // Populate the TreeView. // ================================= int $numInfls = size($inflList); int $ii; for ($ii = 0; $ii < $numInfls; $ii++) { string $infl = $inflList[$ii]; string $inflParent = ""; if( $inflListParentIndexes[$ii] >= 0 ) { $inflParent = $inflList[$inflListParentIndexes[$ii]]; } treeView -e -addItem $infl $inflParent $treeView; } for ($ii = 0; $ii < $numInfls; $ii++) { string $infl = $inflList[$ii]; string $inflShortName = $inflListShortNames[$ii]; if( $inflShortName != "" ) { treeView -e -displayLabel $infl $inflShortName $treeView; } } // Display the lock/unlock icons for all influences for ($ii = 0; $ii < $numInfls; $ii++) { string $infl = $inflList[$ii]; if( $inflTypes[$ii] <=1 ) { artSkinLockRefreshUI($infl); } else { treeView -edit -enableButton $infl 1 0 -buttonVisible $infl 1 0 $treeView; } } for ($ii = 0; $ii < $numInfls; $ii++) { string $infl = $inflList[$ii]; if( $inflTypes[$ii] == 0 ) { string $colorPlug = $infl + ".objectColor"; int $colorIndex = `getAttr $colorPlug`; float $rgb[] = `colorIndex -q ($colorIndex+24)`; treeView -edit -buttonTextIcon $infl 2 " " $treeView; // We have to write something on the button to see the color treeView -edit -buttonTransparencyColor $infl 2 $rgb[0] $rgb[1] $rgb[2] $treeView; } else { treeView -edit -enableButton $infl 2 0 -buttonVisible $infl 2 0 $treeView; } } // Reapply the curent user defined filter (which will togle items visibility) skinClusterInflFilter $treeView; // ================================= // Set the selection // ================================= for( $item in $currentListSelection ) { if( `treeView -q -itemExists $item $treeView` ) { treeView -e -selectItem $item 1 $treeView; } } skinClusterInflUpdateSelectionColors( $treeView ); } global proc skinClusterInflMenuColorPostCallBack( string $treeView, string $infl ) { string $colorPlug = $infl + ".objectColor"; int $colorIndex = `getAttr $colorPlug`; float $rgb[] = `colorIndex -q ($colorIndex+24)`; treeView -edit -buttonTransparencyColor $infl 2 $rgb[0] $rgb[1] $rgb[2] $treeView; } global proc skinClusterInflMenuColorCallBack( string $treeView, string $item,int $buttonState) { string $title = (uiRes("m_skinClusterInflMenu.kInfluenceColorPickerTitle")); $title = `format -s $item $title`; string $refreshJointColorCmd = "skinClusterInflMenuColorPostCallBack( \""+$treeView + "\",\"" + $item +"\" );"; objectColorPaletteForObject($item,$title,0,$refreshJointColorCmd ); } global proc skinClusterInflMenuLockCallBack( string $treeView, string $item, int $buttonState) { // Get the attribute weight for the selected item and toggle it. // int $lockValue = 0; if (`attributeQuery -n $item -ex liw`) $lockValue = (`getAttr ( $item + ".liw" )`)? 0 : 1; artSkinLockInfPassedIn($item, $lockValue); // If additional items are selected in the tree view toggle the lock // value for these items as well. // string $selections[] = `treeView -query -selectItem $treeView`; if (stringArrayContains($item, $selections)) { for ($s in $selections) artSkinLockInfPassedIn($s, $lockValue); } } global proc skinClusterInflPinCallback( string $pinBtn, string $treeView, int $pPressed ) { if( $pPressed ) { // Update the global influences list global string $skinClusterInflPinList[]; $skinClusterInflPinList = `treeView -query -selectItem $treeView`; } // Disable the filter field when in pin mode string $filterLayout = skinClusterInflGetFilterLayoutFromTreeView( $treeView ); if( $filterLayout != "" ) { layout -e -enable (!$pPressed) $filterLayout; } // Refresh the filtering of the list skinClusterInflFilter $treeView; // refresh PinIcon on the Pin Button if( $pPressed ) { iconTextCheckBox -e -image "pinned.png" $pinBtn; } else { iconTextCheckBox -e -image "unpinned.png" $pinBtn; } } global proc int artAttrSkinBuildPopupMenu(string $parentMenu, string $item) { popupMenu -edit -deleteAllItems $parentMenu; setParent -menu $parentMenu; menuItem -label (uiRes("m_skinClusterInflMenu.kArtAttrLockSelected")) -command ( "artSkinLockInf artAttrSkinPaintCtx 1"); menuItem -label (uiRes("m_skinClusterInflMenu.kArtAttrUnlockSelected")) -command ( "artSkinLockInf artAttrSkinPaintCtx 0"); menuItem -label (uiRes("m_skinClusterInflMenu.kArtAttrLockInvSelection")) -command ( "artSkinInvLockInf artAttrSkinPaintCtx 1"); menuItem -label (uiRes("m_skinClusterInflMenu.kArtAttrUnlockInvSelection")) -command ( "artSkinInvLockInf artAttrSkinPaintCtx 0"); menuItem -label (uiRes("m_skinClusterInflMenu.kArtAttrSelecteVerts")) -command ("artSkinSelectVertices(\"artAttrSkinPaintCtx\",0,0);"); menuItem -label (uiRes("m_skinClusterInflMenu.kArtAttrAddAffectedVerts")) -command ("artSkinSelectVertices(\"artAttrSkinPaintCtx\",1,0);"); menuItem -label (uiRes("m_skinClusterInflMenu.kArtAttrRemoveAffectedVerts")) -command ("artSkinSelectVertices(\"artAttrSkinPaintCtx\",0,1);"); return 1; } global proc skinClusterInflResizeList(string $inflList, int $defaultHeight, int $change) // // Description: // Resize the Influences list by the set row increment. // { int $rowIncrement = `optionVar -q skinClusterInflRowIncrement`; if($rowIncrement <= 0) { $rowIncrement = 1; optionVar -iv skinClusterInflRowIncrement $rowIncrement; } if(`treeView -exists $inflList`) { int $currHeight = `treeView -q -height $inflList`; int $resizeAmount = $rowIncrement * 20; switch($change) { case 0: treeView -e -height $defaultHeight $inflList; break; case 1: treeView -e -height ($currHeight + $resizeAmount) $inflList; break; case 2: if($currHeight - $resizeAmount >= $defaultHeight) { treeView -e -height ($currHeight - $resizeAmount) $inflList; } else if($currHeight > $defaultHeight) { treeView -e -height $defaultHeight $inflList; } break; default: break; } } } global proc inflRowIncrementDialogCallback() // // Description: // Callback to create a dialog to edit the row increment // size of the Influences list. // { int $validRowIncrementSet = false; string $ok = (uiRes("m_skinClusterInflMenu.kOK")); string $cancel = (uiRes("m_skinClusterInflMenu.kCancel")); string $currRowIncrement = `optionVar -q skinClusterInflRowIncrement`; while(!$validRowIncrementSet) { string $result = `promptDialog -title (uiRes("m_skinClusterInflMenu.kRowTitle")) -message (uiRes("m_skinClusterInflMenu.kNumRows")) -text $currRowIncrement -button $ok -button $cancel -defaultButton $ok -cancelButton $cancel -dismissString $cancel`; if ($result == $ok) { int $influenceRowOptions = `promptDialog -query -text`; if(($influenceRowOptions <= 5) && ($influenceRowOptions >= 1)) { optionVar -iv skinClusterInflRowIncrement $influenceRowOptions; $validRowIncrementSet = true; } } else { $validRowIncrementSet = true; } } } global proc string skinClusterInflBuildList( int $listWidth, int $listHeight, string $refreshCallback ) { // Warning: If the Layout created by this proc is modified, the following proc must r // skinClusterInflGetPinControlFromTreeView && skinClusterInflGetFilterLayoutFromTreeView // string $inflListLayout = `formLayout`; // Influences Display mode string $lSortLayout = `formLayout`; text -label (uiRes("m_skinClusterInflMenu.kSortTransforms")) skinPaintSortRadioLabel; radioCollection; radioButton -label (uiRes("m_skinClusterInflMenu.kAlphabetically")) skinPaintSortRadioAlphabetical ; radioButton -label (uiRes("m_skinClusterInflMenu.kByHierarchy")) skinPaintSortRadioHierarchy ; radioButton -label (uiRes("m_skinClusterInflMenu.kByFlatHierarchy")) skinPaintSortRadioFlat ; if (!`optionVar -exists skinClusterInflRowIncrement`) { optionVar -iv skinClusterInflRowIncrement 2; } string $lDefaultButton = `iconTextButton -w 20 -h 20 -image "defaultInfluenceList.png" -annotation (uiRes("m_skinClusterInflMenu.kDefaultList"))`; string $rowIncrementMenuItemLabel = (uiRes("m_skinClusterInflMenu.kRowIncrement")); string $lIncreaseButton = `iconTextButton -w 20 -h 20 -image "expandInfluenceList.png" -annotation (uiRes("m_skinClusterInflMenu.kExpandList"))`; popupMenu; menuItem -l $rowIncrementMenuItemLabel -c "inflRowIncrementDialogCallback"; string $lDecreaseButton = `iconTextButton -w 20 -h 20 -image "retractInfluenceList.png" -annotation (uiRes("m_skinClusterInflMenu.kShrinkList"))`; popupMenu; menuItem -l $rowIncrementMenuItemLabel -c "inflRowIncrementDialogCallback"; formLayout -edit -attachForm skinPaintSortRadioLabel "left" 0 -attachForm skinPaintSortRadioLabel "top" 3 -attachForm skinPaintSortRadioLabel "bottom" 3 -attachControl skinPaintSortRadioAlphabetical "left" 0 skinPaintSortRadioLabel -attachForm skinPaintSortRadioAlphabetical "top" 3 -attachForm skinPaintSortRadioAlphabetical "bottom" 3 -attachControl skinPaintSortRadioHierarchy "left" 2 skinPaintSortRadioAlphabetical -attachForm skinPaintSortRadioHierarchy "top" 3 -attachForm skinPaintSortRadioHierarchy "bottom" 3 -attachControl skinPaintSortRadioFlat "left" 2 skinPaintSortRadioHierarchy -attachForm skinPaintSortRadioFlat "top" 3 -attachForm skinPaintSortRadioFlat "bottom" 3 -attachForm $lDecreaseButton "top" 3 -attachForm $lDecreaseButton "right" 0 -attachForm $lIncreaseButton "top" 3 -attachControl $lIncreaseButton "right" 0 $lDecreaseButton -attachForm $lDefaultButton "top" 3 -attachControl $lDefaultButton "right" 0 $lIncreaseButton $lSortLayout; setParent ..; // $lSortLayout // Influences list string $lListFrame = `frameLayout -collapsable false -labelVisible yes // Label is required otherwise the border does not appear -label (uiRes("m_skinClusterInflMenu.kInfluencesListLabel"))`; string $filterAndListLayout = `formLayout`; string $influencesList = `treeView -w $listWidth -h $listHeight -numberOfButtons 2 -ahp yes "theSkinClusterInflList"`; $artAttrSkinPopupMenu = `popupMenu -button 3 -allowOptionBoxes false -parent $influencesList`; treeView -edit -contextMenuCommand ("artAttrSkinBuildPopupMenu \"" + $artAttrSkinPopupMenu+"\"") $influencesList; treeView -e -enableKeys 1 $influencesList; string $filterField = filterUICreateField($influencesList,$filterAndListLayout); string $pinBtn = `iconTextCheckBox -image "unpinned.png" -p $filterAndListLayout -w 20 -h 20 pinButton`; setParent ..; // $filterAndListLayout formLayout -edit -aof $pinBtn "left" -20 -attachForm $pinBtn "top" 0 -attachForm $pinBtn "right" 0 -attachForm $filterField "left" 0 -attachControl $filterField "right" 2 $pinBtn -attachForm $filterField "top" 0 -attachNone $filterField "bottom" -attachForm $influencesList "left" 0 -attachForm $influencesList "right" 0 -attachControl $influencesList "top" 0 $filterField -attachForm $influencesList "bottom" 0 $filterAndListLayout; setParent ..; // $lListFrame formLayout -e -af $lSortLayout "left" 0 -af $lSortLayout "top" 0 -af $lSortLayout "right" 0 -af $lListFrame "right" 0 -af $lListFrame "left" 0 -af $lListFrame "bottom" 0 -ac $lListFrame "top" 0 $lSortLayout $inflListLayout; setParent ..; // $inflListLayout // Setup Pin callback iconTextCheckBox -e -onc ("skinClusterInflPinCallback "+$pinBtn+" "+$influencesList+ " true") -ofc ("skinClusterInflPinCallback "+$pinBtn+" "+$influencesList+ " false") $pinBtn; // Default Values int $sortSkinOption = `optionVar -q sortSkinPaintList`; if($sortSkinOption == 1) { radioButton -e -sl skinPaintSortRadioAlphabetical; } else if($sortSkinOption == 2) { radioButton -e -sl skinPaintSortRadioHierarchy; } else { radioButton -e -sl skinPaintSortRadioFlat; } // Influences list callbacks treeView -edit -pressCommand 1 ("skinClusterInflMenuLockCallBack (\""+$influencesList +"\")") $influencesList; treeView -edit -pressCommand 2 ("skinClusterInflMenuColorCallBack (\""+$influencesList +"\")") $influencesList; radioButton -e -onc ("optionVar -iv sortSkinPaintList 1;"+$refreshCallback) skinPaintSortRadioAlphabetical; radioButton -e -onc ("optionVar -iv sortSkinPaintList 2;"+$refreshCallback) skinPaintSortRadioHierarchy; radioButton -e -onc ("optionVar -iv sortSkinPaintList 3;"+$refreshCallback) skinPaintSortRadioFlat; iconTextButton -e -command ("skinClusterInflResizeList "+$influencesList+" "+$listHeight+ " 0") $lDefaultButton; iconTextButton -e -command ("skinClusterInflResizeList "+$influencesList+" "+$listHeight+ " 1") $lIncreaseButton; iconTextButton -e -command ("skinClusterInflResizeList "+$influencesList+" "+$listHeight+ " 2") $lDecreaseButton; return $influencesList; } global proc skinClusterInflMenu() { // Function called on module load }