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.

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

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

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

UltraEdit->Tool Configuration
Command Line: *pathTo\python.exe *pathTo\ "%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 with UE?

    • Catalin Niculescu

      Hi Christian,

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

  • Arjun Jain

    How can I use this neat script in eric4?

  • 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/ “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/ “” “my block of MEL code”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: