// =========================================================================== // 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: 15 November 1995 // // Description: // This implements the "Keys" menu on the main menubar. // // Procedure Name: // KeyframeMenu // // Description: // Post the Keyframe menu in the main menubar // // Input Arguments: // The parent control for the menu. // // Return Value: // None. // global proc AniAnimateMenu ( string $parent ) { setParent -menu $parent; if( `menu -q -ni $parent` != 0 ) { // // Menu is built already - just return // return; } // Set Key & Hold keys // string $cmd = "SetKey"; menuItem -label (uiRes("m_AniAnimateMenu.kSetKey")) -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) -image "setKeyframe.png" -dragMenuCommand "performSetKeyframeArgList 1 {\"2\", \"animationList\"}" setKeyItem; $cmd = "SetKeyOptions"; menuItem -optionBox true -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) -image "setKeyframe.png"; $cmd = "SetBreakdownKey"; menuItem -label (uiRes("m_AniAnimateMenu.kSetBreakdown")) -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) -dragMenuCommand "performSetBreakdown 2 animationList" setBreakdownItem; $cmd = "SetBreakdownKeyOptions"; menuItem -optionBox true -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) setBreakdownOptionItem; $cmd = "HoldCurrentKeys"; menuItem -label (uiRes("m_AniAnimateMenu.kHoldCurrentKeys")) -echoCommand true -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) holdKeyItem; // Set Driven Keyframe // $cmd = "SetDrivenKeyOptions"; menuItem -ltVersion "2016" -label (uiRes("m_AniAnimateMenu.kSetDrivenKeyParent")) -subMenu true -aob true -to true; menuItem -ltVersion "2016" -label (uiRes("m_AniAnimateMenu.kSetDrivenKey")) -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) setDrivenKeyDialog; menuItem -divider true; $cmd = "GoToPreviousDrivenKey"; menuItem -ltVersion "2016" -label (uiRes("m_AniAnimateMenu.kGoToPrevious")) -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) previousDrivenKeyItem; $cmd = "GoToNextDrivenKey"; menuItem -ltVersion "2016" -label (uiRes("m_AniAnimateMenu.kGoToNext")) -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) nextDrivenKeyItem; setParent -menu ..; // Set Transform Keyframe // menuItem -label (uiRes("m_AniAnimateMenu.kSetTransformKeys")) -subMenu true -aob true -to true; $cmd = "SetKeyTranslate"; menuItem -label (uiRes("m_AniAnimateMenu.kTranslate")) -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) setTranslationKeyItem; $cmd = "SetKeyRotate"; menuItem -label (uiRes("m_AniAnimateMenu.kRotate")) -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) setRotationKeyItem; $cmd = "SetKeyScale"; menuItem -label (uiRes("m_AniAnimateMenu.kScale")) -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) setScaleKeyItem; setParent -menu ..; // IK/FK Switching // menuItem -ltVersion "2015" -label (uiRes("m_AniAnimateMenu.kIKFKKeys")) -subMenu true -aob true -to true; $cmd = "SetIKFKKeyframe"; menuItem -ltVersion "2015" -label (uiRes("m_AniAnimateMenu.kSetIKFKKey")) -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) ikFKSetKeyItem; int $ikState = `optionVar -q ikFKSwitchState`; $cmd = "ToggleFkIk"; string $mi = `menuItem -ltVersion "2015" -label (uiRes("m_AniAnimateMenu.kEnableIKSolver")) -checkBox $ikState -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) ikFKStateItem`; $cmd = "ConnectNodeToIKFK"; menuItem -ltVersion "2015" -label (uiRes("m_AniAnimateMenu.kConnectToIKFK")) -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) ikFKConnectToItem; $cmd = "MoveIKtoFK"; menuItem -ltVersion "2015" -label (uiRes("m_AniAnimateMenu.kMoveToIKFK")) -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) moveIKtoFKitem; setUpIKSelectionScriptJob($mi); setParent -menu ..; // menu item for keyframing blendshape target weights $cmd = "KeyBlendShapeTargetsWeight"; menuItem -label (uiRes("m_AniAnimateMenu.kSetBlendShapeTargetWeightKeys")) -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)); menuItem -divider true; $cmd = "CreateMotionTrail" ; menuItem -label (uiRes("m_AniAnimateMenu.kCreateEditableMotionTrail")) -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) -image "motionTrail.png" -dragMenuCommand("performMotionTrail 2") createMotionTrailItem; $cmd = "CreateMotionTrailOptions"; menuItem -optionBox true -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) -image "motionTrail.png" createMotionTrailOptionItem; menuItem -divider true; // ATOM menuItem -label (uiRes("m_AniAnimateMenu.kATOMParent")) -subMenu true -aob true -to true; menuItem -label (uiRes("m_AniAnimateMenu.kExportAnimation")) -annotation (getRunTimeCommandAnnotation("ExportAnim")) -command "ExportAnim" exportAnimItem; menuItem -label (uiRes("m_AniAnimateMenu.kImportAnimation")) -annotation (getRunTimeCommandAnnotation("ImportAnim")) -command "ImportAnim" importAnimItem; menuItem -label (uiRes("m_AniAnimateMenu.kCreateATOMTemplate")) -annotation (getRunTimeCommandAnnotation("ATOMTemplate")) -command "ATOMTemplate" createAtomTemplateItem; setParent -menu ..; $cmd = "CreateClip" ; menuItem -label (uiRes("m_AniAnimateMenu.kCreateClip")) -image "createClip.png" -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) -dragMenuCommand("performCreateClip 2") createClipItem; $cmd = "CreateClipOptions"; menuItem -optionBox true -image "createClip.png" -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) createClipOptionItem; $cmd = "CreatePose"; menuItem -label (uiRes("m_AniAnimateMenu.kCreatePose")) -image "createPose.png" -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) -dragMenuCommand("performCreatePose 2") createPoseItem; $cmd = "CreatePoseOptions"; menuItem -optionBox true -image "createPose.png" -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) createPoseOptionItem; menuItem -divider true; $cmd = "CreateGhost"; menuItem -ltVersion "2016" -label (uiRes("m_AniAnimateMenu.kGhostSelected")) -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) -image "ghost.png" -dragMenuCommand("performGhost 2") createGhostItem; $cmd = "CreateGhostOptions"; menuItem -optionBox true -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) -image "ghost.png" createGhostOptionItem; $cmd = "DoUnghost"; menuItem -ltVersion "2016" -label (uiRes("m_AniAnimateMenu.kUnghostSelected")) -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) -image "ghostOff.png" -dragMenuCommand("performUnghost 2") UnghostItem; $cmd = "DoUnghostOptions"; menuItem -optionBox true -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) -image "ghostOff.png" unghostOptionItem; menuItem -ltVersion "2016" -label (uiRes("m_AniAnimateMenu.kGhostAll")) -annotation (uiRes("m_AniAnimateMenu.kGhostAllAnnot")) -image "ghostOff.png" -command "unGhostAll" unghostAllItem; menuItem -divider true; $cmd = "AnimationSnapshot"; menuItem -label (uiRes("m_AniAnimateMenu.kCreateAnimationSnapshot")) -image "animateSnapshot.png" -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) -dragMenuCommand "performSnapshot 2" snapshotItem; $cmd = "AnimationSnapshotOptions"; menuItem -optionBox true -image "animateSnapshot.png" -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) snapshotDialogItem; menuItem -label (uiRes("m_AniAnimateMenu.kUpdateSnapshot")) -image "updateMotionTrail.png" -annotation (uiRes("m_AniAnimateMenu.kUpdateSnapshotAnnot")) -command "updateMotionTrail" updateMotionTrailItem; $cmd = "AnimationSweep"; menuItem -label (uiRes("m_AniAnimateMenu.kCreateAnimatedSweep")) -image "animateSweep.png" -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) -dragMenuCommand "performAnimSweep 2" animsweepItem; $cmd = "AnimationSweepOptions"; menuItem -optionBox true -image "animateSweep.png" -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) animsweepDialogItem; menuItem -divider true; menuItem -subMenu true -label (uiRes("m_AniAnimateMenu.kMotionPaths")) -tearOff true -allowOptionBoxes true -familyImage "menuIconPaths.png"; // Set Path Key // $cmd = "SetKeyPath" ; menuItem -label (uiRes("m_AniAnimateMenu.kSetMotionPathKey")) -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) -image "motionPathKey.png" setKeyPathItem; $cmd = "AttachToPath"; string $attachPathItem = `menuItem -label (uiRes("m_AniAnimateMenu.kAttachToMotionPath")) -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) -image "motionPath.png" -dragMenuCommand "performPathAnimation 2" attachPathItem`; $cmd = "AttachToPathOptions"; menuItem -optionBox true -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) -image "motionPath.png" attachPathDialogItem; // Flow Path Object // $cmd = "FlowPathObject"; string $flowItem = `menuItem -label (uiRes("m_AniAnimateMenu.kFlowPathObject")) -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) -image "flowPathObj.png" -dragMenuCommand "performFlow 2" flowItem`; $cmd = "FlowPathObjectOptions"; menuItem -optionBox true -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) flowDialogItem; setParent -m ..; menuItem -label (uiRes("m_AniAnimateMenu.kTurntable")) -image "animTurntable.png" -annotation (getRunTimeCommandAnnotation("AnimationTurntable")) -command "AnimationTurntable" animTurntableItem; menuItem -optionBox true -annotation (getRunTimeCommandAnnotation("AnimationTurntableOptions")) -command "AnimationTurntableOptions" animTurntableDialogItem; menuItem -divider true; string $timeWarpSubMenu = `menuItem -subMenu true -label (uiRes("m_AniAnimateMenu.kTimeWarp")) -tearOff true -allowOptionBoxes true timeWarpSubMenu`; // Add Time Warp // $cmd = "AddTimeWarp" ; menuItem -label (uiRes("m_AniAnimateMenu.kAddTimeWarp")) -image "addTimeWarp.png" -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) addTimeWarpItem; // Select Time Warp // $cmd = "SelectTimeWarp" ; menuItem -label (uiRes("m_AniAnimateMenu.kSelectTimeWarp")) -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) -image "selectTimeWarp.png" selectTimeWarpItem; // Delete Time Warp // $cmd = "DeleteTimeWarp" ; menuItem -label (uiRes("m_AniAnimateMenu.kDeleteTimeWarp")) -command $cmd -annotation (getRunTimeCommandAnnotation($cmd)) -image "deleteTimeWarp.png" deleteTimeWarpItem; // Enable Time Warp // string $enableTimeWarpItem = `menuItem -label (uiRes("m_AniAnimateMenu.kEnableTimeWarp")) -image "enableTimeWarp.png" -annotation (uiRes("m_AniAnimateMenu.kEnableTimeWarpAnnot")) -cb 1 -command "setAttr time1.enableTimewarp (!`getAttr time1.enableTimewarp`); currentTime `currentTime -q`;" enableTimeWarpItem`; setParent -m ..; menuItem -e -pmc ( "menuItem -e -cb `getAttr time1.enableTimewarp` " + $enableTimeWarpItem ) $timeWarpSubMenu; menuItem -divider true; menuItem -label (uiRes("m_AniAnimateMenu.kSetTimecode")) -annotation (getRunTimeCommandAnnotation("SetTimecode")) -command "SetTimecode" animSetTimecodeItem; }