toMaya

Download

This python script allows you to talk to Maya
through a commandPort.
It works with both MEL and python and can be used in conjunction with
any script editors that can execute external commands and can provide
variables for the current scripts and the current selection.

Setup:
1. Copy toMaya.py to your PYTHONPATH
2. Setup your script editor
3. In Maya open port 6001

Examples:
Eclipse->External Tools Configurations:
Location: c:\Python26\python.exe
Arguments: *pathTo\toMaya.py "${resource_loc}" "${selected_text}"

EditPlus->Configure User Tools
Command: python *pathTo\toMaya.py
Argument: "$(FilePath)" "$(CurSel)"

UltraEdit->Tool Configuration
Command Line: *pathTo\python.exe *pathTo\toMaya.py "%F" "%sel%"

Enjoy and drop me a line if you have any questions.


4 responses to “toMaya

  • Christian

    Hi Catalin,
    thx for sharing your knowledge!
    I will use ultra edit for my mel/python scripts.
    Can i use toMaya.py with UE?
    thx
    Christian

    • Catalin Niculescu

      Hi Christian,

      in UEdit -> Tool Configuration create a new tool and under Command Line type:
      *pathToPythonExecutable\python.exe *pathTo\toMaya.py "%F" "%sel%"

  • Arjun Jain

    How can I use this neat script in eric4?
    TIA!!

  • Catalin Niculescu

    As long as the editor itself is capable of running external commands, toMaya should work.
    Basically, if you were to talk to maya from the command line, the command would be:
    python *pathTo/toMaya.py “pathTo/theScriptFile” “”

    So you just need to call toMaya using your python interperter, with two arguments:
    1. filePath in quotes
    2. an empty string in quotes

    The second argument, btw, is useful only if you’re executing a block of selected MEL code and it doesn’t quite work with python. In this case, the command should look like this:
    python *pathTo/toMaya.py “” “my block of MEL code”

Leave a comment