• using c4d.threading with (python) thinking particles

    General Talk python
    7
    0 Votes
    7 Posts
    2k Views
    ferdinandF
    Hello @jenandesign, Thank you for reaching out to us, I appreciate sharing your customer journey with us. I cannot make any further statements on the ongoing development of Cinema 4D, but we are of course happy to hear that you see value and potential in Cinema 4D. I will make sure that your input does reach the simulation Team. Cheers, Ferdinand
  • Need help fixing export to GLTF script

    General Talk
    3
    0 Votes
    3 Posts
    940 Views
    i_mazlovI
    Hello @joel_motion, Welcome to the Plugin Café forum and the Cinema 4D development community, it is great to have you with us! Getting Started Before creating your next postings, we would recommend making yourself accustomed with our Forum and Support Guidelines, as they line out details about the Maxon SDK Group support procedures. Of special importance are: Support Procedures: Scope of Support: Lines out the things we will do and what we will not do. Support Procedures: Confidential Data: Most questions should be accompanied by code but code cannot always be shared publicly. This section explains how to share code confidentially with Maxon. Forum Structure and Features: Lines out how the forum works. Structure of a Question: Lines out how to ask a good technical question. It is not mandatory to follow this exactly, but you should follow the idea of keeping things short and mentioning your primary question in a clear manner. About your First Question Support for redshift materials on gltf export first appeared with the 2023.2 release. That version also included numerous gltf exporter stability improvements. Please note, that debugging the code is out of scope in this forum. You are very welcome to ask specific questions with well-defined scope. In general your code seems reasonable. The approach with cloning objects onto a new document is the one I would suggest anyways. However, one should be careful with the dependencies that objects in the subtree might loose during cloning. AliasTrans helps to overcome such side effects to some extent. Cheers, Ilia
  • 0 Votes
    3 Posts
    867 Views
    ferdinandF
    Hello @HerzogVonWiesel, Thank you for reaching out to us. Using the message system could be possible here but seems a bit overkill. Since you own both implementations, it would be best if you simply tie together the dialog instances you want to exchange information between. E.g.: import c4d class ConnectedDialog(c4d.gui.GeDialog): """Realizes a dialog type which has a binding to another dialog instance. Note that all methods in this example are not part of the GeDialog interface scheme, i.e., "custom" methods. """ def __init__(self) -> None: """ """ # The list of dialogs this dialog instance does exchange information with. self._connectedDialogs: list[ConnectedDialog] = [] super().__init__() def Bind(self, other: "ConnectedDialog", twoWay: bool = True) -> None: """Binds the dialog #other to #self and makes the connection optionally two-way. Also ensures that bindings are unique, i.e, two dialogs cannot be bound more than once in one direction. """ if not isinstance(other, ConnectedDialog): raise TypeError(f"{other = }") if other not in self._connectedDialogs: self._connectedDialogs.append(other) if twoWay and self not in other._connectedDialogs: other._connectedDialogs.append(self) def SpecialMessage(self, sender: "ConnectedDialog", *args) -> None: """Receives message stream from all connected dialogs. """ print (args) def Action(self, value: any, condition: any) -> None: """Exemplifies a method which informs all other dialog instances about an event. """ if condition: for dlg in self._connectedDialogs: dlg.SpecialMessage(self, value, condition) if __name__ == "__main__": # Instantiate five dialogs and creating bindings between all of them. dialogCollection: tuple[ConnectedDialog] = (ConnectedDialog() for _ in range(5)) for a in dialogCollection: for b in dialogCollection: a.Bind(b) You could do three million and one thing differently here; this is just an example to illustrate a pattern. The crucial information might be here for you (since we just talked about threading and dialogs before) that: The methods both of modal and async dialogs run on the main thread. Async in an async dialog are only the drawing routines which you do not have access to, even when you implement a dialog with a custom GeUserArea. That area only enqueues drawing instructions into a buffer and does not do the actual drawing. So, there is no danger of access violations, which Python of course does not know in the first place due to its GIL. When tying dialogs together is not possible then you can use the message system of Cinema 4D. But tying objects together is always possible in Python even when the objects live in two modules which do not have access to each other. You can either use sockets (a bit overkill) or be lazy and just setup shop in a commonly accessible object, e.g., the sys module. When you go for messages, I would recommend having a look at the Message Manual first as I gave there a rough overview. In short: GeDialog.Message is for UI messages and just like its NodeData.Message counter part instance specific. It is not meant to establish a binding between two dialog instances but to let Cinema 4D or elements in a UI tree communicate with the dialog ("button to dialog: I have been pressed"). What you can do, is set off a core event with c4d.SpecialEventAddd to then catch that core message in all other dialogs using GeDialog.CoreMessage. Note that the Python API does filter message streams, and unlike in C++, you cannot just "invent" a new message type, except for using c4d.SpecialEventAdd. But there you are limited to sending three integers in Python (in C++ the p1 and p2 arguments are meant to be pointers to arbitrary data). Cheers, Ferdinand PS: Yeah using the CPython API you can cast/wrap things (in order to use p1 and p2 actually in the manner they are intended to) but be aware that any C magic is not officially supported by us.
  • 0 Votes
    3 Posts
    708 Views
    E
    @ferdinand Thank you very much for your help, your code has been extremely useful to me. Cheers!
  • Sampling a point in space from a userdata Field List

    Cinema 4D SDK python
    7
    0 Votes
    7 Posts
    1k Views
    ferdinandF
    Hey @jenandesign, you can edit your postings, just click on the three dots button below a posting of yours. You will not be able to move a post like I can, but except for that have the same options as I do: [image: 1692289705372-46c3d9dd-ed4c-4fe4-a683-684eb5553f80-image-resized.png] Cheers, Ferdinand
  • Handling Treeview File Drag and Drop Events

    Cinema 4D SDK python c++ 2023
    3
    1 Votes
    3 Posts
    799 Views
    ferdinandF
    Hey @Dunhou, yeah, I already saw and fixed that in the course of answering this. Cheers, Ferdinand
  • 0 Votes
    3 Posts
    961 Views
    HerzogVonWieselH
    Thank you again @ferdinand ! Sad that resizing windows is not a possibility. Would've been nice to have the options pop up once you toggle the extra options on! Now I've implemented them as a modal dialogue so you can choose them and close it again. Thank you for your help!
  • Python plugin encryption

    Cinema 4D SDK python 2023 sdk
    3
    0 Votes
    3 Posts
    711 Views
    F
    Thank you very much!
  • Free plugin : HDR Link for Poly Haven

    General Talk
    1
    1
    1 Votes
    1 Posts
    1k Views
    No one has replied
  • 0 Votes
    3 Posts
    800 Views
    ThomasBT
    @ferdinand Many thanks for this detailed example, I'll try it out P.S. Oh my gosh, it's working perfectly. I decided to go the easiest way, just to check the dirtyness of the linked object. linkDirty: bool = link.IsDirty(c4d.DIRTYFLAGS_DATA) Many many thanks Thomas
  • Free plugins all in one : Boghma HUB

    General Talk
    4
    2
    3 Votes
    4 Posts
    2k Views
    S
    Thank you so much. I wand trouble shooting this for a week with Paid ChatGtp (stupidGpt) it couldn’t get it right. It works !!! Thank you.
  • 0 Votes
    9 Posts
    1k Views
    chuanzhenC
    @ferdinand The code works very well
  • hud depth buffer?

    Cinema 4D SDK r19 2023 python
    6
    1
    0 Votes
    6 Posts
    1k Views
    ymoonY
    Added one more for... zip to remove the invisible points.
  • Plugin Tag printing randomly to the console

    Moved Bugs python
    4
    1
    0 Votes
    4 Posts
    993 Views
    ferdinandF
    Hey @aghiad322, Great to hear that you solved your problem. And although I understand how you meant your last sentence, the questions of users are never inconvenient to us. All questions are welcome, but sometimes we must draw some boundaries for the scope of support. Cheers, Ferdinand
  • DescID() python doc issue

    Cinema 4D SDK python 2023
    3
    2
    0 Votes
    3 Posts
    422 Views
    chuanzhenC
    @i_mazlov Thanks
  • Get All Description of Object

    Cinema 4D SDK 2023 python
    3
    1
    0 Votes
    3 Posts
    555 Views
    chuanzhenC
    @ferdinand Thanks
  • 0 Votes
    3 Posts
    819 Views
    S
    @ferdinand Thanks a lot. Very useful information. You are the best!
  • 0 Votes
    3 Posts
    777 Views
    E
    @i_mazlov Thank you very much for your help!
  • Problems with Reused Asset Resources in MGS_GETALLASSETS

    Moved Bugs python
    3
    0 Votes
    3 Posts
    1k Views
    P
    Hi @ferdinand , thanks a ton for the very extensive reply. I do understand where you are coming from decision/code wise and that it might indeed be intended behavior, but I also appreciate you flagging this behavior to be looked at! I will look into the code you provided and see what I can make of it to work for our specific case. As with all the examples i receive on here it is also about learning itself, to become better. I already found out that I can run my piece of code 2 times to catch the first set of instances, perhaps it is also possible to run that on a loop until the len() doesn't increase anymore It's a hack-job but it might be a good last resort. To address the first comment about the post itself, my reasoning was that since it was about GetAllAssetsNew which we talked about last, I added it to my post to keep it all together. But I can see how it deviated too much from the original question that started the topic, my apologies. Cheers,
  • Object Opacity Animation by Python Tag

    Cinema 4D SDK 2023 python
    5
    0 Votes
    5 Posts
    1k Views
    ymoonY
    @ferdinand Thank You for Reply