The Maxon SDK Team is currently short staffed due to the winter holidays. No forum support is being provided between 15/12/2025 and 5/1/2026. For details see Maxon SDK 2025 Winter Holidays.
  • Time Shift. Python tag.

    windows python 2023
    3
    0 Votes
    3 Posts
    623 Views
    L
    @ferdinand Thank you very much for your reply. I only need to animate one parameter and I have already written something similar to this parameter cache myself, you saw it in a previous question and advised me to change the location of the cache for more reliability. I will take your advice in the future to avoid reinventing the wheel. Thanks again for your help.
  • Python tag doesn't work when rendering

    windows 2023 python
    6
    0 Votes
    6 Posts
    1k Views
    L
    @ferdinand Your solution of replacing the doc = c4d.documents.GetActiveDocument() line with doc: c4d.documents.BaseDocument = op.GetDocument() really worked. From my point of view, as an ordinary person, your level of understanding of the code seems to be something beyond the realm of possibility. I wish you a good day and thank you again for your help.
  • Saving Documents

    python 2023
    3
    0 Votes
    3 Posts
    558 Views
    A
    Hi Ilia, Thanks for the reply - you're correct about what I'm trying to do! I've tried your first option and unfortunately the following dialog pops up: "Unable to write file $FILE$ (file may be write protected)" This dialog does not appear if the file is saved manually with the File -> Save Project As... Dialog The save location is a network drive. Let me know if theres a workaround? For your second option - is it possible to specify the exact filename here? EDIT: It looks like you can also specify a filename here, which has worked - thanks !
  • node size

    python windows 2023
    4
    0 Votes
    4 Posts
    869 Views
    L
    Thank you for the answers.
  • Import NumPy?

    python 2024
    4
    0 Votes
    4 Posts
    970 Views
    G
    Hi, I'm also trying to install numpy, but after registering c4dpy I'm getting a syntax error after running "c4dpy -m ensurepip" command. c4dpy -m ensurepip (null) File "<stdin>", line 1 c4dpy -m ensurepip ^^^^^^^^^ (null)SyntaxError: invalid syntax
  • 0 Votes
    4 Posts
    863 Views
    i_mazlovI
    Hi @AiMiDi , The problem you're pointing out to lies in the algorithmic field and relates to a non-public part of C4D, hence is Out of Scope for this forum: We will neither reveal non-public functionalities of Cinema 4D's API, nor will we establish a direct line of communication with the developers of Cinema 4D. Let me know if you have any further questions! Cheers, Ilia
  • Python module load order in 2024

    windows 2024
    9
    0 Votes
    9 Posts
    1k Views
    I
    Thank you again, it worked. I just had to take into account that the python310.win64.framework directory is now named just win64 in Cinema 4D 2024. And I had to add the path to ai.dll too, because our Arnold translator had the same problem, the C4DtoA module no longer loads ai.dll on startup.
  • 0 Votes
    4 Posts
    891 Views
    ferdinandF
    Hey @jochemdk, That is the nature of threading restrictions. It is like crossing the street without looking left and right: It works fine until it doesn't Cheers, Ferdinand
  • Why doesn't c4d.Vector.GetAngle throw an error for the null vector?

    python s26
    2
    0 Votes
    2 Posts
    542 Views
    ferdinandF
    Hello Herr May, Thank you for reaching out to us. I am not quite sure why you think it should do that. The angle between two vectors u and v is defined as: theta(u, v) = arccosine(~u * ~v) I.e., the arccosine of the dot product of the two normalized vectors. This is due to the so called circle functions, specifically this identity: [image: 1697012566409-26ea0c5e-9de3-4885-bc15-34b4ee3342da-image.png] Under the hood, GetAngle does exactly what I declared above (just in a bit more efficient manner, as calculating the normalized vector is much more expensive than this little trick): [image: 1697012429446-123bbf8a-568b-49a5-9ff3-2bac41f61339-image.png] As you can see, the correct solution to the arccosine of the dot product of the null vector with itself is 0.5 π, i.e., the value you got : [image: 1697012846516-ebfd4607-e872-42ef-898c-d3a2de4d8dd8-image.png] You could now argue if that is a sensible result for a method that is called 'GetAngle' and if it should throw an error on getting an input vector or being called on a vector with the length zero. But you have also to keep in mind that the C++ backend is used by people who will know the identity pi_half = arccosine(~(0, 0, 0) * ~(0, 0, 0)) and might want to make use of it. Cheers, Ferdinand
  • How to Obtain the .FBX Points of Objects in C++

    s26 c++ macos windows
    3
    4
    0 Votes
    3 Posts
    610 Views
    P
    @ferdinand Thank you for your reply
  • Simulating mouse movement in C4D

    python r25 windows
    5
    0 Votes
    5 Posts
    3k Views
    D
    Hi @ferdinand, Thank you so much for the comprehensive reply! Given all this I don't think it would make sense to keep trying to unit test this particular part of our code with Python. The last approach you highlighted with testing directly on the C++ side seems like the best option, so I'll give that a try. I'll have to see how to integrate this test with the rest of the unit tests (we have a lot and they're all in Python) but hopefully that won't be too much of a problem. Thanks again for all the help, Daniel
  • Command Make Editable confusion

    s26 windows python
    4
    0 Votes
    4 Posts
    782 Views
    G
    Got it! Thanks.
  • How to get a Vertex Map to trigger animated object?

    2024
    2
    0 Votes
    2 Posts
    466 Views
    J
    Hello @spektor04 , 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 Please provide us testscript(s) and a testfile which would help us to reproduce the issue. Thanks and Cheers Jana
  • BaseSelect::Free() in 2024 - Access violation reading location

    2024
    8
    0 Votes
    8 Posts
    1k Views
    ferdinandF
    Hey @yaya, okay, and your your plugin hook is ObjectData, right? Your plugin is the 'RagDoll' entity, in your screen grab? It is really hard to get here anywhere without code, but here are a few guesses: Are you 'abusing' your ObjectData hook by modifying the scene it is contained in? ObjectData is bound to the threading restrictions in most of its methods, because most run not on the main thread. This is more relevant than ever with 2024, because more methods have been parallelized. You can modify the scene from an ObjectData plugin, but you must be on the main thread to do it, by for example defer execution to the MT or use a method like Message which often runs on the MT (but I would still avoid doing it when possible). Modyfing the scene means for example inserting, objects, materials, shaders, etc. or adding events. Modifying your cache to your likeing in getVirtualObjects is of course okay. This could also be a nasty side effect of the new data access system. But these two are of course fairly speculative since I almost know nothing about your plugin. And you said, when I understand you correctly, that you already this problem in the past, and then somehow fixed it by illegally freeing the selection of the object. I would recommend doing the following things: Reduce the complexity of your example scene, that thing is way too complex. Make it as simple as possible by removing as many things as possible with the problem still happening. Run Make Editable and Current State to Object separately on instances of your faulty plugin output. Analyze the content of the caches to see what is actually happening in the places "where things go wrong". Either you are somehow missing full objects in your cache or skip some data, etc. Just do normal debugging then: Set a breakpoint on GetVirtualObjects in your plugin and step through the code, trying to figure out when you "loose" parts. Avoid skipping 'boring' parts as you easily miss the problem then. Other than that, I will have to see code, because otherwise there is no magic wand move with which I could guess what is going wrong here for you. Cheers, Ferdinand
  • Adding ports to nodes.

    2023 python windows
    3
    0 Votes
    3 Posts
    682 Views
    L
    @ferdinand said in Adding ports to nodes.: DescID Thank you so much. I am pleasantly surprised at the level of your responsiveness. When I wrote "Global Data" I accidentally used the wrong word, I meant "Global Coordinates". I have read your links and code very carefully. Actually the concept of DescID is not so much complicated as confusing, the easiest thing would be to have something like an interactive online converter that could show the attributes of the desired objects and their corresponding id. I will try to understand the concept of DescID, deeper. And thank you again for your very detailed answer. Have a nice day.
  • subprocess not running in background

    python 2023 macos
    4
    0 Votes
    4 Posts
    865 Views
    B
    MAny thanks Ferdinand. I will look into the BatchRender suggestion. That looks promising.
  • 0 Votes
    5 Posts
    817 Views
    gheyretG
    @ferdinand Indeed, the allure of good looks can be captivating at times. In fact, my primary objective was to explore the development of a pie toolbar, which may seem unconventional but has always held a deep fascination for me. I sincerely appreciate your valuable advice and will certainly give it a try. Cheers, Gheyret
  • Reading skeleton data from Character Definition tag

    2024 python
    2
    0 Votes
    2 Posts
    512 Views
    i_mazlovI
    Hello @Gregor-M , 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 What you're trying to achieve is supposed to be happening on the main thread. It's difficult to guess the reasons of the crash you're stumbling across without any further information (e.g. the code showcasing the issue), but could be that MTCharacterBodyPart.GetParameters() function is not a thread-safe one. Cheers, Ilia
  • ModuleNotFoundError, but the file is in the same folder

    windows python s26
    3
    0 Votes
    3 Posts
    561 Views
    G
    I see, thanks. But honestly i don't get it why the plugins folder isn't in the search path...
  • "maxon::GenericData &extraData" is not documented

    2024
    2
    1
    0 Votes
    2 Posts
    506 Views
    ferdinandF
    Hey @kbar, Thank you for reaching out to us and pointing out the missing documentation. I will fix that. In the mean time I would recommend having a look at the Gradient and Field Sampling example in the migration guide, as I did explain the principal changes there. In short, extraData is the means with which sampling has been made const. Before, sampling did change the field instance, now the to be mutated data has been separated out into that 'extra data', and you get your extraData when initializing the sampling. In the example I covered Sample, but things translate directly to DirectSample. Cheers, Ferdinand Code from the migration guide: iferr_scope; // #field is a #FieldObject sampled by the #BaseObject #effector. See the full example for details. // The input location we want to sample and the output data. We are only interested in sampling // FIELDSAMPLE_FLAG::VALUE, i.e., the field influence value of the field at point x. FieldInput inputs(Vector(0, 50, 0)); FieldOutput outputs; outputs.Resize(inputs.GetCount(), FIELDSAMPLE_FLAG::VALUE) iferr_return; FieldOutputBlock outputBlock = outputs.GetBlock(); // Create the field info for sampling the sample data #inputs for the caller #effector. const FieldInfo info = FieldInfo::Create(effector, inputs, FIELDSAMPLE_FLAG::VALUE) iferr_return; // Sample the field. In 2024.0 we now must pass on the extra data generated by the sampling // initialization so that #field can remain const for this operation. maxon::GenericData extraData = field->InitSampling(info) iferr_return; field->Sample(inputs, outputBlock, info, extraData, FIELDOBJECTSAMPLE_FLAG::NONE) iferr_return; // Iterate over the output values. for (const maxon::Float value : outputBlock._value) ApplicationOutput("Sampled value: @", value); field->FreeSampling(info, extraData);