4

Here's the context: I am working an a Maya Plugin. One of the features require me to Drag an element from the Outliner Window onto a UI element of my plugins UI. (Everything in Maya is in Qt) From the outliner, i can drag an item and drop it. For anyone familiar with Qt, you will know that the DropEvent comes with a QMimeData object. This object contains data from the drag&drop source (the Outliner window). In my case, the QMimeData format is "application/x-maya-data". The QByteArray returned by QMimeData.data() is 8 bytes long, the first 4 beeing NULL. So, my hunch is that this is a pointer to some Data Type.

So, here's the question: Is there ANY way of determining what type of data a pointer points to? I've tried casting it into a few Maya data structures (MPxData, MObjectHandle, etc) but without success.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
David Menard
  • 2,261
  • 3
  • 43
  • 67
  • This question has come up a few more times on the python_in_maya google group. Did you ever make any progress on determining the reference? – jdi Dec 07 '12 at 01:43
  • Well yes and no... I ended up having to look at the Maya source code (working next to the maya team has its advantages). The pointer was to a non-public object type, so I ended up using the pointer to access the object's v-table (which is just a huge hack). – David Menard Dec 07 '12 at 16:31
  • Hello David, would you mind visiting http://forums.cgsociety.org/showthread.php?p=7925000, maybe you could disclose just a little bit of your findings. – St0fF Oct 31 '14 at 10:10

1 Answers1

1

You could try deleting it twice and then running your program in a memory debugger (like valgrind), which will throw an error and show you where the memory has been allocated.

However, you might also consider social sources: the documentation or the project's mailing list.

thiton
  • 35,651
  • 4
  • 70
  • 100