Why does copying from PyCharm and pasting to Maya script editor doesn't work?

python
maya

#1

I’m using PyCharm as suggested by many people in the industry for editing Python code.

When copying from PyCharm, and pasting it in Maya script editor. The code doesn’t get pasted. Although the code is still on the clipboard. Pasting in the script editor becomes then becomes a two-step process, first paste in the search field, then cut and paste into the editor.

Why does this happen? How can this be prevented?

PS: I can use MayaCharm to execute chunks of code into Maya, but that’s not the point.


#2

Works for me in 2018, not in 2016. I think its because the script editor field it earlier versions of Maya does not like whatever “rich text” PyCharm is putting on the clipboard.


#3

I ran into this a couple of weeks ago. I was considering switching my IDE from Wing to PyCharm, but I didn’t have enough time to investigate it further, and stuck with Wing for the short term.

But I did find this workaround for copy/paste:


#4

I replaced Maya’s factory script editor with Charcoal Editor and never looked back.

I do quick scripting in Charcoal, and bigger projects/tools in PyCharm.
http://zurbrigg.com/charcoal-editor


#5

have the same issue in Maya 2013, from pyCharm i copy first into Notepad++ and then from Notepad++ into Maya script editor… this works for me… it has to do with the rich text format i guess…


#6

Usually I just put into command line and ctrl+c ctrl+v.


#7

This is an issue with Maya 2014 and 2015 as well.
I’ve found this issue is also resolved for Maya 2017.

You can copy from PyCharm and use Sublime / Notepad / Visual Studio Code / Notepad ++ to ferry the code across. (paste your copied code into the other text editor, then select all and copy/paste into Maya)

Alternatively, you can do the same thing using the ‘Search Field’ at the top of the Maya Script Editor. (Though their might be a character limit I haven’t encountered yet)