Home Technical Talk

Maya Right Click Menu

tharle
polycounter lvl 9
Offline / Send Message
tharle polycounter lvl 9
So i've started customising my Maya 2011 interface to increase my productivity and i've noticed i hardly use any of the default right click functionality - basically only the component select and the top and the assign material (although i could probably live without that tbh.) is there a way of editing it so it only shows what i actually use? i've looked in marking menu editor but it's not classed as a marking menu i dont think.

any ideas?

cheers

tharle

Replies

  • Scruples
    Options
    Offline / Send Message
    Scruples polycounter lvl 10
    This is similar but probably not what you are asking for (works best with a 4 or more button mouse).
    http://www.cgarena.com/freestuff/tutorials/maya/markingmenu/'


    If you want to change the context menu's
    iirc there isn't a way without a plugin/script to change them....there was a script somewhere but I can't find it. =/
  • Firebert
    Options
    Offline / Send Message
    Firebert polycounter lvl 15
    do you mean RMB over a highlighted object or SHIFT+RMB over a highlighted object?

    SHIFT+RMB provides about everything you need on a regular basis TBH, and getting in the habit of gestural flicks will increase your productivity ten fold with the shitf+rmb functionality.

    making custom marking menus is great, but based off your initial post, i have a feeling you may not be aware of the Shift+RMB menu which changes when you are in object mode or individual component modes or nothing selected at all.

    i would suggest experimenting with and studying up on what combinations do what in different areas of maya (e.g. ctrl +rmb -vs- rmb in the channel box provides different options).
  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    tharle the right click menu's aren't a marking menu they're called a context sensitive menu. As Firebert said shift right click is the way to go in maya there's nothing better, but as far as I know even in maya 2011 you still can't easily edit what appears in these menus. There is script on creativecrash.com that let's you edit these menus but it's a bit buggy and you need to read the fine print to install it correctly.
  • tharle
    Options
    Offline / Send Message
    tharle polycounter lvl 9
    cheers for the replys.

    i'm using the shift and control right click marking menus already it's just the default context sensitive right click menu that i find has too many options on that i dont use. i find that if the mouse is too low on the screen the menu doesnt appear where i expect and i end up selecting some option i didnt want.

    doesnt matter though - i've just mapped the component masks to ctrl 1-4 a la max which is actually much quicker anyway tbh.

    thanks though!

    tharle
  • haiddasalami
    Options
    Offline / Send Message
    haiddasalami polycounter lvl 14
    I remember in one of the GDC slides (think it was 2006) where you had to edit the scripts within Maya to add/remove stuff. Off to hunt it :(

    http://www.gdcvault.com/play/1013414/Advanced-Tool-Writing-for-Character

    Found it though this was Maya 7 and 8. Gonna poke around and see what happens.
  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    Edit, after further testing this script seems like it was written a long time ago and needs an update. It ignores the existence of some of the context menus so it's probably not what you want.

    This script does what you want, but be warned it remaps all your context menus so you'll have to go in by hand and set them all up. If you install it and get overwhelmed you can just delete the following files from your

    C:\Users\malcolm\Documents\maya\2010-x64\scripts
    contextPolyToolsMM.mel
    klh_mmTools_default.mel
    klh_mmTools_nurbsCurves.mel
    klh_mmTools_nurbsSurfaces.mel
    klh_mmTools_polyEdge.mel
    klh_mmTools_polyFace.mel
    klh_mmTools_polyObject.mel
    klh_mmTools_polyVert.mel
    klh_mmTools_subdivs.mel
    klh_mmTools_updater.mel

    Restart Maya and everything should be back to normal.

    http://www.creativecrash.com/downloads/kyle-s-editable-context-marking-menus/feature_requests
  • MoP
    Options
    Offline / Send Message
    MoP polycounter lvl 18
    I just manually went in to the .mel files for the ContextMarkingMenu stuff and edited it all around to match what I preferred.

    The main thing about Maya (which I think they've actually fixed as of Maya 2012) was that generic stuff like the Split Polygon tool actually moved to different locations in the marking menu depending on what component mode you were in... so it was NW in Vertex mode, but SW in Edge mode... that used to drive me nuts. I just put it on straight West in every mode, so it's always the same gesture. I never understood why they had it in different places, and it still kills me that these default menus aren't customisable in an easy way.

    I guess it's partly because they want anyone to be able to sit down at any version of Maya and have certain "factory default" things which won't throw users off if people have been customising a lot? I find that rather limiting, though :(
  • malcolm
    Options
    Offline / Send Message
    malcolm polycount sponsor
    Edit, nevermind solved in my other thread.

    Mop perhaps you can help me out, I want to remap right click marking menu object mode. I want to run my own version of object mode so it does not deselect the object when going into object mode. Do you know what line I need to edit to put my own custom version in there?
  • claydough
    Options
    Offline / Send Message
    claydough polycounter lvl 10
    icon1.gifpopUpMenu mel notes: "dagObjectHit"

    "link"

    Lots of in-depth notes, links and

    A template for creating an object aware menu "WITHOUT" hacking maya's internal mel files.

    3306012217_9017df23af_o.jpg
  • claydough
    Options
    Offline / Send Message
    claydough polycounter lvl 10
    Cross posting in case you don't want to wade thru the whole thread to git to the end results and a modifier revision:
    most folk r using the alt rmb fer scale navigation in Maya. Now that the Roger is
    alt rmb-n' wit zSwitcher...
    tis time to free the key and un-scramble my brain's viewport. ( new hot key is ctl-mmb ) ( alt-ctl-rmb/mmb/lmb is also an option/s )


    For duplicate objects with the same name...
    The following template provides an alternative solution for returning "object under cursor".

    Instead of "Query/Rebuild" from a dagObjectHit's popUpMenu ( cly_objectHitMenuTemplate.mel v0.2 )
    a command echo strategy is used to ensure that "unique" long object names are returned.

    From 3 poly mesh sphere's, all with the same name "pSphere1"...
    A long object name template that returns both the long and short name of the "object under cursor".
    4428621539_a9893162fc_o.jpg


    Delete/Re-Source any previously installed/Sourced ( cly_objectHitMenuTemplate.mel v0.2 ) templates,
    And optionally in userSetup.mel add...

    [php]
    cly_objectHitMenuTemplate;
    [/php]main

    [php]
    /*
    cly_objectHitMenuTemplate.mel v0.4
    Roger Klado was here
    because no one else will do it fer me
    Jan 17, 2011 ( God's basement vacation )
    RogerKlado@gmail.com ( Klado/Claydough/cly_ )
    A template for setting up long named object aware view pane pop-up menus
    most folk r using the alt rmb fer scale navigation in Maya. Now that the Roger is
    alt rmb-n' wit zSwitcher...
    tis time to free the key and un-scamble my brain's viewport. ( new hot key is ctl-mmb ) ( alt-ctl-rmb/mmb/lmb is also an option/s )
    */
    global proc cly_objectHitMenuTemplate()
    {
    if( `popupMenu -exists cly_contextualTrash` ) {
    deleteUI cly_contextualTrash;
    }
    popupMenu
    //-alt 1
    -ctl 1
    -button 2
    -mm 1
    -p viewPanes
    -pmc ( "string $bob[] = `ls -preSelectHilite`; "+ // ls return of pre-select hilite under cursor
    "if (`popupMenu -e -exists cly_contextualTrash`) { "+
    "popupMenu -e -deleteAllItems cly_contextualTrash; "+
    "setParent -menu cly_contextualTrash; "+
    "if ( `dagObjectHit`){"+ // dag object Hit returns int if cursor is over an object
    "string $cursorObjectSet[] = {}; "+
    "$cursorObjectSet = `cly_dagMenuRape`; "+
    "menuItem -label $cursorObjectSet[0] ; "+
    "menuItem -label $cursorObjectSet[1] ; "+
    // pre selection hilite menu begin
    "if ( size( $bob ) ) "+
    " for ( $b in $bob ) "+
    "menuItem "+
    "-label $b; "+
    // pre selection hilite menu end
    // Return needs the echo outside of the proc. Command echo is cleaned up here
    "if ( `window -exists clyInvisibleEcho` ) "+
    "deleteUI clyInvisibleEcho; "+
    "} "+
    "else "+
    "menuItem -label \"no object under cursor dude\"; "+
    "}" )
    cly_contextualTrash;
    }
    //________________________________________________________________________________________
    // end


    global proc string[] cly_dagMenuRape()
    {
    //begin
    // assure history state is echoable ( therefore recordable ) during the popupMenu
    int $echoState = 1;
    if ( `window -exists clyInvisibleEcho` )
    deleteUI clyInvisibleEcho;
    window -vis 0 clyInvisibleEcho;
    columnLayout;
    cmdScrollFieldReporter cly_echo;
    if ( !`cmdScrollFieldReporter -q -echoAllCommands "cly_echo"` ) {
    $echoState = 0;
    cmdScrollFieldReporter -e -echoAllCommands 1 "cly_echo";
    }
    // temp file
    scriptEditorInfo -historyFilename "cly_tempHistoryLog.txt" -writeHistory true;
    //record history to temp file
    dagObjectHit -mn "cly_contextualTrash"; // result of
    scriptEditorInfo -writeHistory false;
    string $historyRecordAddy = `scriptEditorInfo -query -historyFilename`; // directory
    // "r"ead history record
    $fileId =`fopen $historyRecordAddy "r"`; // dagObjectHit return as int Id
    string $dagHitGitPath[] = {};
    string $dagHitArguments = `fgetword $fileId "\""`;
    while ( size( $dagHitArguments ) > 0 ) {
    $dagHitArguments = `fgetword $fileId "\"" `;
    // argument assigned address [2] contains short mame
    $dagHitGitPath[size($dagHitGitPath)] = $dagHitArguments;
    }
    fclose $fileId;
    /*
    $fileId =`fopen $historyRecordAddy "r"`;
    string $historyRecorded=`fread $fileId $historyRecorded`; // dagObjectHit return as string
    fclose $fileId;
    */
    if ( $echoState == 0 ) { // then restore to the original state
    cmdScrollFieldReporter -e -echoAllCommands 0 "cly_echo";
    }
    //clean
    sysFile -delete $historyRecordAddy;
    // Once again, we have had our way with dagMenuProc. ( she's history ) call her a cab...
    popupMenu -e -deleteAllItems cly_contextualTrash;
    string $cly_objPathReturns[] = {};
    string $tokenizedLongPath[]; // find short names
    tokenize $dagHitGitPath[2] "|" $tokenizedLongPath; // "
    $cly_objPathReturns[0]= $tokenizedLongPath[size($tokenizedLongPath) - 1];
    $cly_objPathReturns[1]= $dagHitGitPath[2];
    return $cly_objPathReturns;
    }
    // end: insert applause here...

    [/php]

    perhaps query the menu labels ( object names as labels ) in the
    -pmc command flags to actually build some commands/functionality?

    ( hopefully )
    That might be useful to someone... without any gotchas.

    :nerd: did I miss sumthin??
    If so, please fill in any holes and thanks in advance!

    Quote:
    Originally Posted by ClayDough:
    did I miss sumthin??
    If so, please fill in any holes and thanks in advance!
    You sure did chief.. "long name" component pre-selection hilite menuItems
    couldn't find their menus.
    Now is fixed.

    pre-SelectHilite component Returned With Long Path ( Non-unique Object Names )

    4473325944_0da7edf97a_o.jpg


    .
  • claydough
    Options
    Offline / Send Message
    claydough polycounter lvl 10
    Better yet!
    ( for returning long names; a straightforward solution from cgtalk, credit: Vincenzo )

    link
    I tryed the method suggested by claydough. It worked great but there is something missing: if we use the object name returned by default markingMenu Maya proc, deleting all menuItems but the "objectName..." one, we do not get the full pathname of the object. Hence we cannot pass it to commands because it will fail if more than one object has the same name.
    What I found is to query the command associated with the "Select" menuItem, that returns a string of type ("select -r " + $objectFullPathname). Then I tokenize and use that for passing arguments to other procs.
    Hope this is useful...
    vincenzo

    haven't been able to try yet hopefully soon.
Sign In or Register to comment.