Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Drag and Drop between two UserArea

    Cinema 4D SDK
    python
    3
    3
    454
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      JohnSmith
      last edited by Manuel

      Hello everyone. I have created two UserAreas and I want to drag objects between them. Can you please tell me how to implement this?

      def __init__(self):
          self.area1 = DraggingArea1()
          self.area2 = DraggingArea2()
      
      def CreateLayout(self):
          self.AddUserArea(1000, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT)
          self.AttachUserArea(self.area1, 1000)
      
          self.AddUserArea(2000, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT)
          self.AttachUserArea(self.area2, 2000)
          return True
      
      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by

        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.

        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • ferdinandF
          ferdinand
          last edited by

          Hello @JohnSmith,

          without any further questions and other postings, we will consider this topic as solved and flag it as such by Friday, 17/06/2022.

          Thank you for your understanding,
          Ferdinand

          MAXON SDK Specialist
          developers.maxon.net

          1 Reply Last reply Reply Quote 0
          • First post
            Last post