// =========================================================================== // 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. // =========================================================================== /* if (`pluginInfo -query -l "MASH"`) { outlinerEdMashMenu($outlineEd, $name, $row); } */ global proc outlinerEdMashMenu (string $outlineEd, string $name, int $row) { string $selectedShapes[] = `listRelatives -s $name`; int $createMenu = 0; int $menuMode = 0; // 0 = mesh selected, 1= waiter selected for ($node in $selectedShapes) { if (`nodeType $node` == "mesh") { $createMenu = 1; } } if (`nodeType $name` == "MASH_Waiter") { $createMenu = 1; $menuMode = 1; } if ($createMenu) { //build the menu buildOutlinerEdMashMenu($outlineEd, $name, $row, $menuMode); } // maintain the current state of menuItems // this is the PostMenuCommand for set menu // /* menuItem -edit -checkBox `outlinerEditor -query -showSetMembers $outlineEd` showSetMembersItem2; menuItem -edit -checkBox `outlinerEditor -query -showDagOnly $outlineEd` dagItem; */ updateSceneAssemblyMenu(); } global proc buildOutlinerEdMashMenu (string $outlineEd, string $name, int $row, int $menuMode) { // delete previous menuItems // setParent -menu ($outlineEd+"Popup"); menu -edit -deleteAllItems ($outlineEd+"Popup"); // build mash subMenu // menuItem -label "MASH" -subMenu true; // build mash MenuItems // if ($menuMode == 0) { menuItem -label "Create MASH Network" -command ("outlinerMashCallNewNetwork(\""+$name+"\");") createMashNetork; } else if ($menuMode == 1) { menuItem -label "Switch Geometry Type" -command ("outlinerMashCallSwitchGeom(\""+$name+"\");") switchMashGeometryType; } setParent -m ..; // add general menu items menuItem -divider true; buildOutlinerEdGeneralMenuItems($outlineEd); } global proc outlinerMashCallSwitchGeom (string $name) { select -ne $name; MASHswitchGeometryType; } global proc outlinerMashCallNewNetwork (string $name) { select -ne $name; MASHnewNetwork("MASH#"); }