hi all, i’m a beginning poly modeler who is trying to learn a little melscript based on this “simple” tutorial posted at http://bit.ly/gps0nd.
i’m wracking my brains and google-fu over this one. i am attempting to alter the behavior of the “right-click in an empty viewport space” marking menu.
the melscript for that is “buildObjectMenuItemsNow.mel”. i want to make the North function a backface culling toggle on/off and the South function a call to the menu “Display>Polygons>Custom Polygons Display Options”.
i’m just getting into poly modeling. i’m a n00b around scripting but spent 8 hours on this yesterday. 8 hours of attempt>execute>fail on syntax… i wasn’t suprised by failure. but i learned a ton.
the error:
buildObjectMenuItemsNow "MayaWindow|formLayout1|viewPanes|modelPanel4|modelPanel4|modelPanel4|modelPanel4ObjectPop";
// Error: displayString identifier "m_buildObjectMenuItemsNow.kCustomPolygonDisplayOptions" does not exist. //
the script with my modification:
global proc buildObjectMenuItemsNow( string $parentName)
{
global int $gIsMarkingMenuOn;
if (popupMenu -e -exists $parentName) {
popupMenu -e -deleteAllItems $parentName;
if (popupMenu -q -mm $parentName != $gIsMarkingMenuOn) {
popupMenu -e -mm $gIsMarkingMenuOn $parentName;
}
if (!dagObjectHit -mn $parentName) {
string $leadObject[] = ls -sl -tail 1 -typ transform -typ shape;
if (size($leadObject) > 0) {
dagMenuProc($parentName, $leadObject[0]);
} else {
setParent -menu $parentName;
menuItem
-label (uiRes("m_buildObjectMenuItemsNow.kSelectAll"))
-radialPosition "S"
-command ("SelectAll");
menuItem
-label (uiRes("m_buildObjectMenuItemsNow.kCustomPolygonDisplayOptions"))
-radialPosition "N"
-command ("CustomPolygonDisplayOptions;");
setParent ..;
}
}
} else {
warning (uiRes("m_buildObjectMenuItemsNow.kParentWarn"));
}
}