justinfx / MayaSublime

Send selected Python and MEL code snippets from SublimeText to Maya via commandPort
MIT License
149 stars 38 forks source link

Send file when nothing selected and context menu #3

Closed juggernate closed 11 years ago

juggernate commented 11 years ago

Added the ability to source MEL file or import and reload python module. This sends the current view/file if nothing is selected via the same command. Added language detection to the command so removed the explicit language arg. This also allows for a single context menu item which was added.

Perhaps the language arg could stay in, but I couldn't quite figure out a single "Send to Maya" context menu item with it, plus it gets ignored with the language detection in the command.

Tested on Windows and Mac, but not on Linux.

KelSolaar commented 11 years ago

What about execfile instead of trying to manipulate sys.path? The executed file can do those manipulations itself for instance.

justinfx commented 11 years ago

Ya if it is going to run the full file at all, the execfile approach at least removed the need for the pythonpath mods. I think we should split off and merge your other contributions and then address this full file run in another pass.

juggernate commented 11 years ago

My master branch no longer sends the full file if you want to merge. Others and I like to work this way (sending the whole file), so I will look into execfile in another branch.

justinfx commented 11 years ago

Thanks! If you end up doing the execfile approach, I will merge that too.