// =========================================================================== // 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: 2005 // // // // Description: // This implements the "Cartoon" menu on the main menubar. // // // Input Arguments: // parent to parent the menu to. // // Return Value: // None. // global proc ToonAssignFillShaderMenu( string $parent ) // // Build the Submenu { setParent -menu $parent; menuItem -rtc "AssignToonShaderSolid"; menuItem -rtc "AssignToonShaderLightAngle"; menuItem -rtc "AssignToonShaderShadedBrightness"; menuItem -rtc "AssignToonShaderThreeToneBrightness"; menuItem -rtc "AssignToonShaderDarkProfile"; menuItem -rtc "AssignToonShaderRimLight"; menuItem -rtc "AssignToonShaderCircleHighlight"; setParent -menu ..; } global proc ToonCreatePfxOutlineMenu( string $parent ) { setParent -menu $parent; menu -edit -deleteAllItems $parent; menuItem -rtc "AssignNewPfxToon"; menuItem -rtc "RemoveNewPfxToon"; string $pfxToons[] = `ls -type pfxToon`; int $i; string $fmt = (uiRes("m_buildCartoonMenu.kAssignToon")); for( $i = 0; $i < size( $pfxToons ); $i++ ){ string $pfxToon = $pfxToons[$i]; menuItem -label $pfxToon -command ("assignPfxToon "+$pfxToon+" 0" ) -annotation `format -s $pfxToon $fmt`; } } global proc ToonCreateBackgroundColorMenu( string $parent ) { setParent -menu $parent; menu -edit -deleteAllItems $parent; string $perspCameras[] = `listCameras -p`; string $orthoCameras[] = `listCameras -o`; string $camera; string $fmt = (uiRes("m_buildCartoonMenu.kEditCameraBG")); for( $camera in $perspCameras ){ menuItem -label $camera -image "toonPerspBackground.png" -command ("editAttributeColor "+$camera + ".backgroundColor" ) -annotation `format -s $camera $fmt`; } menuItem -divider true; for( $camera in $orthoCameras ){ menuItem -label $camera -command ("editAttributeColor "+$camera + ".backgroundColor" ) -annotation `format -s $camera $fmt`; } } global proc buildCartoonMenu( string $parent ) { setParent -menu $parent; if( `menu -query -numberOfItems $parent` != 0 ) { // // Menu is built already - just return // return; } // Shading menuItem -divider true -dividerLabel (uiRes("m_buildCartoonMenu.kToonShading")); string $item; $item = `menuItem -label (uiRes("m_buildCartoonMenu.kAssignFill")) -annotation (uiRes("m_buildCartoonMenu.kAssignFillAnnot")) -subMenu true -tearOff true -allowOptionBoxes true toonAssignFillShaderItem`; ToonAssignFillShaderMenu $item; setParent -menu ..; $item = `menuItem -label (uiRes("m_buildCartoonMenu.kAssignOutline")) -annotation (uiRes("m_buildCartoonMenu.kAssignOutlineAnnot")) -subMenu true -tearOff false -allowOptionBoxes true toonCreatePfxOutlineItem`; menuItem -edit -postMenuCommand ("ToonCreatePfxOutlineMenu " + $item) $item; setParent -menu ..; menuItem -rtc "CreateLineModifier"; $item = `menuItem -label (uiRes("m_buildCartoonMenu.kSetCameraBG")) -annotation (uiRes("m_buildCartoonMenu.kSetCameraBGAnnot")) -subMenu true -tearOff true -allowOptionBoxes true toonCreateBackgroundColorItem`; menuItem -edit -postMenuCommand ("ToonCreateBackgroundColorMenu " + $item) $item; setParent -menu ..; // Geometry menuItem -divider true -dividerLabel (uiRes("m_buildCartoonMenu.kToonGeometry")); menuItem -rtc "ReverseToonObjects"; menuItem -ecr true -rtc "ConvertPaintEffectsToPoly"; menuItem -optionBox true -rtc "PaintEffectsToPolyOptions"; // Painting menuItem -divider true -dividerLabel (uiRes("m_buildCartoonMenu.kToonPainting")); menuItem -label (uiRes("m_buildCartoonMenu.kPaintLineAttr")) -subMenu true -tearOff true -allowOptionBoxes true paintLineAttributesItem; // specify the attribute name to be displayed in 3dPaint tool // as second parameter to paintToonAttribute menuItem -rtc "PaintToonLineWidth"; // specify the attribute name to be displayed in 3dPaint tool // as second parameter to paintToonAttribute menuItem -rtc "PaintToonLineOffset"; // specify the attribute name to be displayed in 3dPaint tool // as second parameter to paintToonAttribute menuItem -rtc "PaintToonLineOpacity"; // specify the attribute name to be displayed in 3dPaint tool // as second parameter to paintToonAttribute menuItem -rtc "PaintToonProfileColor"; // specify the attribute name to be displayed in 3dPaint tool // as second parameter to paintToonAttribute menuItem -rtc "PaintToonCreaseColor"; // specify the attribute name to be displayed in 3dPaint tool // as second parameter to paintToonAttribute menuItem -rtc "PaintToonBorderColor"; setParent -menu ..; menuItem -rtc "AssignBrushToPfxToon"; menuItem -divider true -dividerLabel (uiRes("m_buildCartoonMenu.kToonLibrary")); menuItem -rtc "GetCartoonExample"; }