The x-maya-data mimetype used for drag-and-drop?

The x-maya-data mimetype used for drag-and-drop?

Anonymous
Not applicable
1,327 Views
1 Reply
Message 1 of 2

The x-maya-data mimetype used for drag-and-drop?

Anonymous
Not applicable

I thought I would repost a question that has surfaced more than once, in different forums:

Ref:
http://stackoverflow.com/questions/8391267/determining-the-nature-of-8-bytes-of-data
https://groups.google.com/d/topic/python_inside_maya/wRMU98TIXL4/discussion

When we examine the mime type from a drag-and-drop event (via Qt) on the outliner editor, the mimetype specified is "application/x-maya-data", and the QByteArray is some 8 byte data. Does anyone have an internal knowledge about what this data represents, and if it can be used to identify the dragged/dropped items?

Sample data from repeating the exact same drop looks like this:


PyQt4.QtCore.QByteArray(' \xae\x117\x01\x00\x00\x00')
PyQt4.QtCore.QByteArray('P1\x167\x01\x00\x00\x00')
PyQt4.QtCore.QByteArray('\xc0!\x1c7\x01\x00\x00\x00')
PyQt4.QtCore.QByteArray('@\x88\xcf5\x01\x00\x00\x00')
PyQt4.QtCore.QByteArray('\xe0\xe5\x825\x01\x00\x00\x00')
PyQt4.QtCore.QByteArray('\xd0Q\x805\x01\x00\x00\x00')
PyQt4.QtCore.QByteArray("\x80\t\xe3'\x01\x00\x00\x00")



The best I am able to access the outlinerEditor is via a QWidget reference, as I assume it is a completely custom internal type. So it does not appear that I can simply reference the object like a QAbstractItemView and query the selection model.

Any insight?

0 Likes
1,328 Views
1 Reply
Reply (1)
Message 2 of 2

cyrille
Alumni
Alumni

Hi,

 

x-maya-data contains a list of internal Maya data structures, not the data itself or API data structure. There isn't really anything in there that users will be able to work with. You would need access to a bunch of Maya internals to decode it. Even then, in some cases the meaning of the data is dependent on which control sent it. The 8bits you're seeing is actually the pointer to the internal structure memory address.

 

Instead, you should provide your own drop mine format. You also need to provide your own drop target. The devkit sample MExternalDropCallback allows you to trap it before Maya sees it. In prior version of Maya, you will find another way using low level Drag&Drop OS API.

 

cheers

cyrille

0 Likes