• Automatically execute python scripte

    Cinema 4D SDK python 2024 windows
    2
    0 Votes
    2 Posts
    354 Views
    M
    Hi @serco, there is multiple way to execute a script automatically when Cinema 4D is opened. Use python_init.py, this force you to add your script into the temp folder. Bu it can be done for a particular instance of a Cinema 4D or it can also be applied to all Cinema 4D versions that use a given python version. Implement a Plugin and react to PluginMessage various event are sent to Python, and you can hook into them to execute your code. This require to have a Python plugin loaded by Cinema 4D. Depending of your needs there is c4dpy which act as a Python Interpreter, where you can pass directly your Python file as an argument. Then again depending of your need you may be able to start what you want to do next. Cheers, Maxime.
  • 0 Votes
    5 Posts
    939 Views
    gheyretG
    I get it, thanks for your reply and keeping the idea. If there are any workarounds or alternative solutions in the meantime, please let me know. I look forward to any updates regarding this feature in the future. Cheers~
  • Gear Settings Icon Workflow

    Cinema 4D SDK python
    3
    0 Votes
    3 Posts
    566 Views
    M
    Hi @BretBays Happy Christmas ! Thanks for getting back, and indeed PLUGINFLAG_COMMAND_OPTION_DIALOG is the way to go. Find an example in CommandData with Options Dialog - Docked command button Cheers, Maxime.
  • 0 Votes
    4 Posts
    540 Views
    M
    Thanks a lot for reporting this kind of issue ! This is going to be fixed in the next update of the doc. Cheers, Maxime.
  • Change posemorph's name

    Moved Bugs python 2024 2023
    2
    2
    0 Votes
    2 Posts
    814 Views
    M
    Hi thanks for the question, I've opened a bug report, for the moment the only workaround would be to remove the Morph and re-add it. For the moment the name in the treeview is only updated when manually edited from the treeview and on the insertion of the item in the tree view. Cheers, Maxime.
  • Get and Set any parameter with Tag

    Cinema 4D SDK 2023 2024 2025 python
    3
    0 Votes
    3 Posts
    682 Views
    gheyretG
    Hi @i_mazlov I can't use C++ at the moment, so I thought I'd try MultilineEditText for my purposes. I looked for This post in the forum and now I have some ideas. Thank you for your reply! Cheers~
  • 0 Votes
    3 Posts
    1k Views
    gheyretG
    Thank you for your reply and solution! Cheers~
  • 2025.1.0 SDK Release

    News & Information news cinema 4d c++ python sdk
    1
    1 Votes
    1 Posts
    7k Views
    No one has replied
  • GraphModelInterface.GetNode not worked

    Cinema 4D SDK python windows 2025
    3
    0 Votes
    3 Posts
    593 Views
    DunhouD
    Hi @m_adam , Thanks for your reply, it worked well. But I still have some doubts about the usage of Node Path, such as how to calculate the port through NodePath instead of concatenating strings (which can easily lead to misoperation). There are few examples and answers for NodePath on the forum, and it seems that people rarely use it. Do you have any insights on this, or in other words, what usage scenarios do you think NodePath is more suitable for. Cheers~ DunHou
  • 0 Votes
    3 Posts
    705 Views
    i_mazlovI
    Hi @chuanzhen, Glad you've solved the issue! We're grateful to you for sharing your solution with the community (moreover in such a visual way), this is highly appreciated! Cheers, Ilia
  • Realtime Slider Update

    Cinema 4D SDK python
    3
    0 Votes
    3 Posts
    568 Views
    i_mazlovI
    Hi @shurkan, 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 Great that you've managed to find the solution yourself! Thank you in advance for sharing it with the community! Just a short note about your solution is to be careful with threading, namely, in your case it's expected to execute DrawViewes in the following way: c4d.DrawViews(c4d.DRAWFLAGS_ONLY_ACTIVE_VIEW | c4d.DRAWFLAGS_NO_THREAD | c4d.DRAWFLAGS_STATICBREAK) Something similar to this topic here: Troubleshooting Safe Frame Calculations Across Different Takes in Cinema 4D Cheers, Ilia
  • Data, DataTypes, Python and GUI

    Cinema 4D SDK c++ python
    7
    0 Votes
    7 Posts
    1k Views
    E
    Ok thanks for the help Ferdinand. I will take the road of least resistance and just build on top of float64 vectors
  • 0 Votes
    2 Posts
    606 Views
    i_mazlovI
    Hi @heytraile, Please have a look at our Support Procedures: How to Ask Question section. Usually it is very helpful if one provides a relevant code snippet, demonstrating the issue. This helps to reduce the room for any misinterpretations of your original question. Regarding the issue you're describing, the "null" being logged to the console is often a symptom of an implementation issue within a function that overrides the base implementation. Specifically, if a function (such as Message() or RestoreLayout()) is expected to return a particular type (e.g., bool), but instead returns None or a mismatched type, it can result in unexpected behavior and the "null" log. Cheers, Ilia
  • Python - How to insert knots in c4d.Gradient

    Cinema 4D SDK python
    3
    0 Votes
    3 Posts
    599 Views
    V
    Thank you very much, @i_mazlov! This is what I needed!
  • Python - Set Take render state

    Cinema 4D SDK python
    4
    1
    0 Votes
    4 Posts
    757 Views
    J
    @ferdinand Okay I will do it in the future. Thanks for the code snippet, always helps to learn!
  • Syntax highlight in VS Code under MacOS

    Cinema 4D SDK python macos
    4
    0 Votes
    4 Posts
    1k Views
    ferdinandF
    I would heavily recommend using the extension, as it will automatically curate the paths for you. I.e., when you use the extension and connect to a Cinema 4D instance, it will make sure that the dummy modules of that Cinema 4D version are on the search paths. But when you really do not want to use it, you can also just edit your config so that the dummy module paths are discoverable for auto complete and the linter. [image: 1731583351292-2a76cd6c-35aa-451f-82db-02b03694e72d-image.png] What you will need in any case, is the Python and Pylance extension for VS Code, as they are the extensions which make use of these settings. When you install the connector, they will be installed automatically as a dependency. [image: 1731583415824-0b5d77af-5f23-4203-9a0a-276b8eafc62e-image.png] Cheers, Ferdinand
  • How to set the active documents preview image

    Cinema 4D SDK windows python
    2
    0 Votes
    2 Posts
    479 Views
    ferdinandF
    Hey @MMayrh, Thank you for reaching out to us. This is not how this parameter works. The parameter DOCUMENT_PREVIEW_IMAGE is of data type BitmapButtonStruct, not of BaseBitmap. [image: 1731082043337-54c636b2-05c8-4e3a-af41-9edf7e80bd24-image.png] The documentation is a bit misleading here. This is not the document preview bitmap, but sort of the preview bitmap delegate. I.e., an entity that is used to retrieve a preview bitmap (for a document in this case). A BitmapButtonStruct wraps a node, an ID, and a dirty flag. [image: 1731082143508-3e4681a7-7db6-45b7-a1da-5279cc028cf2-image.png] This parameter does not make too much sense in the Python API, here is what the C++ API does when the parameter is access for a document: [image: 1731082401202-459e7ff6-a8fe-4abf-ae35-adc803c17170-image.png] I.e., it returns itself (the doc), the ID of the parameter (DOCUMENT_PREVIEW_IMAGE) and the dirty state of its internal current preview bitmap as the BitmapButtonStruct bbs. What you could technically try, is implement a node, e.g., an object, and then set that object as the preview provider for a document. Your node would for that have to implement MSG_DESCRIPTION_GETBITMAP, because that is what effectively will be called. But that is all very theoretical, DOCUMENT_PREVIEW_IMAGE is largely unused in our code base, and I do not see any implemnation for the SetParameter part. So, the document will likely just ignore you trying to overwrite its preview provider. There could be some base implemenation kicking in, but I doubt it. But what you definitely cannot do, is just set there a bitmap to overwrite the preview image of the document (assuming that was what you wanted to do). That would also not make too much sense since a document is constantly recalculating its preview image. So, on the next update that image would be gone (if it would work like that). Cheers, Ferdinand
  • Python reading fields issue

    Moved Bugs python 2023 2024
    4
    2
    0 Votes
    4 Posts
    1k Views
    ferdinandF
    Yes, we will treat it as a bug. Apparently we implemented it, but then someone disabled the implementation (probably because it caused performance issues or something like that), and then we forgot do follow up on that disabled implementation. Generally we cannot give ETA's for fixes but we try to do them in a timely fashion, i.e., within a couple of minor releases such as 2024.1, 2024.2, 2024.3, etc. I am not the dev here, so I can give even less guarantees. We will update this thread when something blocks us from fixing this in the near future. And yes, it does work in C++. The reason why this is not working in Python is because of the C++ API changes with 2024.0. This link shows how you sample things in C++, the changes revolved around making sampling a field a const operation, i.e., an operation which does not change data on the object. Which was before not the case and now requires that mutable data to be manually passed arround as the extraData as shown in the example. The changes were carried out to speed up the core of Cinema 4D. Cheers, Ferdinand
  • Mesh Cleanup - script or plugin for C4D?

    Moved General Talk python 2024
    2
    1
    0 Votes
    2 Posts
    908 Views
    M
    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. Therefor I moved your topic to the General Talk which is the place to make request to the community. While Cinema 4D SDK board is purely about development questions. 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 There is no such plugins (at least that I'm aware) in Cinema 4D, however you may be able to find issue in your mesh via the Mesh Checking features available in the Mode of the Attribute Manager. [image: 1731077134354-1d38a2e5-3304-415b-803b-bf6859b55c34-image.png] I let the community answers regarding your request in case a developer have done a plugins that may fit your needs. Cheers, Maxime.
  • TempUVHandle always None! Why?

    Cinema 4D SDK r21 python windows
    3
    0 Votes
    3 Posts
    845 Views
    ThomasBT
    @i_mazlov Thank you very much for the hint with the texture view and for the helpful links. The second thread I have already read, but was not able to find the solution so far. I study these examples. Thank you.