// =========================================================================== // 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. // =========================================================================== // // Create popup menu for grease pencil tool options // global proc greasePencilOptionsPopup() { // Build up the check box info: brush type and pre/post ghost on/off int $type = `optionVar -query greasePencilBrushType`; int $c1 = ( $type == 1 ) ? true : false ; int $c2 = ( $type == 2 ) ? true : false ; int $c3 = ( $type == 3 ) ? true : false ; int $c4 = ( $type == 4 ) ? true : false ; string $sequenceNode = `greasePencilCtx -query -sequenceNodeName greasePencilContext`; int $preGhostOn = false; int $postGhostOn = false; if ( size($sequenceNode) > 0 ) { $preGhostOn = `getAttr ($sequenceNode+".preGhost")`; $postGhostOn = `getAttr ($sequenceNode+".postGhost")`; } // North Marking Menu - Brushes menuItem -radialPosition "N" -label (uiRes("m_greasePencilOptionsPopup.kGreasePencilBrushes")) -subMenu 1; menuItem -label (uiRes("m_greasePencilOptionsPopup.kGreasePencilBrushSoftPencil")) -radialPosition "W" -checkBox $c3 -c ("setGreasePencilType(3); "); menuItem -label (uiRes("m_greasePencilOptionsPopup.kGreasePencilBrushPencil")) -radialPosition "N" -checkBox $c1 -c ("setGreasePencilType(1); "); menuItem -label (uiRes("m_greasePencilOptionsPopup.kGreasePencilBrushMarker")) -radialPosition "E" -checkBox $c2 -c ("setGreasePencilType(2); "); menuItem -label (uiRes("m_greasePencilOptionsPopup.kGreasePencilBrushEraser")) -radialPosition "S" -checkBox $c4 -c ("setGreasePencilType(4); "); setParent -menu ..; // West Marking Menu - Frames menuItem -radialPosition "W" -label (uiRes("m_greasePencilOptionsPopup.kGreasePencilFrames")) -subMenu 1; menuItem -label (uiRes("m_greasePencilOptionsPopup.kGreasePencilFrameAdd")) -radialPosition "N" -c ("createOrEditGreasePencilFrameAtCurrentTime(); "); menuItem -label (uiRes("m_greasePencilOptionsPopup.kGreasePencilFrameDelete")) -radialPosition "S" -c ("removeGreasePencilFrameAtCurrentTime(); "); menuItem -label (uiRes("m_greasePencilOptionsPopup.kGreasePencilFramePreGhost")) -radialPosition "NW" -checkBox $preGhostOn -c ("toggleGreasePencilPreFrameCount();updateGreasePencilPalette(); "); menuItem -label (uiRes("m_greasePencilOptionsPopup.kGreasePencilFramePostGhost")) -radialPosition "NE" -checkBox $postGhostOn -c ("toggleGreasePencilPostFrameCount();updateGreasePencilPalette(); "); menuItem -label (uiRes("m_greasePencilOptionsPopup.kGreasePencilKeyFramePaste")) -radialPosition "E" -c ("timeSliderPasteKey(false); "); menuItem -label (uiRes("m_greasePencilOptionsPopup.kGreasePencilKeyFrameCopy")) -radialPosition "W" -c (" timeSliderCopyKey(); "); menuItem -label (uiRes("m_greasePencilOptionsPopup.kGreasePencilKeyFrameCut")) -radialPosition "SW" -c ("timeSliderCutKey(); "); setParent -menu ..; }