Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / MEL / MELscript n00b: marking menu question
  RSS 2.0 ATOM  

MELscript n00b: marking menu question
Rate this thread
 
51117
 
Permlink of this thread  
avatar
  • Total Posts: 3
  • Joined: 09 July 2010 12:34 PM

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 buildObjectMenuItemsNowstring $parentName)
{
 
global int $gIsMarkingMenuOn;

 if (`
popupMenu -e -exists $parentName`) {
 popupMenu 
--deleteAllItems $parentName
 if (`
popupMenu -q -mm $parentName` != $gIsMarkingMenuOn{
 popupMenu 
--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"));
 
}
}


"caffeine is the salvation of the damned”

Replies: 0