Copy/paste from Pycharm to Maya script editor

Hi there,

Any reason why I can not copy from Pycharm and paste into Maya's script editor. I have to paste the text into notepad and then copy from there. :-/

Other apps seem to be ok though which is odd.

thanks

-Si

4 comments

Hello simon,

Please try PyCharm 2.0 EAP, which has a number of fixes related to clipboard

management.

http://blog.jetbrains.com/pycharm/

Any reason why I can not copy from Pycharm and paste into Maya's

script editor. I have to paste the text into notepad and then copy

from there. :-/

Other apps seem to be ok though which is odd.

--

Dmitry Jemerov

Development Lead

JetBrains, Inc.

http://www.jetbrains.com/

"Develop with Pleasure!"

0

I'm currently using the EAP verion 110.37.

-Si

0

I am having the same issue with 110.377 as well. If I paste the text into notepad++ or notepad and then copy from there I can then paste into Maya. I think it's very particular about the content being plain-text. This is pretty crippling workflow wise.

0

Alright I did some more investigating and it looks like Maya will fail to paste when there is a "text/uri-list" entry in the mime-data. I assume this would be more of an autodesk bugfix unless the text/uri-list entry isn't needed by pycharm and could be removed.

Here's a workaround for Maya if you are able to use PyQt:

def removeInvalidClipboardData():

oldMimeData = QtGui.qApp.clipboard().mimeData()

newMimeData = QtCore.QMimeData()

for format in oldMimeData.formats():

     if 'text/uri-list' in format: #This breaks maya paste

          continue

     data = oldMimeData.data(format)

     newMimeData.setData(format, data)

clipboard = QtGui.qApp.clipboard()

clipboard.blockSignals(True)

clipboard.setMimeData(newMimeData)

clipboard.blockSignals(False)

QtGui.qApp.clipboard().dataChanged.connect(removeInvalidClipboardData)

0

Please sign in to leave a comment.