• How to Use GetConnectionValue/s() or GetConnection()?

    2023 python
    11
    0 Votes
    11 Posts
    2k Views
    indexofrefractionI
    @ferdinand first of all, I understand your frustration, we just yesterday talked about the state of the Nodes API and are well aware of its hurdles for anything but super-experts. you can say that aloud! the whole system is very hard to understand. the only thing i got is all we know about traditional materials and even shaders is for the bin. node support evolved over time and most node examples do not work for people still using older c4d versions. also there are misc 3rd-party renderers that use different kinds of nodes / node systems. Drag & drop of attributes to the console doesn't work anymore, as well. the days of easy scripting are gone..
  • Multilingual - Plugin not working

    python
    4
    3
    0 Votes
    4 Posts
    719 Views
    J
    Hi Ferdinand! Perfect! We got it, thank you so much for the quick reply.
  • Best way to detect an object has been deleted?

    python 2023
    5
    0 Votes
    5 Posts
    1k Views
    P
    Thanks again for the great explanation. I guess I will go for a different workflow then.
  • Insert my own command in main render Tab

    python 2023
    7
    0 Votes
    7 Posts
    2k Views
    P
    I really do appreciate all your effort and I will take your warning seriously and create my own menu Tab. Thanks again. Regards, Pim
  • Traversing a layer shader with python

    python 2023
    5
    0 Votes
    5 Posts
    2k Views
    P
    @ferdinand : The GetAllAssetsNew is a far more elegant solution for the problem I am trying to solve and I've rewritten the code so that it works now. We use Corona render and Redshift so it's a bonus that this works with pretty much all materials. Thank you very much for the help, I will put your information about the layer shader in my database for future reference as I'm sure it will become helpful in another project! Kind regards, Joep
  • Setting texture path to a RS Domelight with python

    r25 python
    2
    0 Votes
    2 Posts
    1k Views
    ferdinandF
    Hello @Ryan_Territory, 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 This exact question of yours has been asked before here for C++. Find a Python variant of the code below. For the technical details, I would recommend reading the older thread. Cheers, Ferdinand Result: [image: 1685984571549-557e9ddd-793a-4d07-aa6e-5ffd7ad05687-image.png] Code: import c4d # Define #Orslight, only must be done in pre 2023.0 API versions. c4d.Orslight: int = 1036751 def main(): doc = c4d.documents.GetActiveDocument() # Create Light light = c4d.BaseObject(c4d.Orslight) # Set the attributes light[c4d.REDSHIFT_LIGHT_TYPE] = c4d.REDSHIFT_LIGHT_TYPE_DOME # Define the texture parameter ID. texturePathId: c4d.DescID = c4d.DescID( # 1st DescLevel for the outer unexposed datatype of "Texture". c4d.DescLevel( c4d.REDSHIFT_LIGHT_DOME_TEX0, # The parameter ID (12000) for "Texture" 1036765, # The datatype ID for for "Texture", this type is not exposed, # we must use the raw ID. c4d.Orslight # The creator ID, Orslight in this case. ), # 2nd DescLevel for the inner exposed datatype of "Texture.Path". c4d.DescLevel( c4d.REDSHIFT_FILE_PATH, # The sub-channel parameter ID (1000) for "Texture.Path" c4d.DTYPE_STRING, # The data type ID of this component, string in this case. 0 # The creator ID, I just went with undefined here. )) light[texturePathId] = "asset:///file_c622e9ad3ea0e159" # Insert the light into the scene doc.InsertObject(light) c4d.EventAdd() if __name__=='__main__': main()
  • Move objects in the hierarchy

    python
    2
    1
    0 Votes
    2 Posts
    669 Views
    KantroninK
    I found the solution on https://plugincafe.maxon.net/ It was enough in the for loop to add the following line of code: for object in list_object: if object != object_root: object.InsertUnder(object_root) c4d.EventAdd()
  • xRef file path is broken if created via python

    python 2023
    3
    0 Votes
    3 Posts
    694 Views
    B
    Sorry for not making my post as clear as it should have been, next time I will do better The good thing is, I fixed it! The problem was how I loaded my initial master project. # instead of using c4d.documents.LoadDocument() # i replaced it with c4d.documents.LoadFile() ... and now my xRef works just fine! Thank you again!
  • Extending the Command Line with Python

    python r21
    10
    0 Votes
    10 Posts
    3k Views
    moghurtM
    @jwzegelaar said in Extending the Command Line with Python: We found a good workaround! We now made a custom commandline plugin where we can add our own arguments. And it works great. If anybody in the future has this issue you can always contact us and we will help. Thanks again everybody for all the help! Hi jwzegelaar, I believe that I share the same needs as you, where I also need to pass in external parameters via a .py file to make modifications to the file before rendering. Unfortunately, I am encountering the same issue as you. Although this post has been quite some time, I am still hopeful for your assistance. Your help would be greatly appreciated and it is highly important to me.
  • Other methods for material[c4d.ID_MATERIALASSIGNMENTS]?

    python 2023
    7
    0 Votes
    7 Posts
    1k Views
    B
    @ferdinand Gotcha. Thanks. Will close this thread now.
  • CRITICAL: Stop when calling SetWorldPluginData

    python 2023
    5
    0 Votes
    5 Posts
    1k Views
    a_blockA
    Thanks for the offer. much appreciated. But your explanations were good and plenty as usual. I think, I know exactly what is going on.
  • Limit the destination of UserArea.HandleMouseDrag()

    2023 python
    4
    0 Votes
    4 Posts
    803 Views
    K
    Hi @m_adam, Sorry for the delay in responding. Yes, the problem has been resolved.
  • Can I convert several PYP files to one PYPV file?

    2023
    9
    0 Votes
    9 Posts
    2k Views
    B
    Closing the thread with the following conclusion. No native way to do it in C4D. Manually have to merge them then convert that one file to PYP. So have to manage separate project files. One for source ones and one for merging several PY files.
  • FindNodesByName Not Working As Expected

    2023 python
    10
    0 Votes
    10 Posts
    2k Views
    B
    @m_adam slr. can confirm the FindNodesByName now works as expected on the illustration code I used previously. Thanks
  • how to close c4dpy inside a script?

    python
    3
    0 Votes
    3 Posts
    734 Views
    M
    Hello @JACK0319, without further questions or postings, we will consider this topic as solved by Monday 05/06/2023 and flag it accordingly. Thank you for your understanding, Maxime.
  • Instance Object Link is not working

    python
    3
    1
    0 Votes
    3 Posts
    769 Views
    M
    Hello @aghiad322, without further questions or postings, we will consider this topic as solved by Monday 05/06/2023 and flag it accordingly. Thank you for your understanding, Maxime.
  • 0 Votes
    4 Posts
    672 Views
    M
    Hello @HerrMay, without further questions or postings, we will consider this topic as solved by Monday 05/06/2023 and flag it accordingly. Thank you for your understanding, Maxime.
  • Is it possible to build a TreeView from a user database?

    sdk c++
    3
    0 Votes
    3 Posts
    477 Views
    M
    Hello @jpheneger, without further questions or postings, we will consider this topic as solved by Monday 05/06/2023 and flag it accordingly. Thank you for your understanding, Maxime.
  • Fieldlist HasContent() GetCount() bug workaround

    python r23
    3
    0 Votes
    3 Posts
    674 Views
    M
    Hello @mikeudin, without further questions or postings, we will consider this topic as solved by Monday 05/06/2023 and flag it accordingly. Thank you for your understanding, Maxime.
  • Register to object change

    sdk c++
    5
    0 Votes
    5 Posts
    1k Views
    ferdinandF
    Hey @CJtheTiger, sorry for my radio silence here and thank you for updating the thread. In short: you drew all the right conclusions for the general case. A MessageData solution can be quite performant when you know exactly what you are doing and when you must monitor either every object (in the sense of geometry) in the scene graph or at least many of them. For something like monitoring materials, shaders, or tags, the solution is mandatory anyways. The tag solution on the other hand can become a bottle neck when the information flow becomes too expensive. Imagine such dependency propagation tag called DataTag, and you have 1000's of them in a scene. Each tag not only informs then one but multiple other nodes about changes of its host. Due to that there is also overlap, i.e., both DataTag DA and DataTag DB inform a target object T about changes of their host objects HA and HB. But for T this might be the "same" event and it then might be doing work twice. So, when stuff is getting complicated, you. are often better off with a MessageData solution, as you can consolidate things there. Cheers, Ferdinand