justinfx / MayaSublime

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

add ST3 compatibility (fixes #15) #16

Closed williamledoux closed 11 years ago

williamledoux commented 11 years ago

Hi,

Here are the modifications that I had to do to make it work with ST3. I tested both Mel and Python on Win7 with Maya2013.

I don't know why, but besides python3 related modifications (both in ST2 and ST3), I had to double all backward slashes in file_path, otherwise Maya would not be able to source the file. Is that due to my Maya Version ? Or do you work on mac ? Anyway, you can remove this part.

Thanks for you work, this plugin is a great idea !

justinfx commented 11 years ago

Thanks for the pull request! I had to fix a typo in one of the print statements though where you accidentally used a comma. Also, I had it import the future print statement, instead of trying to be compatible with tuples. As for the windows path, in python a forward-slash should be universally compatible even on windows. Although because I don't have windows handy, I can't confirm what file_path = self.view.file_name() is returning. It could also be converted to forward slash if it did contain back slashes. Either way, I left the if case in there for now.