// =========================================================================== // 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. // =========================================================================== // // // Creation Date: 13aug 1997 // // global proc blendShapeMenuCmd( string $editorName, string $itemName ) // // Procedure Name: // blendShapeMenuCmd // // Description: // Command attached to menu items in the blend shape editor // // Input Arguments: // string $editorName - name of the editor // string $itemName - name of the menu item calling the proc // // Return Value: // None. // { string $itemCmd; string $msg; int $error = false; int $querVal = `blendShapeEditor -query -verticalSliders $editorName`; int $setVal = $querVal; if($itemName == "bseMIHoriz") { $setVal = 0; } else if ($itemName == "bseMIVertical") { $setVal = 1; } if ($setVal != $querVal) { $itemCmd = "blendShapeEditor -edit -verticalSliders " + $setVal + " " + $editorName; evalEcho $itemCmd; } } global proc buildBlendShapeContextHelpItems(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_createBlendShapePanelMenu.kHelpBlendShape")) -annotation (uiRes("m_createBlendShapePanelMenu.kHelpBlendShapeAnnot")) -enableCommandRepeat false -command "showHelp EditBlendShape"; } 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 createBlendShapePanelMenu( string $panel ) // // Procedure Name: // createBlendShapePanelMenu // // Description: // Create a new blendShape panel with the menu bar // // Input Arguments: // string $panel - the name of the panel // // Return Value: // None. // { // 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 "buildBlendShapeContextHelpItems"; // By the time we get here, we know the menu bar // of the blendShapePanel is the current menu bar // // Get the name of the blendShape editor in this panel // string $ed = `blendShapePanel -query -blendShapeEditor $panel`; string $itemName = `menu -tearOff true -label (uiRes("m_createBlendShapePanelMenu.kEdit")) ($panel+"EditMenu")`; string $itemCmd = ("blendShapeMenuCmd " + $ed); menuItem -label (uiRes("m_createBlendShapePanelMenu.kCreateBlendShape")) -image "blendShape.png" -annotation (uiRes("m_createBlendShapePanelMenu.kCreateBlendShapeAnnot")) -command "CreateBlendShape" bseMINew; string $cmd = "CreateBlendShapeOptions"; menuItem -optionBox true -annotation (getRunTimeCommandAnnotation($cmd)) -image "blendShape.png" -command $cmd bseMINewDialog; menuItem -label (uiRes("m_createBlendShapePanelMenu.kAddTarget")) -annotation (uiRes("m_createBlendShapePanelMenu.kAddTargetAnnot")) -command "performBlendShapeAdd 0" bseMIAddTarget; menuItem -optionBox true -command "performBlendShapeAdd 1" bseMIAddTargetOptionDialog; menuItem -label (uiRes("m_createBlendShapePanelMenu.kDeselectAll")) -annotation (uiRes("m_createBlendShapePanelMenu.kDeselectAllAnnot")) -c "select -clear" bseMIDeselect; $itemName = `menu -tearOff true -label (uiRes("m_createBlendShapePanelMenu.kOptions")) ($panel+"OptionsMenu")`; menuItem -label (uiRes("m_createBlendShapePanelMenu.kOrientation")) -subMenu true; radioMenuItemCollection ($panel + "_BlendShapeSliderTypes_"); menuItem -radioButton 1 -label (uiRes("m_createBlendShapePanelMenu.kVertical")) -annotation (uiRes("m_createBlendShapePanelMenu.kVerticalAnnot")) -command ($itemCmd + " bseMIVertical") bseMIVertical; menuItem -radioButton 1 -label (uiRes("m_createBlendShapePanelMenu.kHorizontal")) -annotation (uiRes("m_createBlendShapePanelMenu.kHorizontalAnnot")) -command ($itemCmd + " bseMIHoriz") bseMIHoriz; int $querVal = `blendShapeEditor -query -verticalSliders $ed`; if($querVal) { menuItem -edit -radioButton 1 bseMIVertical; } else { menuItem -edit -radioButton 1 bseMIHoriz; } setParent -menu ..; menuItem -label (uiRes("m_createBlendShapePanelMenu.kShowEditHUD")) -annotation (uiRes("m_createBlendShapePanelMenu.kShowEditHUDAnnot")) -c "toggleBlendShapeEditHUD" -checkBox `optionVar -q "blendShapeEditHUD"` bseMIHUD; buildPanelPopupMenu( $panel ); }