MayaSublime icon indicating copy to clipboard operation
MayaSublime copied to clipboard

Can not get output in sublime to work

Open vicro opened this issue 8 years ago • 13 comments

I get the following error in Maya's script editor

# 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

I noticed you did a commit where you added import sys to pubScriptEditor.py. Installed latest version but I still get the error. Any ideas? Im using Maya2016 Extension 2

vicro avatar Jan 25 '17 10:01 vicro

It usually takes at most a day for the changes to sync up with the Sublime Package Control system and then be delivered back to those that are using automatic updates. Are you using it through Package Control and has it updated to 3.0.2? Have you checked your package location to confirm the code has been updated to the latest version?

justinfx avatar Jan 25 '17 18:01 justinfx

I just tryed removing the package, and installing again from Package control, Opened the code and it has the sys import. Still getting the error. Python is different version, Is Maya Python different from installed python? some env_var missing?

vicro avatar Jan 30 '17 08:01 vicro

It seems that Sublime Package Control updated their format, possibly, and is not automatically picking up my updates. It did not pick up release 3.0.2 because it says the last release date it is using is a day before the 3.0.2 release. I've submitted a pull to update the settings.

https://github.com/wbond/package_control_channel/pull/6107

In the meantime, you could also manually clone MayaSublime to your package location.

justinfx avatar Jan 30 '17 09:01 justinfx

Did this end up working for you?

justinfx avatar Feb 04 '17 21:02 justinfx

I tried with the latest source from here.

Now I'm getting this error in Maya's script editor

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

sys error is gone but still not working. :(

vicro avatar Feb 07 '17 10:02 vicro

I've just tested this, with a fresh install from Package Control, using Maya 2016 ext2, and it works as expected. Can you try making sure you have removed all traces of MayaSublime, and then install it fresh from Package Control? You may want to make sure you have cleared your user prefs in case that is causing a problem.

justinfx avatar Feb 08 '17 20:02 justinfx

@justinfx ,I'm using the latest version, and I can get "receive_maya_output" work only if I set "no_collisions" to true. Otherwise, I get the same error "# NameError: name '_MayaSublime_streamScriptEditor' is not defined".

kurtontheway avatar Jun 29 '17 09:06 kurtontheway

@kurtontheway , I was able to reproduce this as you said, by enabling "receive_maya_output" and disabling "no_collisions". The problem was that the callback was only ever being installed into the private python namespace. I've pushed fixes to install it to the appropriate namespace (global or private) based on the settings.

Can you confirm the master branch works for you? If so, I can tag it as 3.0.3 to it releases to package control

justinfx avatar Jun 30 '17 02:06 justinfx

Tagged as release 3.0.4: https://github.com/justinfx/MayaSublime/releases/tag/3.0.4

justinfx avatar Jul 02 '17 21:07 justinfx

@justinfx , Sorry for the late response and thank you for the quick fix, but I was unable to receive any maya output in sublime console by enabling "receive_maya_output" and disabling "no_collisions", no error messages as well.

kurtontheway avatar Jul 03 '17 04:07 kurtontheway

Even after restarting Maya./Sublime? I at first saw the same issue because the old code was still loaded in Maya. But then I was seeing output in the Sublime console.

justinfx avatar Jul 03 '17 04:07 justinfx

After restarting both Maya and Sublime.

kurtontheway avatar Jul 03 '17 05:07 kurtontheway

Sorry, I have been really busy but I will find time to look at it again. It must have something to do with the two namespaces causing headaches

justinfx avatar Jul 07 '17 22:07 justinfx