Sublime Text MayaSublime use the code sent to the Maya, so Sublime Text can get to the Maya Script Editor Window of Hirstory Window information? ?

241 views
Skip to first unread message

提颖浩

unread,
Jun 14, 2014, 9:13:54 AM6/14/14
to python_in...@googlegroups.com
Hi All
Sublime Text MayaSublime use the code sent to the Maya, so Sublime Text can get to the Maya Script Editor Window of Hirstory Window information? ?
thanks!!!

Justin Israel

unread,
Jun 14, 2014, 8:01:44 PM6/14/14
to python_in...@googlegroups.com

Hi

If I understand you correctly,  you want to know if the MayaSublime plugin can send the text to the script editor instead of executing it?

Couldn't you just copy and paste for that?

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/70ad0acb-72a2-4196-82e8-29f9095f21e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

提颖浩

unread,
Jun 14, 2014, 11:53:09 PM6/14/14
to python_in...@googlegroups.com
HI
I come from China 
English is not very good

I uploaded a picture 

I want to use the Sublime Text to get the information from maya

thank you
捕获.PNG

Justin Israel

unread,
Jun 15, 2014, 1:26:35 AM6/15/14
to python_in...@googlegroups.com
I guess even with the picture I am not clear on what you want. I'm not sure what you mean by getting information from the script editor and sending it to Sublime. You want communication in the other direction? Can you explain an example of how you would use the feature you want?


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

Sascha Kremers

unread,
Jun 15, 2014, 1:33:00 AM6/15/14
to python_in...@googlegroups.com
I think this was possible with the maya plugin for eclipse, when you activated echo all commands in the maya script editor. 

The advantage was, that you didn't need to open the script editor in maya anymore. All executed commands were displayed in the console of eclipse. 

But as said, it was displayed in the console (not sure how this window was actually called in eclipse), not the texteditor. 

-- 
Sascha Kremers
Gesendet mit Sparrow

提颖浩

unread,
Jun 15, 2014, 1:58:18 AM6/15/14
to python_in...@googlegroups.com
Hi
Whenever the Sublime Text executing code, it can display information getting the from Maya
For example: import maya.cmds as mc 
                    selectList = mc.ls (sl = True) 
                    print selectList 
Sublime Text can display the contents of selectList
thank you

Marcus Ottosson

unread,
Jun 15, 2014, 3:14:25 AM6/15/14
to python_in...@googlegroups.com
Off the top of my head, sounds like it should be fairly straightforward to intercept the sys.stdout of Maya, and pass on whatever information goes into it on to Sublime.

However, the reason Maya can get commands from the outside is because it has a server/listener open - the commandPort. Sublime is then passing commands through it, similar to passing messages across a network.

For messages to go the other way around, you'll have to create a server/listener in Sublime and then have Maya transmit messages to it instead.

Probably not the most straightforward thing to do, but I can see the advantage of doing so. I might be able to walk you though it, but first, is this what you are looking for?


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Marcus Ottosson
konstr...@gmail.com

Justin Israel

unread,
Jun 15, 2014, 9:29:14 AM6/15/14
to python_in...@googlegroups.com

Oh right. Getting the return value and printing it to the Sublime console has been asked before. But there are two aspects of the script editor output. There is the return value for a function call,  and also the output that Maya just prints to stdout.

Getting the stdout would be a different task altogether because it would require something on the Maya side to actually send the stdout stream over a socket to Sublime listening on the other end.

Getting the return value of a function that you call also requires that you have set your commandPort to use the flag that returns output and also has a high buffer value. Apparently if Maya tries to send back output larger than the defined buffer,  it will error.
It might be possible for MayaSublime to poll to receive for a very short timeout and if nothing comes back then it just gives up. I just remember it being more trouble than it was worth. I could look into it again though.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

提颖浩

unread,
Jun 16, 2014, 10:41:30 AM6/16/14
to python_in...@googlegroups.com
thank you  
Looking forward to your achievement
Reply all
Reply to author
Forward
0 new messages