// =========================================================================== // 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: // This contains procedures necessary for // the Creator Hotkeys. // global proc creatorDeletePopupMM() { if ( `popupMenu -q -exists creatorTmpMM` ) { deleteUI creatorTmpMM; } } global proc creatorOpenPaintEffectsPanel_NamedCmd() { global string $gMainPane; global string $gCamera; global string $gDynPaintEditorName; string $panel = `getPanel -withFocus`; string $modelViewShadeType; string $modelViewLightingType; int $modelViewTextureType; // used to decide whether the tool should be allowed to activate given the panel in focus // we are looking for the panel in focus to be a modelPanel (viewport essentially) or the dynPaint panel int $relevantPanelInFocus = false; if ( $panel != "dynPaintScriptedPanel" ) { string $listOfModelPanels[] = `getPanel -type modelPanel`; string $modelPanel; for ($modelPanel in $listOfModelPanels) { if($modelPanel == $panel) { string $listOfVisiblePanels[] = `getPanel -vis`; string $visPanel; for ($visPanel in $listOfVisiblePanels) { if($visPanel == "dynPaintScriptedPanel") { return; } } if (`modelEditor -q -exists $panel`) { $gCamera = `modelEditor -q -camera $panel`; $modelViewShadeType = `modelEditor -q -da $panel`; $modelViewLightingType = `modelEditor -q -dl $panel`; $modelViewTextureType = `modelEditor -q -dtx $panel`; } else { $gCamera = "persp"; } scriptedPanel -e -replacePanel $panel dynPaintScriptedPanel; inViewMessage -smg (uiRes("m_creatorNamedCommandSetup.kIvmPaintEffects")) -fade -fof 20 -pos "topCenter"; $relevantPanelInFocus = true; break; } } // if (`modelEditor -q -exists $panel`) { // dynPaintEditor -e // -displayAppearance $modelViewShadeType // -displayLights $modelViewLightingType // -displayTextures $modelViewTextureType // $gDynPaintEditorName; // } // dynPaintEditor -e -camera $gCamera $gDynPaintEditorName; // dynPaintEditor -e -paintAll 0 $gDynPaintEditorName; // setStrokeRefreshMode 1 $gDynPaintEditorName; } else { if ($gCamera == "") { $gCamera = "persp"; } lookThroughModelPanel $gCamera dynPaintScriptedPanel; $relevantPanelInFocus = true; } string $currContext = `currentCtx`; string $currentTool = `contextInfo -c $currContext`; if($currentTool != "paintEffects" && $relevantPanelInFocus) { creatorSetPaintEffectCtx_NamedCmd(); } } global proc creatorSetPaintEffectCtx_NamedCmd() { global string $gCreatorWireCtx; setToolTo $gCreatorWireCtx; } global proc creatorMakePaintable_NamedCmd() { global string $gCreatorWireCtx; dynWireCtx -e -ss -dp 1 $gCreatorWireCtx; } global proc creatorTogglePaintOnPaintable_NamedCmd() { global string $gCreatorWireCtx; int $paintOnPaintableObj = `dynWireCtx -q -dp $gCreatorWireCtx`; dynWireCtx -e -dp (!$paintOnPaintableObj) $gCreatorWireCtx; } global proc creatorBrushAnimationMM() { creatorDeletePopupMM(); popupMenu -mm 1 -b 1 -p `findPanelPopupParent` creatorTmpMM; menuItem -rp "N" -l "Loop Brush Animation" -command ("LoopBrushAnimation") -dmc "performLoopBrushAnim 2"; menuItem -rp "W" -l "Make Brush Spring" -command ("MakeBrushSpring") -dmc "performMakeBrushSpring 2"; menuItem -rp "E" -l "Bake Spring Animation" -command ("BakeSpringAnimation") -dmc "performBakeBrushSpringAnim 2"; setParent -m ..; } global proc creatorCurveUtilityMM() { creatorDeletePopupMM(); popupMenu -mm 1 -b 1 -p `findPanelPopupParent` creatorTmpMM; menuItem -rp "N" -l "Simplify Stroke Path Curves" -command ("SimplifyStrokePathCurves"); menuItem -rp "W" -l "Set Stroke Control Curves" -command ("SetStrokeControlCurves"); menuItem -rp "E" -l "Attach Brush to Curves" -command ("AttachBrushToCurves"); setParent -m ..; } global proc creatorAutoPaintMM() { creatorDeletePopupMM(); popupMenu -mm 1 -b 1 -p `findPanelPopupParent` creatorTmpMM; menuItem -rp "W" -l "Paint Grid" -command ("performPaintGrid"); menuItem -rp "E" -l "Paint Random" -command ("performPaintRandom"); setParent -m ..; } global proc creatorNamedCommandSetup() { assignCommand -e -addDivider "Paint Effects Commands"; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kSwapTo3DPressAnnot")) -command ("PaintEffectPanelActivate") NameComSwapFromCreatorTo3DView; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kSwapTo2DReleaseAnnot")) -command ("PaintEffectPanelDectivate") NameComSwapFromCreatorTo3DView_release; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kClearAnnot")) -command ("ClearPaintEffectsView") NameComClearCreatorToBackgroundColour; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kCanvasUndoAnnot")) -command ("UndoCanvas") NameComCanvasUndo; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kBrushPresetBlendAnnot")) -command ("BrushPresetBlend") NameComBrushPresetBlend; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kBrushPresetBlendOffAnnot")) -command ("BrushPresetBlendOff") NameComBrushPresetBlendOff; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kBrushPresetShadingAnnot")) -command ("BrushPresetBlendShading") NameComBrushPresetBlendShading; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kBrushPresetShadingOffAnnot")) -command ("BrushPresetBlendShadingOff") NameComBrushPresetBlendShadingOff; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kBrushPresetShapeAnnot")) -command ("BrushPresetBlendShape") NameComBrushPresetBlendShape; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kBrushPresetShapeOffAnnot")) -command ("BrushPresetBlendShapeOff") NameComBrushPresetBlendShapeOff; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kBrushPresetRepShadAnnot")) -command ("BrushPresetReplaceShading") NameComBrushPresetReplaceShading; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kBrushPresetRepShadOffAnnot")) -command ("BrushPresetReplaceShadingOff") NameComBrushPresetReplaceShadingOff; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kOpenPfxPanelAnnot")) -command ("PaintEffectsPanel") NameComOpen_Paint_Effects_Panel; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kToggleOppositeAnnot")) -command ("ToggleOppositeFlagOfSelectedShapes") NameComToggle_Opposite_Flag_Of_Selected_Shapes; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kSwitchToPfxToolAnnot")) -command ("PaintEffectsTool") creatorNameCmd_SetPaintEffectsCtx; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kMakePaintableAnnot")) -command ("MakePaintable") creatorNameCmd_MakePaintable; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kOpenTemplateBrushAnnot")) -command ("TemplateBrushSettings") creatorNameCmd_BrushToolEditor; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kResetTemplateBrushAnnot")) -command ("ResetTemplateBrush") creatorNameCmd_RestBrush; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kOpenBrushEditorAnnot")) -command ("TogglePaintOnPaintableObjects") creatorNameCmd_TogglePaintOnPaintable; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kSettingsToLastStrokeAnnot")) -command ("ApplySettingsToLastStroke") creatorNameCmd_ApplySettingToLast; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kSettingsFromSelStrokeAnnot")) -command ("GetSettingsFromSelectedStroke") creatorNameCmd_GetSettingsFromSelected; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kSettingsToSelStrokeAnnot")) -command ("ApplySettingsToSelectedStroke") creatorNameCmd_ApplySettingToSelected; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kShareBrushAnnot")) -command ("ShareOneBrush") creatorNameCmd_ShareBrush; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kUnshareBrushAnnot")) -command ("RemoveBrushSharing") creatorNameCmd_UnShareBrush; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kBrushNamesAnnot")) -command ("SelectBrushNames") creatorNameCmd_SelectBrushNames; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kBrushAnimMenuAnnot")) -command ("BrushAnimationMarkingMenu") creatorNameCmd_BrushAnimationMM_Create; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kBrushAnimMenuReleaseAnnot")) -command ("BrushAnimationMarkingMenuPopDown") creatorNameCmd_BrushAnimationMM_Delete; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kCurveUtilMenuAnnot")) -command ("CurveUtilitiesMarkingMenu") creatorNameCmd_CurveUtilitiesMM_Create; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kCurveUtilMenuReleaseAnnot")) -command ("CurveUtilitiesMarkingMenuPopDown") creatorNameCmd_CurveUtilitiesMM_Delete; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kAutoPaintMenuAnnot")) -command ("AutoPaintMarkingMenu") creatorNameCmd_AutoPaintMM_Create; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kAutoPaintMenuReleaseAnnot")) -command ("AutoPaintMarkingMenuPopDown") creatorNameCmd_AutoPaintMM_Delete; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kPfxGlobalsAnnot")) -command ("PaintEffectsGlobalSettings") creatorNameCmd_GlobalSettings; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kPresetBlendingAnnot")) -command ("PresetBlendingWindow") creatorNameCmd_PresetBlending; nameCommand -annotation (uiRes("m_creatorNamedCommandSetup.kSavePresetAnnot")) -command ("SaveBrushPreset") creatorNameCmd_SaveBrushToShelf; }