• Is InitRender called once for each frame of a render?

    Cinema 4D SDK c++ 2024
    3
    0 Votes
    3 Posts
    666 Views
    R
    Thank you very much, Ferdinand. I understand.
  • 0 Votes
    4 Posts
    812 Views
    H
    @i_mazlov Thanks much for explanation.
  • 0 Votes
    2 Posts
    342 Views
    ferdinandF
    Hey @rui_mac, thank you for reaching out to us. In general only shaders which are volume shaders have access to the object for which they are being called for. In Python (or in COFFEE) you cannot implement volume shaders and therefore cannot access the object which is being rendered. When you are implementing a volume shader in C++, you can do this (untested pseudo code): cinema::Vector MyShader::Output(cinema::BaseShader* shader, cinema::ChannelData* cd){ // Get the volume data from the channel data. cinema::VolumeData* const vd = cd ? cd->vd : nullptr; if (!vd) return COLOR_RENDER_ERROR; // Get the ray objects. for (cinema::Int32 i; i < vd->GetObjCount(); i++) { const cinema::RayObject* const ro = vd->GetObj(i); if (!obj) continue; // Attempt to find the object this ray object has been constructed for. const cinema::BaseObject* const op = ro._texture_link ? ro._texture_link : ro._link; if (!op) return COLOR_RENDER_ERROR; // Do stuff with the object ... } return COLOR_RENDER_ERROR; } Cheers, Ferdinand
  • Python Script/Plugin Request to symmetrize UV spaces

    Moved General Talk 2024
    3
    0 Votes
    3 Posts
    766 Views
    M
    Hello @Hohlucha, Welcome to the Maxon developers forum and its 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 Question This is a development forum and your question does not seem to be development related. Please read our forum guidelines lined out above. I have moved this topic into General Talk for now. When this is indeed an end user question we must ask you to use our Support Center, the developer forum is not the right place for end user questions. When this is a development question, then please line out the current code you have and provide a meaningful problem description. Cheers, Maxime
  • 0 Votes
    5 Posts
    841 Views
    R
    Thanks Ferdinand and that does seem very plausible given that I am very new to type hinting in my code, and I have actually caught myself swapping the colon for the equals sign already. Learning from you guys every day though! I'm off to break some more sh!t! Thanks so much for your time, will let you know when I get stuck...
  • 0 Votes
    3 Posts
    589 Views
    D
    @i_mazlov Thanks! makes sens. seems i only used the forgiving commands until now. the code is run in a python generator. so by returning the object, it will be inserted into the scene.
  • use thicken generator inside a python generator

    Moved Bugs windows 2024 python
    4
    1
    0 Votes
    4 Posts
    1k Views
    D
    hi @i_mazlov, ok, good to know. i also tried to insert the thicken generator into a temp_doc, activating the selections and executing passes. but that didn't work either.
  • Use buttons in tags. Rope tag.

    Cinema 4D SDK windows python 2024
    3
    1
    0 Votes
    3 Posts
    599 Views
    S
    @i_mazlov Thank you for your reply. That was very helpful!
  • 0 Votes
    5 Posts
    924 Views
    ferdinandF
    Good to hear that you found your solution!
  • 0 Votes
    7 Posts
    1k Views
    justintaylor-devJ
    @ferdinand Great thanks!
  • 0 Votes
    4 Posts
    1k 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.
  • 0 Votes
    4 Posts
    758 Views
    C
    Thank you for this write up, I started writing something similar, but this is a huge help understanding how to get and set the data for BaseLink. I'll need to add FieldList and InExcludeData as you mentioned, knowing the getting and adding the new object is a little more involved than just setting the property id directly. I'll reach out here again if I have any followups.
  • Visual Selector and Script

    Cinema 4D SDK python 2024
    2
    0 Votes
    2 Posts
    463 Views
    i_mazlovI
    Hi @Pitchi, Welcome to the Maxon developers forum and its 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 Question I'm struggling to understand what exactly you're trying to achieve, namely what do you mean by saying "a way to switch to anyone blocks"? Do you want it to be selected in the attribute manager, or framed in the viewport, or something else? Please also note, that according to our Support Procedures: We cannot provide support on learning C++, Python, or one of their popular third-party libraries We provide code examples but we do not provide full solutions or design applications. This technically means that here we provide support on public APIs of Maxon products and development support for third party developers, but we cannot write solutions instead of you. For the end-user support requests, please use our Support Center. In case you're looking for someone to create a working solution for you, please use our General Talk forum category instead. Cheers, Ilia
  • 0 Votes
    3 Posts
    484 Views
    O
    @i_mazlov This is very useful as it helps avoid manually inputting hard-coded index values! Thank you, and have a great day!
  • Retrieving a shader from a LayerShaderLayer

    Cinema 4D SDK windows c++ 2024
    12
    0 Votes
    12 Posts
    2k Views
    S
    Hi Ferdinand, That’s great, really very helpful, thank you. I’m glad my code was right in principle even if it didn’t work! I would never have guessed the layer returned a void pointer. That should now work perfectly and do exactly what I need. Thanks again for taking the time to look into this, very much appreciated. Cheers, Steve
  • 0 Votes
    3 Posts
    621 Views
    O
    @i_mazlov Thank you
  • 0 Votes
    6 Posts
    2k Views
    i_mazlovI
    Hi @qq475519905, You issue is likely a bug in the material export code, I've created a ticket (ITEM#530704) in our internal bug tracking system. Thank you for reporting the issue! Cheers, Ilia
  • How to Undo Switching Between Modes?

    Cinema 4D SDK windows 2024 python
    10
    0 Votes
    10 Posts
    2k Views
    B
    @ferdinand said in How to Undo Switching Between Modes?: Well, just move the code which switches the mode to the end of your code when it is only cosmetic anyways. As I said above, a sensible way to use SetMode is when you want to leave the user in a state where he or she can continue working right away. But you can then just run all your code, check if everything went fine and then set your code. Otherwise you never set the mode, and therefore also have nothing to revert. It's a matter of workflow. It's not simply for checking the code that it's working properly. It's about a workflow. The workflow in the example is Select some mesh components, run the command. It generates something for you and switches the mode for you. If you selected the wrong components, you'd undo and try it again. But the undo won't put you back in the component mode. The issue is that that part of the command is not undoable so it's does hinder the workflow just a bit. I'm not necessarily advocating that it should be undoable or anything like that, just explaining the reasoning in this example and the value if it were undoable.
  • How to simulate "Cappucino" behavior?

    Cinema 4D SDK windows python 2024
    5
    0 Votes
    5 Posts
    918 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).
  • How to SetKeyframeSelection for Subfield

    Cinema 4D SDK 2024 python
    5
    1
    0 Votes
    5 Posts
    826 Views
    F
    Thanks again.@i_mazlov I haven't studied C++ yet, but I'm glad to know that it's achievable with C++.