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
    1. Maxon Developers Forum
    2. ferdinand
    3. Topics
    • Profile
    • Following 0
    • Followers 15
    • Topics 53
    • Posts 3,073
    • Best 746
    • Controversial 1
    • Groups 2

    Topics created by ferdinand

    • ferdinandF

      Forum rollback removes dormant users

      News & Information
      • information forum • • ferdinand
      1
      0
      Votes
      1
      Posts
      123
      Views

      No one has replied

    • ferdinandF

      Service Announcement: Regression in GeUserArea Handling in 2025.3.X Releases

      News & Information
      • cinema 4d c++ python sdk information • • ferdinand
      2
      0
      Votes
      2
      Posts
      363
      Views

      ferdinandF

      Hey,

      I now know how our API will look like in this regard in 2026.0.0. Its compile/runtime behaviour will be as for 2025.2.1 and before. And we will introduce a new flag NOHANDLEFOCUS which must be set when attaching the area when one explicitly wants to ignore focus events. So, you will not have to change your code when you were happy with your user area behaviour as it is has been.

      Cheers,
      Ferdinand

    • ferdinandF

      2025.3.1 SDK Release

      News & Information
      • cinema 4d news c++ python sdk information • • ferdinand
      1
      0
      Votes
      1
      Posts
      2.1k
      Views

      No one has replied

    • ferdinandF

      2025.3.0 SDK Release

      News & Information
      • news cinema 4d c++ python sdk information • • ferdinand
      4
      3
      Votes
      4
      Posts
      1.4k
      Views

      E

      Ok? will do

    • ferdinandF

      Reduced Levels of Support between 12/05/2025 and 19/05/2025

      News & Information
      • forum support information • • ferdinand
      1
      0
      Votes
      1
      Posts
      438
      Views

      No one has replied

    • ferdinandF

      How to implement an image control that can receive and generate image data drag events

      Cinema 4D SDK
      • 2025 python • • ferdinand
      10
      5
      Votes
      10
      Posts
      1.3k
      Views

      ferdinandF

      Hey @Dunhou,

      I am still not 100% clear about what you are trying to do. But I guess what you want to do is distinguish a single-drag -click, i.e., the user is dragging something, from a single click. The issue with that is that we are in your code inside a while loop which just polls the input state as fast as it can and not in message stream, where we only get events for state changes. So, this means unless there is Speedy Gonzales at the mouse, even the quickest of single clicks will produce more than one iteration in the loop.

      What is still unclear to me why you are doing all this, as knowing that the mouse is outside of the UA does not mean that we know if the user dropped the payload on an object. But this is how I would solve distinguishing a 'light click' (a single click) from a drag event.

      A cleaner solution might be to let the convenance function InputEvent be a convenance function and move to the source Message. There you should be issue start and stop events for drag operations. But since you want to start it yourself, we are sort of in a pickle. I would have to play around a bit with the code to see if there is a better way with Message,

      Cheers,
      Ferdinand

      def InputEvent(self, msg: c4d.BaseContainer) -> bool: """Called by Cinema 4D when the user area receives input events. Here we implement creating drag events when the user drags from this user area. The type of drag event which is initiated is determined by the drag type selected in the combo box of the dialog. """ # When this is not a left mouse button event on this user area, we just get out without # consuming the event (by returning False). if msg[c4d.BFM_INPUT_DEVICE] != c4d.BFM_INPUT_MOUSE and msg[c4d.BFM_INPUT_CHANNEL] != c4d.BFM_INPUT_MOUSELEFT: return False dragType: int = self._host.GetInt32(self._host.ID_DRAG_TYPE) mx = int(msg[c4d.BFM_INPUT_X]) my = int(msg[c4d.BFM_INPUT_Y]) mx -= self.Local2Global()["x"] my -= self.Local2Global()["y"] state = c4d.BaseContainer() self.MouseDragStart(c4d.BFM_INPUT_MOUSELEFT,mx,my,c4d.MOUSEDRAGFLAGS_DONTHIDEMOUSE|c4d.MOUSEDRAGFLAGS_NOMOVE) lastPos: tuple[float, float] | None = None while True: res, dx, dy, channels = self.MouseDrag() if res != c4d.MOUSEDRAGRESULT_CONTINUE: break self.GetInputState(c4d.BFM_INPUT_MOUSE, c4d.BFM_INPUT_MOUSELEFT, state) # This is how I debugged this, GetContainerTreeString (in the beta it might be already # contained) is a feature of a future version of the SDK. # print(f"{mxutils.GetContainerTreeString(state, 'BFM_')}") # State: Root (None , id = -1): # ├── BFM_INPUT_QUALIFIER (DTYPE_LONG): 0 # ├── BFM_INPUT_MODIFIERS (DTYPE_LONG): 0 # ├── BFM_INPUT_DEVICE (DTYPE_LONG): 1836021107 # ├── BFM_INPUT_CHANNEL (DTYPE_LONG): 1 # ├── BFM_INPUT_VALUE (DTYPE_LONG): 1 # ├── BFM_INPUT_VALUE_REAL (DTYPE_REAL): 0.0001 # ├── BFM_INPUT_X (DTYPE_REAL): 203.13671875 # ├── BFM_INPUT_Y (DTYPE_REAL): 88.0390625 # ├── BFM_INPUT_Z (DTYPE_REAL): 0.0 # ├── BFM_INPUT_ORIENTATION (DTYPE_REAL): 0.0 # ├── 1768977011 (DTYPE_REAL): 1.0 # ├── BFM_INPUT_TILT (DTYPE_REAL): 0.0 # ├── BFM_INPUT_FINGERWHEEL (DTYPE_REAL): 0.0 # ├── BFM_INPUT_P_ROTATION (DTYPE_REAL): 0.0 # └── BFM_INPUT_DOUBLECLICK (DTYPE_LONG): 0 # I.e., we are unfortunately neither being issued a BFM_DRAGSTART nor an # c4d.BFM_INTERACTSTART, I assume both or only emitted in the direct Message() loop. # But we can write code like this. # if state[c4d.BFM_INPUT_DOUBLECLICK]: # print(f"Double click detected at {mx}, {my}") # break # elif state[c4d.BFM_INPUT_VALUE] != 1: # print(f"Mouse button not pressed anymore at {mx}, {my}") # break # else: # print(f"Non double click at {mx}, {my}") # The issue with this is that we are here just in a loop polling the current left button # state, not inside a message function where we get a state stream. So, for a single # click, we end up with somewhat like this, and here I made sure to click really fast # Non double click at 96.8515625, 58.37109375 # Non double click at 96.8515625, 58.37109375 # Non double click at 96.8515625, 58.37109375 # Non double click at 96.8515625, 58.37109375 # Mouse button not pressed anymore at 96.8515625, 58.37109375 # And this is a short drag event. # Non double click at 84.875, 56.5859375 # Non double click at 84.875, 56.5859375 # Non double click at 84.875, 56.5859375 # Non double click at 84.875, 56.5859375 # Non double click at 84.59765625, 56.5859375 # Non double click at 83.49609375, 56.94921875 # Non double click at 83.49609375, 56.94921875 # Non double click at 82.39453125, 57.3125 # Non double click at 82.39453125, 57.3125 # Non double click at 80.74609375, 58.1328125 # Non double click at 80.74609375, 58.1328125 # Non double click at 77.7265625, 58.6328125 # ... # Non double click at -8.35546875, 80.16796875 # Non double click at -8.35546875, 80.16796875 # Non double click at -8.35546875, 80.16796875 # Mouse button not pressed anymore at -8.35546875, 80.16796875 # So they are very similar, and we cannot go by the pure logic "when the coordinates # do not change, we are in a drag event" because this is not an event stream, i.e., we # might poll the same input state multiple times, depending on how fast our #while loop # runs. # But what we could do, is postpone all actions until we see a change. In extreme cases, # where the user is swiping very fast with the mouse and then clicks on a tile, this might # fail. mx -= dx my -= dy currentPos: tuple[float, float] = (mx, my) if lastPos is None and currentPos != lastPos: lastPos = currentPos # The mouse is not being pressed anymore. if not state[c4d.BFM_INPUT_VALUE]: if currentPos != lastPos: print("Drag event") else: print("Click event") break return True Click event Drag event Click event Click event Click event Drag event
    • ferdinandF

      2025.2.0 SDK Release

      News & Information
      • news cinema 4d c++ python sdk information • • ferdinand
      2
      2
      Votes
      2
      Posts
      2.6k
      Views

      DunhouD

      Love the mxutils and GeDialog Changes, I use these features almost every time, thank you for having a more refined official version.

      Thank you to the SDK team for their work achievements

      Cheers~
      DunHou

    • ferdinandF

      C++ SDK: Custom Branching Code Example

      Cinema 4D SDK
      • c++ 2025 • • ferdinand
      1
      3
      Votes
      1
      Posts
      569
      Views

      No one has replied

    • ferdinandF

      2025.1.0 SDK Release

      News & Information
      • news cinema 4d c++ python sdk • • ferdinand
      1
      1
      Votes
      1
      Posts
      3.2k
      Views

      No one has replied

    • ferdinandF

      2025.0.0 SDK Release

      News & Information
      • cinema 4d news c++ python sdk • • ferdinand
      8
      3
      Votes
      8
      Posts
      5.7k
      Views

      H

      Thank you

    • ferdinandF

      2024.5.0 SDK Release

      News & Information
      • cinema 4d news c++ python sdk • • ferdinand
      1
      0
      Votes
      1
      Posts
      4.8k
      Views

      No one has replied

    • ferdinandF

      Updated Redshift node material examples

      Bugs
      • c++ python • • ferdinand
      4
      2
      Votes
      4
      Posts
      1.1k
      Views

      DunhouD

      Hey @ferdinand ,

      Thanks for your answer, unfortunately, the answer is the same as I thought, and I am powerless to do anything about it. I can only wait for the exposed parameters.

      Based on your suggestion, there may be many issues, and it is not worth spending a lot of time debugging them. Fortunately, this is not a very urgent task.

      Cheers~
      DunHou

    • ferdinandF

      Reduced Levels of Support between 10/05/2024 and 17/05/2024

      News & Information
      • information support • • ferdinand
      1
      0
      Votes
      1
      Posts
      670
      Views

      No one has replied

    • ferdinandF

      Projecting Points from Object/World Space into Texture Space

      Cinema 4D SDK
      • 2024 python • • ferdinand
      1
      4
      Votes
      1
      Posts
      617
      Views

      No one has replied

    • ferdinandF

      Reduced Levels of Support between 22/04 and 26/04

      News & Information
      • support information • • ferdinand
      1
      0
      Votes
      1
      Posts
      809
      Views

      No one has replied

    • ferdinandF

      Extended C++ SDK and Deprecated Download Section

      News & Information
      • news c++ python sdk • • ferdinand
      1
      0
      Votes
      1
      Posts
      745
      Views

      No one has replied

    • ferdinandF

      2024.4.0 SDK Release

      News & Information
      • news cinema 4d c++ python sdk • • ferdinand
      7
      1
      Votes
      7
      Posts
      6.1k
      Views

      ferdinandF

      Hey,

      so, I fixed this now, in the sense that the TOC is now back in these classic API type and module pages.

      c2f5944c-90e4-49f9-a194-44f7be96b281-image.png

      I renamed the old a bit wordily named "Functions Signatures" and "Functions Documentation" to Overview and Functions (or Methods for classes) . Opposed to the old pre 2024.3 TOCs (which were completely broken in many ways), these categories now also show up in the TOC:

      adcc5c03-d5fd-4f97-b206-7d69cef2d81e-image.png
      bc7bac63-8959-487a-8aa7-81e729fcc92a-image.png

      The old Types and Inheritance section has been merged into root element as I do not see a good reason why it should appear in the middle of the page. The obvious thing would be to now add links to the individual elements on a page, so that you can quick-jump to a particular function. But that turned out to be not so easy with the mess we made there before and stubborn docutils. As evident by the C4DAtom example and other cases our TOC trees are very broken in this part of the docs and I now already almost spent two days with fixing things to this state.

      This will be shipped in the current state with the next release of Cinema 4D. When I have some time to waste, I will try to add the function links.

      ⚠ The manual and maxon API TOCs are unaffected by this, they continue to work as intended. The classic API does its own thing here (as always 😄 ) which why this is such a mess.

      Cheers,
      Ferdinand

    • ferdinandF

      About the Necessity of Code Signing C++ Plugins

      News & Information
      • news c++ cinema 4d sdk information • • ferdinand
      1
      2
      Votes
      1
      Posts
      796
      Views

      No one has replied

    • ferdinandF

      Cinema 4D 2024.3.2 Hotfix

      News & Information
      • cinema 4d information c++ sdk • • ferdinand
      1
      2
      Votes
      1
      Posts
      1.1k
      Views

      No one has replied

    • ferdinandF

      Warning: Unintentional Incompatibility between Cinema 4D 2024.2 and 2024.3 C++ ABI

      News & Information
      • information support cinema 4d c++ • • ferdinand
      1
      0
      Votes
      1
      Posts
      1.2k
      Views

      No one has replied