• Set value of a fieldlayer parameter

    Cinema 4D SDK windows python 2023
    3
    1
    0 Votes
    3 Posts
    556 Views
    D
    hi @ferdinand, this solved it, thanks! I suspected, that I would have to write back the data, as in many other cases. but I didn't know how exactly. As for the executable code: will do so, next time! cheers Sebastian
  • Prevent material preview update

    Cinema 4D SDK windows python 2023
    3
    0 Votes
    3 Posts
    820 Views
    D
    hi @ferdinand, thanks for the information. found a workaround, that is good enough so far. I use the 3d-gradient in texture space and transform the texture tag matrix as I need it. the change in color will not occur that often.
  • 0 Votes
    4 Posts
    1k Views
    ferdinandF
    @datamilch said in Calling BaseDocument.SetMode twice in a row leads to freezes: always had the feeling, that i could print feedback while it is running That is a misconception many users have. This is because most code usually runs very fast, so you do not realize it. Note that I also wrote Script Manager script. While it technically applies to all Python Scripting scene elements, the execution of the Python VM is there always blocking, it is much more prominent for a Script Manager script. Because there the module is only executed once and it is also okay to run scripts here which take seconds to execute. But it also applies for example to a Python Programming tag, the execution of the module is there also blocking. But because the module of a Python Programming tag is called many times - on each scene update at least once, and you are anyway in a world of hurt when your Python Programming tag module takes more than ~100 ms to run, it is not that obvious there. Syntax errors are evaluated before the VM actually runs because then the compilation of your code into byte code fails (which is then later interpreted by the VM). But the error is here also displayed only after the VM stopped (just as a RuntimeError which is raised by the VM and not by the compiler), but syntax errors prevent the VM from running your code in the first place. Cheers, Ferdinand import time def main() -> None: """Run as a Python Script Manager script to see that the execution of a scope in the Python VM is blocking. This will not print five 'A's with a stride of one second, but five 'A's after five seconds. """ for _ in range(5): print('A') time. Sleep(1) if __name__ == '__main__': main()
  • How to use GetAllNimbusRefs in 2023

    Cinema 4D SDK 2023 c++ windows
    5
    0 Votes
    5 Posts
    953 Views
    kbarK
    Thanks @ferdinand! Appreciate everything you do. Also what the rest of the sdk support and docs team are doing! Not an easy job keeping on top of all these changes.
  • 0 Votes
    3 Posts
    530 Views
    D
    @i_mazlov thanks ilia!!! ok that was truly obvious actually had to use 'c4d.documents.GetActiveDocument()' to make it work in my case ...
  • 0 Votes
    4 Posts
    823 Views
    S
    @i_mazlov I tried the GetRad() method. This is exactly what I need, thanks!
  • 0 Votes
    2 Posts
    1k Views
    ferdinandF
    Hello @ghparadise, 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 procedures. You did not do anything wrong, we point all new users to these rules. Forum Overview: Provides a broad overview of the fundamental structure and rules of this forum, such as the purpose of the different sub-forums or the fact that we will ban users who engage in hate speech or harassment. Support Procedures: Provides a more in detail overview of how we provide technical support for APIs here. This topic will tell you how to ask good questions and limits of our technical support. Forum Features: Provides an overview of the technical features of this forum, such as Markdown markup or file uploads. It is strongly recommended to read the first two topics carefully, especially the section Support Procedures: Asking Questions. About your First Questions It depends a bit on what you meant with 'the documentation of Python Redshift'. Classic API The old redshift module Python API never has been official and was therefore integrated into the Python documentation. This old redshift module targeted the GraphView, i.e., Xpresso node material of Redshift. Technically you did not need that API, as you could retrieve the 'node' branch of a Redshift material, and the rest is then more lest just standard c4d.modules.graphview code. Except for us helping users from time to time here on the forum, there are no SDK code examples for this API. Nodes API But your screenshot concerns a node material for the Node Editor, i.e., the 'new' node system. There is no dedicated API for Redshift (required) here, and instead you just use the general purpose Nodes API. The technical documentation can be found here. The Nodes API encompasses the graph, nodes, and nodespace frameworks. Here you can find our Nodes API Python examples, including material nodes and Redshift examples. Where can I find the document of these string parameter just like "com.redshift3d.redshift4c4d.nodes.core.texturesampler". You cannot, the Redshift attributes are currently not exposed both in the C++ and Python API. What you can do however, is use the Node Editor. Press CTRL + E to open the preferences, and activate the option IDs under Node Editor. [image: 1706612092842-4bd6db15-8efc-4a60-bb79-2529de10efba-image.png] When you now select a node, you see its Asset ID (the ID used to instantiate the node) and its ID (the ID used to reference this specific node in the graph): [image: 1706612198107-178ce2f0-967a-4697-b629-9efb0e7fd3a0-image.png] When you select a port, you will also see its ID. [image: 1706612228918-399bb9d2-7e7a-4dcb-8288-1bebb3f58a5d-image.png] Where can I find the document of these method just like "FindChild","AddChild","GetInputs" and so on. They are part of the Nodes API. These function names are a bit ambiguous as the appear on multiple types. You are likely talking about GraphModelInterface, which is the interface representing a graph, and GraphNode which represents entities in a graph such as nodes and ports. Cheers, Ferdinand
  • 0 Votes
    5 Posts
    1k Views
    B
    Hi @ferdinand Apologies for the late response. RE: You should show me how you access that key. My bad. But it's on the previous thread you answered by manually selecting a keyframe and storign it in a variable. https://developers.maxon.net/forum/topic/15344/get-selected-keyframes/3 RE: I just showed you above how to operate with percentage values in Cinema 4D. My bad. I missed it. I was looking immediately at the declaration. keyA: c4d.CKey keyB: c4d.CKey which I only want one key to be declared. === In summary, the GetNext() and GetPred() solved the problem in getting the Neighboring Keys from a Selected Key.
  • 0 Votes
    6 Posts
    2k Views
    T
    ok. I know not your department, but thats nuts. Thanks!
  • Setting the name of a maxon.GraphNode via Python

    Cinema 4D SDK 2023 python
    3
    0 Votes
    3 Posts
    602 Views
    PoliigonP
    Hey Maxime, thanks for the quick answer. Actually I thought, I had tried SetValue() with that ID. But either I did something wrong or I tried something else... anyway, thanks. Just checked: Yes, I did something wrong. I stupidly just passed a string instead of a maxon.String. With the latter it works, not that I doubted your proposal. Maybe would be good, if SetValue() could throw an error, if a wrong type gets passed instead of just doing nothing. Also thanks for the pointer to Dunhou's project, I was already aware. Nice project! And indeed I peeked into it regarding some Arnold peculiarities... Cheers, Andreas
  • Get Selected Keyframes?

    Cinema 4D SDK 2023 2024 python
    6
    0 Votes
    6 Posts
    1k Views
    ferdinandF
    Hey @bentraje, yes, we are aware that internal and private tags are something that plagues our documentation as they often have been abused by developers to skip documentation. But that is not so easy to fix. I for example did and still do not know the purpose NBIT_TLX_SELECT2 either. I was just experienced enough with the C4D API to poke in this place first. Physically fixing the docs, i.e., adding a blab here or there, is not the problem. The problem is to evaluate if the private tag in C++ (which then radiates into Python) is well founded or not, especially for ancient things like this. I would have to read a lot of code to make an assessment if this should be private or not, and even then would not be sure. And even an 'Expresses the selection state of f-curve keys. @markprivate' is problematic because for that I would have to be sure that it does not have a weird side effect. Cheers, Ferdinand
  • 0 Votes
    3 Posts
    2k Views
    ThomasBT
    @ferdinand Hello Ferdinand, Thank you very much first of all. yes, you're right, I worked extremely sloppily with the SMC method, of course I'll take the threading into account and also work with a Temp Document. Regarding the problem itself, I can only say that reinstalling CINEMA 4D solved our problem. Cheers
  • 0 Votes
    8 Posts
    2k Views
    F
    Hi @i_mazlov , Thank you for confirming my solution. Best regards, Tomasz
  • trigger script when viewport camera is moved

    Cinema 4D SDK python 2023
    3
    0 Votes
    3 Posts
    656 Views
    T
    @i_mazlov thanks so much! some super useful insights here. I think I will have eventually to move to C++
  • 0 Votes
    6 Posts
    1k Views
    ferdinandF
    Hey @ThomasB, That has nothing to do with the highlighting but with the fact that Maxime used incorrect links. developers.maxon.net/docs/ links will only work from outside of the forum. Inside the forum you currently have to use dvelopers.maxon.net/assets/docs/ as otherwise nodebb is trying to take over the routing. I am working on fixing that issue. I have fixed both links of Maxime. Cheers, Ferdinand
  • 0 Votes
    3 Posts
    757 Views
    D
    Hi Maxime, thank you very much for your answer! I wasn't sure if storing things in the global document BaseContainer was a good approach, but it's working well. Cheers, Daniel
  • The cloner is calculated before the Python tag

    Cinema 4D SDK 2023 python
    2
    0 Votes
    2 Posts
    530 Views
    i_mazlovI
    Hi @ll2pakll , Please excuse the delay, your topic somehow slipped from my list. I can only speculate here, as you haven't attached a sample scene that highlights your issue. The way you describe the problem it looks like a priority issue of the python tag. Please have a look at how the priority works in our documentation: https://help.maxon.net/c4d/2023/en-us/Default.htm#html/TPYTHON-OBASELIST.html#EXPRESSION_PRIORITY Also note that it's forbidden to call c4d.EventAdd() (or in reality is just skipped) from the python tag due to multithreading restrictions (c4d.EventAdd() is executed on main thread whilst python tag is executed in a parallel thread): [image: 1704368550401-9ddbfeab-53dd-49e1-8ded-0a6c3dddba94-image.png] Cheers, Ilia
  • Get All Nodes inside an Xpresso Tag?

    Cinema 4D SDK 2023 python
    3
    0 Votes
    3 Posts
    739 Views
    M
    Hi yes, GvNode are BaseList2D and GeListNode, like material, object, tags. There is the same discussion going on, so you may find it interesting Issue collecting all the shaders in a material. Cheers, Maxime.
  • Arrange All Nodes Command/API in Xpresso?

    Cinema 4D SDK 2023 python
    3
    0 Votes
    3 Posts
    645 Views
    B
    Thanks for the confirmation. I guess I'll just let the users do some reordering the nodes themselves. lol The nodes are creating procedurally so the nodes are just stacked on top of each other. haha
  • 0 Votes
    5 Posts
    1k Views
    B
    Awesome, Thank you so much @m_adam ! Cheers and best regards Ben