justinfx / MayaSublime

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

Streaming ScriptEditor: global name 'sys' is not defined #28

Closed fredrikaverpil closed 7 years ago

fredrikaverpil commented 7 years ago

I just tried out the new streaming script editor feature (output shown in ST3 console). I simply changed the prefs to say

"receive_maya_output": true

...and then in Maya, I ran

cmds.commandPort(name=":7002", sourceType="python")

From ST3, I executed

print('hello')

...but nothing new was seen in the ST3 console and in the Maya script editor I saw this:

# Traceback (most recent call last):
#   File "<string>", line 17, in <module>
#   File "<string>", line 1, in <module>
#   File "<string>", line 25, in _MayaSublime_streamScriptEditor
# NameError: global name 'sys' is not defined
hello

After having run import sys in ST3, the streaming feature works.

justinfx commented 7 years ago

Wow I dont know how this got past myself a two other people testing it. Must have been luck that the environment already had the module. I will fix it and tag patch release.

justinfx commented 7 years ago

Tagged version 3.0.2