Hello everyone. I have created two UserAreas and I want to drag objects between them. Can you please tell me how to implement this?
self.area1 = DraggingArea1()
self.area2 = DraggingArea2()
self.AddUserArea(1000, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT)
self.AddUserArea(2000, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT)
Hi @JohnSmith, we have separated your topic from Drag & Drop to Reorder in GUI since this is a new question. However for future reader, the code shown is a part of a code posted on the other topic.
There is the GeUserArea.HandleMouseDrag to start a drag operation, you can find an example in Drag&Drop an image in a gui field. However this is a drag operation handled by Cinema 4D so this is not possible to pass Python Object with it and there is nothing visible while the drag operation occurs.
So if you want to share python data from 2 GeUserArea the best way is through messages. The first GeUserArea 1 send a message to the dialog and then the dialog to forward the message to the GeUserArea2. Then in this message it is up to you to pass the correct data. You can pass a BaseContainer containing all your data. An example about message usage can be found in geuserarea_basic.