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
    • Register
    • Login
    1. Home
    2. Dunhou
    3. Topics
    • Profile
    • Following 2
    • Followers 4
    • Topics 51
    • Posts 250
    • Best 50
    • Controversial 0
    • Groups 0

    Topics created by Dunhou

    • DunhouD

      Load presets args in python?

      Bugs
      • windows python 2025 • • Dunhou
      7
      0
      Votes
      7
      Posts
      110
      Views

      DunhouD

      It sounds worth a try, but there may be latency issues when it comes to changes, or data changes can be manually processed during the changes

      Perhaps for my needs, I can force the database to be use GetSceneRepository, anyway, it's worth a try. Thank you for your guidance 😊

    • DunhouD

      How to simulate a drag behavior with UA?

      Cinema 4D SDK
      • windows python 2025 • • Dunhou
      5
      0
      Votes
      5
      Posts
      148
      Views

      DunhouD

      @ferdinand said in How to simulate a drag behavior with UA?:

      All it it does when the users starts to drag, according to Maxime, is inject the asset object into the document, make sure there is no object selected and then enable the place tool (and probably set the mouse cursor)

      This is my solution in my mind, definitely take a try after work. 👏

    • DunhouD

      How to create UV of obj.

      Cinema 4D SDK
      • windows python 2025 • • Dunhou
      4
      0
      Votes
      4
      Posts
      212
      Views

      M

      I use this to Thank You Ferdinand.

      This is how I imagine an SDK example should look like .... a simplest version , an altered simple version and a complex touching the boundaries of the subject.
      I am thankful and praise your work .... !

      cheers mogh

    • DunhouD

      GraphModelInterface.GetNode not worked

      Cinema 4D SDK
      • python windows 2025 • • Dunhou
      3
      0
      Votes
      3
      Posts
      282
      Views

      DunhouD

      Hi @m_adam ,

      Thanks for your reply, it worked well.

      But I still have some doubts about the usage of Node Path, such as how to calculate the port through NodePath instead of concatenating strings (which can easily lead to misoperation).

      There are few examples and answers for NodePath on the forum, and it seems that people rarely use it. Do you have any insights on this, or in other words, what usage scenarios do you think NodePath is more suitable for.

      Cheers~
      DunHou

    • DunhouD

      How to compare a port value has been changed?

      Cinema 4D SDK
      • windows python 2024 • • Dunhou
      8
      0
      Votes
      8
      Posts
      975
      Views

      DunhouD

      Wow @m_adam , thanks for that, I'll check this after work!

    • DunhouD

      How does C4DAtom.GetHDirty(c4d.HDIRTYFLAGS_OBJECT_HIERARCHY) work?

      Bugs
      • windows python 2024 • • Dunhou
      4
      0
      Votes
      4
      Posts
      599
      Views

      M

      Hi just to let you know that the bug has been fixed, this will be available in one of the next releases. I will post on this topic once the fix is available.

      Cheers,
      Maxime.

    • DunhouD

      How to simulate "Cappucino" behavior?

      Cinema 4D SDK
      • windows python 2024 • • Dunhou
      5
      0
      Votes
      5
      Posts
      635
      Views

      ferdinandF

      PS: I would test this on heavy scenes with a lot of animations, to see if you get at least one data point for each frame (or whatever value you would consider acceptable).

    • DunhouD

      Can I convert a BaseBitmap into a Image file in memory?

      Cinema 4D SDK
      • windows python 2024 • • Dunhou
      3
      0
      Votes
      3
      Posts
      362
      Views

      DunhouD

      Hey @ferdinand , oops, I have an impression of this topic and tried to recall it, but I couldn't find any keywords in my mind at the time. I must have gone crazy.

      And the key is the GetData(), I have no concept of file composition and did not realize that what is returned here is the data required for an image file. Thank you very much.

      Cheers~
      DunHou

    • DunhouD

      Cinema 4D plugin market and tons of free plugins!

      General Talk
      • plugin-information chit-chat • • Dunhou
      4
      3
      Votes
      4
      Posts
      1.5k
      Views

      DunhouD

      This is current version of plugins manager and growing up plugins!
      Snipaste_2024-05-20_15-54-43.png

    • DunhouD

      UuidInterface.ToString() raise a TypeError.

      Cinema 4D SDK
      • windows python 2024 • • Dunhou
      3
      0
      Votes
      3
      Posts
      378
      Views

      DunhouD

      Wow @ferdinand!

      What a super detailed and super useful information ! Always learning great things from your super user-friendly answers for rookies like me 👏

      Memory Management is very useful to understand what happened here, I will read it again tomorrow after work, hope I can have a deeper understanding then😊

      About the Interfaces/References/Ref class name, super useful information, I always confused them and thought it was an inheritance relationship or something like that, it is much cleaner now!

      Thanks for your typing tips here, I had learn this by testing your answers and codes (In fact, most of my programming skills are learned through studying your code, and I am truly grateful to you)

      Last, thanks or your times during the meeting time!

      Cheers~
      DunHou

    • DunhouD

      How can we get the default port of a GraphNode?

      Cinema 4D SDK
      • windows python 2024 • • Dunhou
      7
      0
      Votes
      7
      Posts
      845
      Views

      DunhouD

      Hey @m_adam ,

      Can we port this DataDescriptionDatabaseInterface in python in some up-coming versions? this would be handy for some converting progress, now if I want to convert data, I have to manually writhe to node id, it is worth an automatic solution and we already have this.

      Cheers~
      DunHou

    • DunhouD

      Can we handle drag document from treeview?

      Cinema 4D SDK
      • windows python 2024 • • Dunhou
      3
      0
      Votes
      3
      Posts
      400
      Views

      DunhouD

      Hi @i_mazlov ,

      Sadly the GenerateDragData() not work in python, I had try the c4d.DRAGTYPE_FILENAME_SCENE, but it will return bad without GenerateDragData(),seems nothing we can do here.

      Cheers~
      DunHou

    • DunhouD

      How can I get the Inexclude date changed when drag or use straw?

      Cinema 4D SDK
      • windows python 2024 • • Dunhou
      3
      0
      Votes
      3
      Posts
      414
      Views

      DunhouD

      Thanks @i_mazlov ,

      The msg[c4d.BFM_ACTION_VALUE] is all I want, Thanks for that.

      Cheers~
      DunHou

    • DunhouD

      UserArea drag and drop example?

      Cinema 4D SDK
      • windows 2024 python • • Dunhou
      6
      0
      Votes
      6
      Posts
      975
      Views

      K

      I tried using a timer to solve this problem, but I still want to know if there is a more direct way

      import c4d import threading from c4d.gui import GeUserArea, GeDialog GADGET_ID_GEUSERAREA = 10000 class DropArea(GeUserArea): def __init__(self): # Used to store all objects involved in the drag-and-drop operation self.currentDragObjects = [] # Flag to indicate whether a drag operation is in progress self.isDragging = False # Define a timer to delay the handling of the drag completion self.dragTimer = None def Message(self, msg, result): # Handle drag-and-drop messages if msg.GetId() == c4d.BFM_DRAGRECEIVE: # Check if the drag was lost or canceled if msg.GetInt32(c4d.BFM_DRAG_LOST) or msg.GetInt32(c4d.BFM_DRAG_ESC): self.isDragging = False return self.SetDragDestination(c4d.MOUSE_FORBIDDEN) # If the drag just started, clear the previous object list if not self.isDragging: self.currentDragObjects = [] # Initialize the storage list self.isDragging = True # Mark the beginning of the drag # Verify if it is a valid drop area if not self.CheckDropArea(msg, True, True): return self.SetDragDestination(c4d.MOUSE_FORBIDDEN) # Get the dragged file object dragInfo = self.GetDragObject(msg) if dragInfo is not None: dragObject = dragInfo['object'] # Check if the object already exists in the list to avoid duplicates if dragObject not in self.currentDragObjects: self.currentDragObjects.append(dragObject) # Reset the timer to delay the handling of drag completion if self.dragTimer is not None: self.dragTimer.cancel() # Set a short timer (e.g., 0.2 seconds) to determine if the drag operation is complete self.dragTimer = threading.Timer(0.2, self._finalize_drag) self.dragTimer.start() # Set the mouse cursor to a valid state return self.SetDragDestination(c4d.MOUSE_MOVE) # Call the base class Message() method to handle other messages return c4d.gui.GeUserArea.Message(self, msg, result) def _finalize_drag(self): # Delayed execution to ensure all dragged objects have been received self.isDragging = False if self.currentDragObjects: # Print all dropped files print(f"Dropped files: {self.currentDragObjects}") # Additional logic can be executed here, e.g., handling file paths or other content # Clear the object list for the next drag-and-drop operation self.currentDragObjects = [] # Redraw the user area (if UI update is needed) self.Redraw() class ExampleDialog(GeDialog): geUserArea = DropArea() def CreateLayout(self): self.SetTitle("Drag Area") if self.GroupBegin(0, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, cols=1, rows=0, title="", groupflags=0, initw=100, inith=100): self.GroupBorderSpace(8, 8, 8, 8) self.GroupSpace(2, 2) # Add the user area gadget self.AddUserArea(GADGET_ID_GEUSERAREA, c4d.BFH_SCALEFIT | c4d.BFV_SCALEFIT, 200, 200) # Attach the user area to the gadget self.AttachUserArea(self.geUserArea, GADGET_ID_GEUSERAREA) self.GroupEnd() return True if __name__ == "__main__": global dlg dlg = ExampleDialog() dlg.Open(dlgtype=c4d.DLG_TYPE_ASYNC, defaultw=200, defaulth=200)
    • DunhouD

      GraphModelHelper.IsConnected(node, port) crash in 2024.

      Cinema 4D SDK
      • 2024 python windows • • Dunhou
      2
      0
      Votes
      2
      Posts
      311
      Views

      M

      Hi thanks for the report, python should never crash, so it's going to be fixed in the next release. In any case the port should be a valid a port, but an exception should be raised when None is passed.

      Cheers,
      Maxime

    • DunhouD

      Icons reuse

      Cinema 4D SDK
      • windows 2024 python • • Dunhou
      3
      0
      Votes
      3
      Posts
      470
      Views

      DunhouD

      Hi @ferdinand ,

      Thanks for your explain, I would convert the svg files to png then regist them for a temp solution, and wait the attribute valid in python.

      Thanks always for your awesome works.

      Cheers~
      DunHou

    • DunhouD

      How to use GenerateDragArray() with Node Editor?

      Cinema 4D SDK
      • windows 2024 python • • Dunhou
      6
      0
      Votes
      6
      Posts
      709
      Views

      DunhouD

      Thanks for that @ferdinand @m_adam ,

      yes, Ferdinand is right, Maxime's point is too "pro" for me, and with some maxon decorators I never used in some way mess me up, with Ferdinand's "rookie" like explain that I can understand this more, thanks for your both respected work.

      Cheers~
      DunHou

    • DunhouD

      Can I use both MouseDown() and DoubleClick() in treeview?

      Cinema 4D SDK
      • python windows 2023 • • Dunhou
      3
      0
      Votes
      3
      Posts
      426
      Views

      DunhouD

      Hi @ferdinand ,

      @ferdinand said in Can I use both MouseDown() and DoubleClick() in treeview?:

      In general, you should keep in mind that the concept of a double click is only represented very weakly in Cinema 4D, with TreeViewFunctions being one of the very few cases which uses that term. In the backbone of the API, the GUI message stream, the concept of a double click does not exist. Things are actions (BFM_ACTION_...) and inputs (BFM_INPUT_...) and each mouse click counts as an input and/or action. It is up to specific gadgets to bundle up multiple clicks into a double click.

      That helps foe better unstand how it worked, thanks!

      And this kind solution is a much more mature solution than what I used a simple one in my Octane Light Manager, I try to stop the set check event duplicate many times, I will keep more condition as your suggestion.

      e0be12a8-f277-400d-9d7a-14065e55ffee-image.png

      Thanks again for your detailed explain for all the answer.

      Cheers~
      DunHou

    • DunhouD

      Are there any official personnel from Megascans here ?

      General Talk
      • • • Dunhou
      2
      1
      Votes
      2
      Posts
      357
      Views

      M

      Hi @Dunhou, we can't disclose any information about our partner and I'm doubtful that Megascan developer are reading this forum but who know.

      Cheers,
      Maxime.

    • DunhouD

      Free plugin : HDR Link for Poly Haven

      General Talk
      • • • Dunhou
      1
      1
      Votes
      1
      Posts
      867
      Views

      No one has replied