Home Technical Talk

Maya - transfer selection to ref editor

polycounter lvl 18
Offline / Send Message
solar polycounter lvl 18
Is there a way of showing what you have selected in the viewport (or outliner) in the reference editor in maya? I know you can show what you have selected in the ref editor in the outliner but is there a way of doing the opposite?

I have scenes with lots of duplicate refs and it's pain trying to find the right one to remove in the ref editor.

Replies

  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    Hmm actually that's something I've kinda wanted for a while too, maybe I'll see if I can write a script for it. Would be nice to just right-click a referenced node in the Outliner and have it pop up the related reference in the Reference Editor.

    Sounds pretty straightforward to do too, since you can just do "referenceQuery -rfn <objectName>" and it'll return the reference node.
  • solar
    Offline / Send Message
    solar polycounter lvl 18
    Sounds good MoP, get to it :poly124:
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    Yeah I'm on it ;)

    The "get the reference node" thing is the easy part, now I just need to figure out how to highlight it in the reference editor...
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    OK, done.

    Get the script here: http://www.greveson.co.uk/scripts/maya/mopRevealReference.mel

    Put it in your My Documents/maya/scripts/ folder. If you're running Maya currently, type rehash; into the MEL command line to reload the script folders so that it will detect the new file.

    To run it just have a shelf button or hotkey set to run this command:
    mopRevealReference;
    
    The script will load the Reference Editor window if it wasn't open already. It will highlight the selected object's reference.

    I tested it in a scene with 3 references and it appeared to work fine.

    I'm working on the assumption that Maya's list connection for the Reference Editor is using the same order of files as returned from file -q -r, if it's different then the selected reference might be the wrong one. I haven't tested it extensively enough to be sure, but my test cases indicated it's correct.

    Let me know if anything seems broken. I'll see about retrieving the proper selectionConnection rather than just assuming it's the same as the global reference list (although it should really be).
  • solar
    Offline / Send Message
    solar polycounter lvl 18
    Bloody hell MoP, that was quick! I'll test first thing tomorrow at work. Thanks!
  • bugo
    Offline / Send Message
    bugo polycounter lvl 17
    good heaven MoP, thats great!
  • solar
    Offline / Send Message
    solar polycounter lvl 18
    Just tried it out, works perfectly so far. Thanks so much!
Sign In or Register to comment.