I know, this is a topic that got discussed several times in the past. Nevertheless I can not get it to work properly.
The goal: Being able to drag a yet to be created object or material from my GeUserArea into C4D (desired targets: view port, Material Manager, Object Manager,...).
I said "yet to be created". By this I mean, it is an asset from some library, which is not yet part of the document.
I have two options:
- Create and insert the asset before the drag and then remove it again, if the drag fails (either being escaped or dropped onto some forbidden place).
- Or I do insert the asset into the document on successful drop.
The beginning looked promising, HandleMouseDrag() seems to be the function for this scenario and at first it seemed to work as expected.
But how on earth do I find out about the outcome of the drop?
I do receive BFM_DRAGRECEIVE, but I do never get BFM_DRAG_FINISHED or BFM_DRAG_ESC to be true. Only BFM_DRAG_LOST seems to hold information. It is always jumps from false to true, when the user ends the drag in whatever way (escaped, dropped successfully, dropped on forbidden area, it doesn't matter).
Yes, I do return the return value of SetDragDestination() from my Message() function, while in drag, as I found in this forum, that it's needed to notify C4D about my interest in the drag (which I started in the first place... Not being interested in the outcome of something I started feels a bit strange to me... a bit like firing a rocket and not being interested, if it actually started, exploded on the pad or actually reached its destination. Anyway...).
And then there's an additional issue with dragged materials:
The result is different, if the user drops it onto an object in viewport or Object Manager or onto the Material Manager. In the first case it works as expected (as long as I insert the material into the document), but in the latter case I end up with two material being created in the MM. So, when dropping onto an object C4D seems to assume, the material is already part of the document and only assigns it (but I am responsible for making it available in the document), while when dropping onto the MM, then C4D seems to automatically create a copy (so I should not insert it into the document myself).
But how am I to decide, what to do and what to expect?
Even if I had a way to find out about the success of the drop operation, I would still be lacking the information about the drop target.
Any help would be much appreciated.