I also did some modifications to the JRuby code, I mixed the approach by Nathan Horne (PMIP+JRuby+PythonCommandPort) with the Vimya approach (TempFile+Tail_LogFile+MelCommandPort), I first try to use a Python Command port, but I was receiving weird errors, probably due to encoding in windows, the same command execfile, didn't work for me via python port, I have to send the python script using mel, trough mel port, using Jruby, duh! but that made the trick, I also try two JRuby Gems(filewatch-0.3.4, jruby-notify-0.0.3) , to filewatch/tail the log file and output to the PMIP console, but no one suited me or at least I couldn't make it work properly, refresh was lasting to long, I try some commands in the Java API of Intellij, but seemed to complex for me, I don't know Java also, so I make a dirty trick and made a Python Console Starting Script for PyCharm, which also colors warnings yellow, errors red, and results green, and maintains tailing the output of the script editor, so I can close that window forever (which save me space in my two monitor setup), I also add Mel support with ctrl+alt+shift+E cause I already was using a MEL port, (someone has Syntax Highlight for MEL in PyCharm??).
So what basically the two scripts do is:
- CTRL + E, without text selected, saves files and send the current one to Maya.
- CTRL + E, with text selected sends selection to maya, without saving files.
- CTRL + SHIFT + ALT + E, sends selection as MEL to maya.
- Running Python Console, redirects ScriptEditor output to PyCharm, and colors warnings, errors and results (CTRL+C, stops it)
MayaCharm.zip (1.51 KB)
To open the mel port:
- Add this line to your userSetup.mel in <drive>:\Documents and Settings\<username>\My Documents\maya\<Version>\scripts
commandPort -q ":4567") commandPort -n ":4567";
To view the commands and results from the output of the script editor in PyCharm you need to add the ConsoleScript.py to your console starting script in PyCharm:
-Enter your settings in Pycharm
-Click on Console, then Python Console, and paste the script in Starting Script
-Replace the line that says <REPLACE ME WITH LOG FILE, REPLACE \ for \> with the log file created by the MayaCharm plugin, you can know which it is in your PMIP console output.
-Replace all the slashes with double slashes; \ for \.
I don't know if this is working in other systems, environments, version, so feedback will be appreciated.
I´m working in a step by step, tut for this, and also setup debugging, for dummies like me, I will post it here when I finish.
Did someone knows something about this?? --> http://tech-artists.org/forum/showthread.php?3135-PyCharm-remote-debugging-Maya-question
Thanks a LOT to Nathan Horne for pointing me out in the right direction, not only in this field, but in others, I´m totally new to this and his posts had helped me a lot.
And excuse my wrong english is not my first language.
Macbeth Reyes F.