• Read Alembic tag's data

    Cinema 4D SDK r21 2025 c++
    3
    0 Votes
    3 Posts
    596 Views
    B
    @m_adam, Thank you very much, this works for me!
  • 0 Votes
    15 Posts
    2k Views
    ferdinandF
    Hey @hSchoenberger, as I said, what we provided is mostly a workaround, we'll have to streamline things. I cannot talk much about the details, since I do not yet know myself how we will solve this. Please open new topics for new questions in the future, especially bug reports should remain clean. Our render pipeline, and that includes commissioning third party renders, converges into a singular point. There are currently four entry points into that pipeline: The built-in commands such as "Render to Picture Viewer", "Render View", "Render Region", etc. For them this pipeline has been built initially. Also headless Cinema 4D instances such as the command line or c4dpy use this mechanism when invoked for a rendering. The c4d.document.BatchRender, uses mostly the same route as (1), but the drawback compared to RenderDocument is that you must always operate with files on disk. I.e., you cannot just change a document im memory and then render it, you must first save it to disk, and also your output will provided on disk and not as bitmaps in memory. As stated before, this is the way I recommend. You should not have to apply an OCIO hacks here, we are at least not aware of any issues. The .net Renderer, a.k.a, Team Render, similar to (2) functionally, just more complicated. And other than for (2), not all third party renderers do support Team Render. RenderDocument differs from these three in that it does not take the full length of our render pipeline, but just a subsection of it. RenderDocument is used internally to render icons and preview images and was never intended to be the 'programmatic rendering interface' it unfortunately has been marketed as and is used as by many third parties. The advantage of RenderDocument is that you can easily operate in memory only without any disk activity. Whenever I was asked in the past, I always told people that using RenderDocument as a render pipeline endpoint is not such a good idea because that is not what it is designed for. Mainly because there are also other short-comings due to it not taking the full route in the render pipeline (animations for example or the render data handling). With OCIO this worsened, as we have intertwined the render pipeline, the Picture Viewer, and saving output to disk even more, i.e., things RenderDocument is naturally left out of. I simply do not know yet how we will fix this, as this is largely not my code. But for me it is clear that this must be simplified in Python. This could either happen in the form of fixing RenderDocument regrading its Picture Viewer and BaseBitmap.Save, i.e., BitmapSaver interactions, or by giving the BatchRender more RenderDocument like qualities. The solution to this will not be super simple, and it will likely not arrive within 2025. For now there is a somewhat functional workaround for RenderDocument and you can always use the BatchRender. Cheers, Ferdinand
  • Order Of Hierarchy Updates For Fieldobjects

    Cinema 4D SDK 2025 c++
    3
    0 Votes
    3 Posts
    539 Views
    J
    @ferdinand Thanks for the response. That's what I was afraid the situation would be, I believe I have a work around that will be able to fulfill what I need it to do. John Thomas
  • 0 Votes
    4 Posts
    536 Views
    ferdinandF
    Hey @vhardy, yes, @m_adam as supporting expressions on his Todo list for the VS Code bridge. But it is not very high in our priority list, you are the first user requesting it. I gave the subject a gentle nudge in our task tracking. FYI: Generally we do not make any guarantees if or when we will implement something. Cheers, Ferdinand
  • 0 Votes
    3 Posts
    566 Views
    ferdinandF
    Hey, so I talked with Fritz, I got the direction right, but there are some relevant details. When you set the flag for an importer hook, it signals that you do not want Cinema 4D to carry out the automatic scene color conversion along the conversion path implied in the settings. So, when you have a importer, and it does NOT set the flag, and you would import a scene with these settings: [image: 1740580639731-c3e3d6f8-2734-41d2-abfb-f7af807c12f8-image.png] Cinema 4D would transform all scene colors from sRGB-2.1 to the Render Space. When you DO set the flag, Cinema 4D will NOT do that, and the importer is expected to handle that. So, when you need to set this flag, this implicitly means that something with your scene data is not correct, they are not meant to be sRGB. You can of course also change the respective setting, Raw for example means as always no conversion. Without a bit more details about your scene data and its provenance, it is hard to give here good advice. Cheers, Ferdinand PS: I might update the im/exporter examples at some point to showcase the custom case, but the default should be to NOT to set the flag, and let the intended color management of Cinema 4D do its work.
  • 0 Votes
    10 Posts
    1k Views
    B
    Thank you very much for all your detailed explanation, @ferdinand!
  • 0 Votes
    2 Posts
    559 Views
    ferdinandF
    Hello @patrick_cue, 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 Please do not use other topics for your support requests, especially when they are bug tickets. Asking a follow-up questions such as "when will this be fixed" or "does this also apply to situation B" in a foreign topic is allowed and even encouraged. But a specific case with your specific code and data always warrants a new thread. Please also familiarize yourself with Support Procedures: Asking Questions, as while it its clear that you put effort into make yourself understood (thanks!), this is also bordering a bit on the too much information. The bug tracked by the other topic, is that there is currently no way in the Python API to use c4d.documents.RenderDocument in an OCIO document (i.e., every document since 2025.0) and then display that bitmap with the correct colors via c4d.bitmaps.ShowBitmap. It is important to understand that: The bitmap data generated is just fine, when you save the bitmap to disk, everything is correct. It is just that the Picture Viewer does not display it incorrectly. The reason for that is that in Python OCIO is not fully exposed in 2025.1.0 and you cannot set the OCIO profiles of the rendered bitmap there. Internally, we have been working on an OCIO port for Python allowing for color conversions and more things, including OCIO managing bitmaps. We also added a function to bake a display and view transform into an sRGB image - another route how this RenderDocument issue can be solved. The goal is to publish this with an upcoming version of the Python SDK, ideally the next, but as always we cannot make any guarantees. You cannot fix this issue yourself in 2025.1.0 and lower. Cheers, Ferdinand
  • 0 Votes
    6 Posts
    1k Views
    ferdinandF
    Hey @kbar, Thank you for reaching out to us and the heads up, much appreciated. Looks like we forgot to update the function documentation, because the change is in the change notes. I updated the docs for the upcoming release. Cheers, Ferdinand
  • C++ SDK: Custom Branching Code Example

    Cinema 4D SDK c++ 2025
    1
    3 Votes
    1 Posts
    633 Views
    No one has replied
  • 0 Votes
    2 Posts
    410 Views
    ferdinandF
    Hello @DayDreamer, 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 your first posting and you did well, but I would point you to our 'singular question' rule, as lined out above in the 'Asking Questions' link. While we usually cut user some slack regrading that, the rule exists for a reason, as topics otherwise tend to become gigantic. There are way too many questions in this topic, please split your questions into multiple topics in the future. There is no mechanism to package and ship plugins under Cinema 4D. You can just zip a plugin folder and the user unzips it then in a path where his or her Cinema 4D instance is looking for plugins. xdl64 is the extension Cinema 4D uses for libraries under Windows, i.e., it is more or less an alias for dll (our library linking is kind of special and right between static and dynamic libraries, hence the custom name). So, no, Python plugins cannot be packaged as xdl64 because Python is not compiled into machine code but interpreted at run time. You can mix C++ and Python plugins in the sense that Python plugins can depend/interact with C++ plugins with the means of the Cinema 4D API. E.g., a Python plugin can react to messages sent by a C++ plugin or data placed by a C++ plugin (or vice versa). That is how our Python API works under the hood. But C++ and Python code cannot interact directly of course, as they are vastly different languages. But you can run our Python VM from C++ and eval the results. When you want to protect your intellectual property, you can use our Cinema 4D | Extensions > Tools > Source Code Protector which will encrypt a pyp Python module. But code must of course be decrypted at runtime to be sent to the Python VM, so, this will not really stop anyone who really wants your source code (a cracker for example). C++ is the by far safer option when intellectual property is important (but also C++ can be decompiled). Cheers, Ferdinand
  • can I move objects with an external script?

    Cinema 4D SDK python 2025
    2
    0 Votes
    2 Posts
    397 Views
    i_mazlovI
    Hi @ArjenA , 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 Unfortunately we're not able to provide you with support on designing an architecture of your application, hence my answer here is very limited. Though, you're very welcome to ask more specific questions Let's call your setup with physical board game, hardware and corresponding software as "backend" and the C4D part as "frontend". Generally speaking, there's nothing preventing you from making these parts communicating with each other and it all highly depends on your project setup: programming languages, physical interfaces, frameworks, etc that you're going to use. You can start with saving your live data in a file on your disk filesystem and read it using Python API in cinema. Once you have a proof of concept you can start optimizing, for example, by implement a proper communication interface, for example, REST API or Websocket sound like good (but not the only!) candidates for this purpose. With that's said, I wish you luck with your project. Feel free to make new postings with singular and more specific questions. Cheers, Ilia
  • 0 Votes
    6 Posts
    900 Views
    kbarK
    @freeze I wrote this a few years back which might give you a good starting point. https://plugins4d.com/Product/FunRay https://github.com/kentbarber/rtow4d Cheers, Kent
  • 0 Votes
    3 Posts
    461 Views
    F
    @ferdinand Thank you for replying!
  • Python generator

    Cinema 4D SDK 2025 python
    3
    0 Votes
    3 Posts
    440 Views
    J
    @i_mazlov Thanks for your help. I using visual studio code as you suggested and am getting to grips with the Drag and Drop to assist with parameter getting and setting.
  • Help with Attribute Manager History

    Cinema 4D SDK windows python 2025
    2
    0 Votes
    2 Posts
    325 Views
    i_mazlovI
    Hi @kimberlyhtown, 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 suppose you're asking about the Attribute Manager history, which one can access by using the following arrows: [image: 1738944299742-bf4e829b-8ae1-4eae-a86b-c8dbc57c713d-image.png] Unfortunately, no. the Attribute Manager is a quite complex part of C4D (e.g. with multiple AM having each their own history), hence it is not transparently exposed to our public SDK and one's typically limited by the functionality listed in our C++ SDK the AOM part: Active Object Manager. Cheers, Ilia
  • Start IPR rendering in the viewport

    Cinema 4D SDK windows c++ 2025
    5
    0 Votes
    5 Posts
    545 Views
    F
    @ferdinand Thank you for answering ,I 'll try it.
  • 0 Votes
    4 Posts
    929 Views
    ferdinandF
    Hello everyone, we have moved this topic to a mail discussion, when there are outcomes relevant for other developers, I will post them here. Cheers, Ferdinand
  • Get the random result of Cloner Object

    Cinema 4D SDK c++ 2025 windows
    9
    2
    0 Votes
    9 Posts
    752 Views
    F
    @ferdinand Thank you very much! The problem is solved and now I know the way of MODATA_CLONE used.
  • 0 Votes
    5 Posts
    574 Views
    ferdinandF
    Good to hear!
  • 0 Votes
    6 Posts
    702 Views
    ferdinandF
    Hello @uogygiuol, Thank you for the added details. Yes, reducing the complexity of questions is the right thing to do, thank you for doing tit. Essays are counterproductive, as we then tend to overlook things (q.e.d., I overlooked the fact that you wanted to mangle the scene file in this thread). In general, trying to mangle a file beforehand is not a good route, as you always risk invalidating the file. For your very specific scenario - very simple scene graph, just geometry, no materials, animations or other dependencies - it could make sense. I briefly talked with the owner of our GLTF-importer, and we do not do any sanity checking, e.g., comparing nodes with meshes. So, you could just 'clean up' the scene graph ("nodes") of the file, and Cinema's GLTF importer will then just ignore extra data in fields such as "meshes". How fruitful this will be, you will have to find out yourself. I already had the hunch that your are here surfing on the edge of what is sensbible, and GLTF JSON files which translate to gigabytes of memory are certainly an edge case, due to the fact that text-based file formats are usually a bad choice for such heavy data. Using Python to Read JSON My guesstimate would be that when you throw a GLTF JSON file at Python's JSON parser - which takes five minutes to load in Cinema 4D - to mangle it, you end up with a net-loss or tie, because you loose most or more than the won time in that Python JSON stage. Python's json module is mostly written in C to make it performant, but that is still a lot of JSON to deserialize, modify, and then serialize. One idea could be to use re, i.e., regular expressions, to find the "nodes" section in that file, just deserialize that from JSON, modify it, serialize back to a JSON string, and write it back in place, and by that sidestep having to deserialize that whole file. The problem with all that is that json.load allows you to pass a file object, allowing you to bypass the Python VM entirely and let the data reside in C until the parsing is done, while re does not allow you to regex a file object directly (AFAIK), you always must read the file object into lines or chunks to then pass these strings to the re module. I.e., you would have to load that whole file into a Python string first. What would come here out on top, I have no clue, but my hunch is that re might loose, as Python's string handling is not the fastest. Alternatives might be 3rd party libs such as isjon (a lazy JSON loader) but I do not know how performant it is. For this section it would make a huge difference if you could predict the position of "nodes" in the file, either exactly as a chunk offset, or in the form of 'I know that it is always very close to the end, so let's regex parse the file in reverse'. Using a Binary File Format But the fact remains that text-format file types, e.g., JSON GLTF, become extemely ineffcient once you pass the ~100 MB barrier. Using something like binary GLTF or another binary format such as FBX will likely speed up your Cinema 4D loading times quite a bit, no extra steps required. And to be clear, text-based file formats are always wildely ineffcient. It is just that below the ~100 MB barrier (adjust for the beefiness of your machine), you can drown that inefficency with pure computing power and have the nice advantage of a human-readble file format. Cheers, Ferdinand