// =========================================================================== // 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. // =========================================================================== source "shapeEditorUtil.mel"; global proc buildShapeContextHelpItems(string $nameRoot, string $menuParent) // // Description: // Build context sensitive menu items // // Input Arguments: // $nameRoot - name to use as the root of all item names // $menuParent - the name of the parent of this menu // // Return Value: // None // { menuItem -label (uiRes("m_createShapePanelMenu.kHelpShapeEditor")) -annotation (uiRes("m_createShapePanelMenu.kHelpShapeEditorAnnot")) -enableCommandRepeat false -command "showHelp ShapeEditor"; } global proc toggleShapeEditHUD() // // Description: // Toggles the visibility of the blendshape target // editing hud message. // // Input Arguments: // None // // Return Value: // None // { int $wantHUD = `optionVar -q "blendShapeEditHUD"`; // flip the toggle $wantHUD = $wantHUD == 1 ? 0 : 1; optionVar -iv "blendShapeEditHUD" $wantHUD; updateBlendShapeEditHUD(); } global proc createShapePanelMenu(string $panel) // // Description: // Create a new shape panel with the menu bar // // Input Arguments: // string $panel - the name of the panel // // Return Value: // None. // { source "getShapeEditorTreeviewSelection.mel"; // if this menu has already been built, return // { string $panelControl = `panel -query -control $panel`; if (`menuBarLayout -exists $panelControl`){ string $ma[] = `menuBarLayout -query -menuArray $panelControl`; for ($name in $ma){ if ($name == "Panels") return; if ($name == ($panel+"EditMenu")) return; } setParent $panelControl; } } // Add support for the Context Sensitive Help Menu. // addContextHelpProc $panel "buildShapeContextHelpItems"; // By the time we get here, we know the menu bar // of the shapePanel is the current menu bar string $itemName = `menu -tearOff true -label (uiRes("m_createShapePanelMenu.kFile")) ($panel+"FileMenu")`; menuItem -label (uiRes("m_createShapePanelMenu.kExportShapes")) -annotation (uiRes("m_createShapePanelMenu.kExportShapesAnnot")) -c "blendShapeExportShapes" -enable `isExportShapesEnabled` bseMIExportShapes; menuItem -label (uiRes("m_createShapePanelMenu.kImportShapes")) -annotation (uiRes("m_createShapePanelMenu.kImportShapesAnnot")) -c "blendShapeImportShapes" -enable `isImportShapesEnabled` bseMIImportShapes; scriptJob -permanent -parent bseMIExportShapes -event "shapeEditorTreeviewSelectionChanged" ("menuItem -e -enable `isExportShapesEnabled` bseMIExportShapes"); scriptJob -permanent -parent bseMIImportShapes -event "shapeEditorTreeviewSelectionChanged" ("menuItem -e -enable `isImportShapesEnabled` bseMIImportShapes"); $itemName = `menu -tearOff true -label (uiRes("m_createShapePanelMenu.kEdit")) ($panel+"EditMenu")`; string $cmd = "ShapeEditorNewGroup"; menuItem -label (uiRes("m_createShapePanelMenu.kNewGroup")) -annotation (getRunTimeCommandAnnotation($cmd)) -c $cmd -enable `isGroupTargetShapeEnabled` bseMIGroup; $cmd = "ShapeEditorSelectNone"; menuItem -label (uiRes("m_createShapePanelMenu.kDeselectAll")) -annotation (getRunTimeCommandAnnotation($cmd)) -c $cmd bseMIDeselect; scriptJob -permanent -parent bseMIGroup -event "shapeEditorTreeviewSelectionChanged" ("menuItem -e -enable `isGroupTargetShapeEnabled` bseMIGroup"); $itemName = `menu -tearOff true -label (uiRes("m_createShapePanelMenu.kCreate")) ($panel+"CreateMenu")`; menuItem -label (uiRes("m_createShapePanelMenu.kCreateBlendShape")) -image "blendShape.png" -annotation (uiRes("m_createShapePanelMenu.kCreateBlendShapeAnnot")) -command "CreateBlendShape" seMICreateBlendShape; $cmd = "CreateBlendShapeOptions"; menuItem -optionBox true -annotation (getRunTimeCommandAnnotation($cmd)) -image "blendShape.png" -command $cmd seMICreateBlendShapeDialog; menuItem -divider true; menuItem -label (uiRes("m_createShapePanelMenu.kAddTarget")) -annotation (uiRes("m_createShapePanelMenu.kAddTargetAnnot")) -command "AddTargetShape" -enable `isAddTargetToSelectedBSDEnabled` seMIAddTarget; menuItem -optionBox true -annotation (uiRes("m_createShapePanelMenu.kAddTargetOptionAnnot")) -command "AddTargetShapeOptions" seMIAddTargetDialog; scriptJob -permanent -parent seMIAddTarget -event "shapeEditorTreeviewSelectionChanged" ("menuItem -e -enable `isAddTargetToSelectedBSDEnabled` seMIAddTarget"); menuItem -label (uiRes("m_createShapePanelMenu.kAddSelectionAsTarget")) -annotation (uiRes("m_createShapePanelMenu.kAddSelectionAsTargetAnnot")) -command "AddSelectionAsTargetShape" -enable `isAddSelectionAsTargetToSelectedBSDEnabled` seMIAddSelectionAsTarget; menuItem -optionBox true -annotation (uiRes("m_createShapePanelMenu.kAddTargetOptionAnnot")) -command "AddSelectionAsTargetShapeOptions" seMIAddSelectionAsTargetDialog; scriptJob -permanent -parent seMIAddSelectionAsTarget -event "shapeEditorTreeviewSelectionChanged" ("menuItem -e -enable `isAddSelectionAsTargetToSelectedBSDEnabled` seMIAddSelectionAsTarget"); scriptJob -permanent -parent seMIAddSelectionAsTarget -event "SelectionChanged" ("menuItem -e -enable `isAddSelectionAsTargetToSelectedBSDEnabled` seMIAddSelectionAsTarget"); menuItem -divider true; menuItem -label (uiRes("m_createShapePanelMenu.kAddInBetweenTarget")) -annotation (uiRes("m_createShapePanelMenu.kAddInBetweenTargetAnnot")) -command "performInBetweenTargetShapeAdd 0" -enable `isAddInBetweenTargetEnabled` seMIAddInBetweenTarget; menuItem -optionBox true -annotation (uiRes("m_createShapePanelMenu.kAddInBetweenTargetOptionAnnot")) -command "performInBetweenTargetShapeAdd 1" seMIAddInBetweenTargetDialog; scriptJob -permanent -parent seMIAddInBetweenTarget -event "shapeEditorTreeviewSelectionChanged" ("menuItem -e -enable `isAddInBetweenTargetEnabled` seMIAddInBetweenTarget"); menuItem -label (uiRes("m_createShapePanelMenu.kAddSelectionAsInBetweenTarget")) -annotation (uiRes("m_createShapePanelMenu.kAddSelectionAsInBetweenTargetAnnot")) -command "performInBetweenTargetShapeAdd 2" -enable `isAddSelectionAsInBetweenTargetEnabled` seMIAddSelectionAsInBetweenTarget; menuItem -optionBox true -annotation (uiRes("m_createShapePanelMenu.kAddInBetweenTargetOptionAnnot")) -command "performInBetweenTargetShapeAdd 3" seMIAddSelectionAsInBetweenTargetDialog; scriptJob -permanent -parent seMIAddSelectionAsInBetweenTarget -event "shapeEditorTreeviewSelectionChanged" ("menuItem -e -enable `isAddSelectionAsInBetweenTargetEnabled` seMIAddSelectionAsInBetweenTarget"); scriptJob -permanent -parent seMIAddSelectionAsInBetweenTarget -event "SelectionChanged" ("menuItem -e -enable `isAddSelectionAsInBetweenTargetEnabled` seMIAddSelectionAsInBetweenTarget"); menuItem -divider true; menuItem -label (uiRes("m_createShapePanelMenu.kAddCombinationTarget")) -annotation (getRunTimeCommandAnnotation("AddCombinationTarget")) -command "AddCombinationTarget" -enable `isCreateCombinationTargetEnalbed(1)` seMIAddCombinationTarget; menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("AddCombinationTargetOptions")) -command "AddCombinationTargetOptions" seMIAddCombinationTargetDialog; scriptJob -permanent -parent seMIAddCombinationTarget -event "shapeEditorTreeviewSelectionChanged" ("menuItem -e -enable `isCreateCombinationTargetEnalbed(1)` seMIAddCombinationTarget"); menuItem -label (uiRes("m_createShapePanelMenu.kAddSelectionAsCombinationTarget")) -annotation (getRunTimeCommandAnnotation("AddSelectionAsCombinationTarget")) -command "AddSelectionAsCombinationTarget" -enable `isAddSelectionAsCombinationTargetToSelectedBSDEnabled` seMIAddSelectionAsCombinationTarget; menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("AddSelectionAsCombinationTargetOptions")) -command "AddSelectionAsCombinationTargetOptions" seMIAddSelectionAsCombinationTargetDialog; scriptJob -permanent -parent seMIAddSelectionAsCombinationTarget -event "shapeEditorTreeviewSelectionChanged" ("menuItem -e -enable `isAddSelectionAsCombinationTargetToSelectedBSDEnabled` seMIAddSelectionAsCombinationTarget"); scriptJob -permanent -parent seMIAddSelectionAsCombinationTarget -event "SelectionChanged" ("menuItem -e -enable `isAddSelectionAsCombinationTargetToSelectedBSDEnabled` seMIAddSelectionAsCombinationTarget"); $itemName = `menu -tearOff true -label (uiRes("m_createShapePanelMenu.kShapes")) ($panel+"ShapesMenu")`; menuItem -label (uiRes("m_createShapePanelMenu.kSetAsCombinationTarget")) -annotation (getRunTimeCommandAnnotation("SetAsCombinationTarget")) -command "SetAsCombinationTarget" -enable `isCreateCombinationTargetEnalbed(0)` seMISetAsCombinationTarget; menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("SetAsCombinationTargetOptions")) -command "SetAsCombinationTargetOptions" seMISetAsCombinationTargetDialog; scriptJob -permanent -parent seMISetAsCombinationTarget -event "shapeEditorTreeviewSelectionChanged" ("menuItem -e -enable `isCreateCombinationTargetEnalbed(0)` seMISetAsCombinationTarget"); menuItem -divider true; $cmd = "ShapeEditorDuplicateTarget"; menuItem -label (uiRes("m_createShapePanelMenu.kDuplicateTarget")) -annotation (getRunTimeCommandAnnotation($cmd)) -command $cmd -enable `isDuplicateTargetEnabled` seMIDuplicateTarget; scriptJob -permanent -parent seMIDuplicateTarget -event "shapeEditorTreeviewSelectionChanged" ("menuItem -e -enable `isDuplicateTargetEnabled` seMIDuplicateTarget"); menuItem -label (uiRes("m_createShapePanelMenu.kMergeTarget")) -annotation (uiRes("m_createShapePanelMenu.kMergeTargetAnnot")) -command "blendShapeEditorMergeTarget" -enable `isMergeTargetEnabled` seMIMergeTarget; scriptJob -permanent -parent seMIMergeTarget -event "shapeEditorTreeviewSelectionChanged" ("menuItem -e -enable `isMergeTargetEnabled` seMIMergeTarget"); menuItem -divider true; menuItem -label (uiRes("m_createShapePanelMenu.kFlipTarget")) -annotation (uiRes("m_createShapePanelMenu.kFlipTargetAnnot")) -enable `isFlipTargetShapeEnabled` -command "performTargetShapeFlip 0" seMIFlipTarget; menuItem -optionBox true -annotation (uiRes("m_createShapePanelMenu.kFlipTargetOptionAnnot")) -command "performTargetShapeFlip 1" seMIFlipTargetDialog; scriptJob -permanent -parent seMIFlipTarget -event "shapeEditorTreeviewSelectionChanged" ("menuItem -e -enable `isFlipTargetShapeEnabled` seMIFlipTarget"); menuItem -label (uiRes("m_createShapePanelMenu.kMirrorTarget")) -annotation (uiRes("m_createShapePanelMenu.kMirrorTargetAnnot")) -enable `isFlipTargetShapeEnabled` -command "performTargetShapeMirror 0" seMIMirrorTarget; menuItem -optionBox true -annotation (uiRes("m_createShapePanelMenu.kMirrorTargetOptionAnnot")) -command "performTargetShapeMirror 1" seMIMirrorTargetDialog; scriptJob -permanent -parent seMIMirrorTarget -event "shapeEditorTreeviewSelectionChanged" ("menuItem -e -enable `isFlipTargetShapeEnabled` seMIMirrorTarget"); menuItem -divider true; menuItem -label (uiRes("m_createShapePanelMenu.kRebuildTarget")) -annotation (uiRes("m_createShapePanelMenu.kRebuildTargetAnnot")) -enable `isRebuildTargetShapeEnabled` -command "rebuildSelectedTargetShape" seMIRebuildTarget; scriptJob -permanent -parent seMIRebuildTarget -event "shapeEditorTreeviewSelectionChanged" ("menuItem -e -enable `isRebuildTargetShapeEnabled` seMIRebuildTarget"); menuItem -divider true -dividerLabel (uiRes("m_createShapePanelMenu.kWeighting")); menuItem -label (uiRes("m_createShapePanelMenu.kKey")) -annotation (uiRes("m_createShapePanelMenu.kKeyAnnot")) -enable `isKeyOrResetTargetEnabled` // if one or serveral blendShape nodes are selected in treeview, disable "Key" menu item. -command "keySelectedItems 2" seMIKey; scriptJob -permanent -parent seMIKey -event "shapeEditorTreeviewSelectionChanged" ("menuItem -e -enable `isKeyOrResetTargetEnabled` seMIKey"); menuItem -label (uiRes("m_createShapePanelMenu.kReset")) -annotation (uiRes("m_createShapePanelMenu.kResetAnnot")) -enable `isKeyOrResetTargetEnabled` // if one or serveral blendShape nodes are selected in treeview, disable "Reset" menu item. -command "resetSelectedTargetsWeight" seMIReset; scriptJob -permanent -parent seMIReset -event "shapeEditorTreeviewSelectionChanged" ("menuItem -e -enable `isKeyOrResetTargetEnabled` seMIReset"); if(`optionVar -ex "blendShapeEditHUD"` == 0) optionVar -iv "blendShapeEditHUD" 1; $itemName = `menu -tearOff true -label (uiRes("m_createShapePanelMenu.kOptions")) ($panel+"OptionsMenu")`; menuItem -label (uiRes("m_createShapePanelMenu.kShowEditHUD")) -annotation (uiRes("m_createShapePanelMenu.kShowEditHUDAnnot")) -c "toggleBlendShapeEditHUD" -checkBox `optionVar -q "blendShapeEditHUD"` seMIHUD; buildPanelPopupMenu($panel); } global proc toggleBlendShapeEditHUD() // // Description: // Toggles the visibility of the blendshape target // editing hud message. // // Input Arguments: // None // // Return Value: // None // { int $wantHUD = `optionVar -q "blendShapeEditHUD"`; // flip the toggle $wantHUD = $wantHUD == 1 ? 0 : 1; optionVar -iv "blendShapeEditHUD" $wantHUD; updateBlendShapeEditHUD(); } global proc keySelectedItems(int $type) // // Description: // Key/Unkey selected blendshape deformers/targets/target groups in shape editor. // Input Arguments: // int $type - Key action type: // 0: Key at 0 // 1: Key at 1 // 2: Key at current // 3: Remove key // { // MAYA-62557: if a user wants to key or reset group members, they should select an // option with that label (like the right-click menu for target groups). And options // labeled "Key" or "Reset" should affect only the selected items (groups or targets). string $selectedTargetL[] = getShapeEditorTreeviewSelection(4); for($target in $selectedTargetL) { string $targetName = targetIdToTargetName($target); if ($type == 3) { $curTime = `currentTime -q`; // remove key at current time frame. evalEcho("cutKey -clear -time " + $curTime + " " + $targetName); } else { string $subStrings[] = stringToStringArray($target, "."); if (($type == 0) || ($type == 1)) evalEcho("blendShape -e -w " + $subStrings[1] + " " + $type + " " + $subStrings[0]); evalEcho("setKeyframe " + $targetName); } } string $selectedTgtGL[] = getShapeEditorTreeviewSelection(3); for($tgtG in $selectedTgtGL) { string $subStrings[] = stringToStringArray($tgtG, "."); string $weightAttr = $subStrings[0] + ".targetDirectory[" + stringRemovePrefix($subStrings[1], "-") + "].directoryWeight"; if ($type == 3) { $curTime = `currentTime -q`; // remove key at current time frame. evalEcho("cutKey -clear -time " + $curTime + " " + $weightAttr); } else { if (($type == 0) || ($type == 1)) evalEcho("setAttr " + $weightAttr + " " + $type); evalEcho("setKeyframe " + $weightAttr); } } string $selectedBsdL[] = stringArrayCatenate(getShapeEditorTreeviewSelection(1),getShapeEditorTreeviewSelection(2)); for($bsd in $selectedBsdL) { string $bsEnvelope = $bsd + ".envelope"; if ($type == 3) { $curTime = `currentTime -q`; // remove key at current time frame. evalEcho("cutKey -clear -time " + $curTime + " " + $bsEnvelope); } else { if (($type == 0) || ($type == 1)) evalEcho("blendShape -e -en " + $type + " " + $bsd); evalEcho("setKeyframe " + $bsEnvelope); } } } global proc keyGroupMembers() // // Description: // Key targets in selected groups in shape editor. // { string $selectedTargetL[] = getShapeEditorTreeviewSelection(5); for($target in $selectedTargetL) { evalEcho("setKeyframe " + targetIdToTargetName($target)); } } global proc resetSelectedTargetsWeight() // // Description: // Reset selected targets/target groups weight in shape editor. // { string $selectedTargetL[] = getShapeEditorTreeviewSelection(4); for($target in $selectedTargetL) { string $subStrings[] = stringToStringArray($target, "."); evalEcho("blendShape -e -w " + $subStrings[1] + " 0 " + $subStrings[0]); } string $selectedTgtGL[] = getShapeEditorTreeviewSelection(3); for($tgtG in $selectedTgtGL) { string $subStrings[] = stringToStringArray($tgtG, "."); string $weightAttr = $subStrings[0] + ".targetDirectory[" + stringRemovePrefix($subStrings[1], "-") + "].directoryWeight"; evalEcho("setAttr " + $weightAttr + " 0"); } } global proc resetGroupMembersWeight() // // Description: // Reset targets in selected groups weight in shape editor. // { string $selectedTargetL[] = getShapeEditorTreeviewSelection(5); for($target in $selectedTargetL) { string $subStrings[] = stringToStringArray($target, "."); evalEcho("blendShape -e -w " + $subStrings[1] + " 0 " + $subStrings[0]); } } global proc rebuildSelectedTargetShape() // // Description: // Rebuild mesh for the selected blend shape target // { string $selectedTargetL[] = getShapeEditorTreeviewSelection(24); string $selectedInBetweenTargetL[] = getShapeEditorTreeviewSelection(16); if (size($selectedTargetL) > 0 || size($selectedInBetweenTargetL) > 0) evalEcho("select -cl"); for($target in $selectedTargetL) { string $array[] = stringToStringArray($target, "."); evalEcho("select -add `sculptTarget -e -regenerate true -target " + $array[1] + " " + $array[0] + "`;"); } for($inBetweenTarget in $selectedInBetweenTargetL) { string $array[] = stringToStringArray($inBetweenTarget, "."); int $inbetweenIndex = (int)$array[2]; float $inBetweenWeight = (float)($inbetweenIndex - 5000)/(float)1000; $inBetweenWeight = blendShapeWeightRoundoff($inBetweenWeight, 3); string $cmd = "select -add `sculptTarget -e -regenerate true -target " + $array[1] + " -inbetweenWeight " + $inBetweenWeight + " " + $array[0] + "`;"; evalEcho($cmd); } } global proc string getBlendShapeForAddTarget() // // Description: // Get blendShape name from single selection // // Return Value: // blendshape name // { string $pureSelectedBsdL[] = getShapeEditorTreeviewSelection(11); if(size($pureSelectedBsdL) == 1) //Single selected blend shape deformer return $pureSelectedBsdL[0]; string $pureSelectedTgtGL[] = getShapeEditorTreeviewSelection(13); if(size($pureSelectedTgtGL) == 1) //Single selected target group { string $subStrings[] = stringToStringArray($pureSelectedTgtGL[0], "."); return $subStrings[0]; } string $pureSelectedTgtL[] = getShapeEditorTreeviewSelection(14); if(size($pureSelectedTgtL) == 1) //Single selected target { string $subStrings[] = stringToStringArray($pureSelectedTgtL[0], "."); return $subStrings[0]; } string $pureSelectedInBetweenTgtL[] = getShapeEditorTreeviewSelection(16); if(size($pureSelectedInBetweenTgtL) == 1) //Single selected in-between target { string $subStrings[] = stringToStringArray($pureSelectedInBetweenTgtL[0], "."); return $subStrings[0]; } return ""; } global proc int getHeroTargetIndexForAddInBetweenTarget() // // Description: // Get hero target index from single selection // // Return Value: // Currently selected hero target index. // { string $pureSelectedTgtL[] = getShapeEditorTreeviewSelection(14); if(size($pureSelectedTgtL) == 1) //Single selected target { string $subStrings[] = stringToStringArray($pureSelectedTgtL[0], "."); return $subStrings[1]; } string $pureSelectedInBetweenTgtL[] = getShapeEditorTreeviewSelection(16); if(size($pureSelectedInBetweenTgtL) == 1) //Single selected target { string $subStrings[] = stringToStringArray($pureSelectedInBetweenTgtL[0], "."); return $subStrings[1]; } return -1; } global proc string targetIdToTargetName(string $targetId) // // Description: // Convert target Id to target name. // e.g. "blendShape1.1" -> "blendShape1.w[1]" // // Return Value: // Target name // { string $subStrings[] = stringToStringArray($targetId, "."); return $subStrings[0] + ".w[" + $subStrings[1] + "]"; } global proc automaticallyAddTargetToSelectedBSD(int $isAddSelection) // // Description: // Automatically add target to selected blend shape deformer // Input Arguments: // int $isAddSelection - If add selection as target. // { string $bsNodeName = getBlendShapeForAddTarget(); if($bsNodeName != "") { if ($isAddSelection) doBlendShapeAddSelectionAsTarget( $bsNodeName, 1, 1, "", 0, 1 ); else { string $targetShapes[]; doBlendShapeAddTarget( $bsNodeName, 1, 1, "", 1, 0, $targetShapes ); } } } global proc automaticallyAddInBetweenTargetToSelectedHeroTarget(int $isAddSelection) // // Description: // Automatically add in-between target to selected hero target // Input Arguments: // int $isAddSelection - If add selection as target. // { string $bsNodeName = getBlendShapeForAddTarget(); int $heroTargetIndex = getHeroTargetIndexForAddInBetweenTarget(); // Get the current weight value of hero target to add in-between string $weightAttr = $bsNodeName + ".weight[" + $heroTargetIndex + "]"; float $maximumInfluenceWeight = `getAttr $weightAttr`; // Round off the weight value to three decimal number, it is a limit of blendshape. $maximumInfluenceWeight = blendShapeWeightRoundoff($maximumInfluenceWeight, 3); if($bsNodeName != "" && $heroTargetIndex != -1) { int $defaultInBetweenType = 0; if ($isAddSelection) doBlendShapeAddSelectionAsInBetweenTarget( $bsNodeName, 1, $heroTargetIndex, $maximumInfluenceWeight, $defaultInBetweenType ); else { string $targetShapes[]; doBlendShapeAddInBetweenTarget( $bsNodeName, 1, $heroTargetIndex, $maximumInfluenceWeight, $defaultInBetweenType, $targetShapes ); } } } global proc selectIn3DViewSelectedBSD() // // Description: // select blend shape deformer in 3d view // { string $selectedBSDL[] = getShapeEditorTreeviewSelection(21); string $cmd = "select -r"; for($blendShape in $selectedBSDL) { $cmd += " " + $blendShape; } evalEcho($cmd); } global proc selectBaseMeshBSD() // // Description: // select the blend shape deformer's base mesh // { string $selectedBSDL[] = getShapeEditorTreeviewSelection(21); string $baseShapes[]; for($blendShape in $selectedBSDL) { string $geometries[] = `blendShape -q -g $blendShape`; $baseShapes = stringArrayCatenate($baseShapes, stringArrayRemove($baseShapes, $geometries)); } string $cmd = "select -r"; for($object in $baseShapes) { $cmd += " " + $object; } evalEcho($cmd); } global proc viewSelectedBSDInNodeEditor() // // Description: // select and show blend shape deformer in node editor // { evalEcho("NodeEditorWindow"); evalEcho("selectIn3DViewSelectedBSD"); string $currentPanel[] = `getPanel -allPanels`; string $panel; for($panel in $currentPanel) { string $panelType = `getPanel -typeOf $panel`; if ($panelType == "scriptedPanel" && `scriptedPanel -query -type $panel` == "nodeEditorPanel") { //Focus node editor panel first, otherwise show input/output doesn't work setFocus $panel; NodeEditorGraphUpDownstream; return; } } } global proc selectMeshOfSelectedTarget() // // Description: // select base mesh // { string $selectedTargetL[] = getShapeEditorTreeviewSelection(24); string $cmd = "select -r"; for($target in $selectedTargetL) { string $subStrings[] = stringToStringArray($target, "."); string $baseMeshes[]=`blendShape -q -g $subStrings[0]`; for($i = 0; $i < size($baseMeshes); ++ $i) $cmd += " `listConnections " + $subStrings[0] + ".inputTarget[" + $i + "].inputTargetGroup[" + $subStrings[1] + "].inputTargetItem`"; } evalEcho($cmd); }