• Check if a texture is missing

    Cinema 4D SDK python 2024 macos
    2
    0 Votes
    2 Posts
    623 Views
    ferdinandF
    Hello @visualride, Thank you for reaching out to us. I would recommend having a look at c4d.documents.GetAllAssetsNew . Helpful might also be the thread Get all Textures for a Material. It is one of the multiple threads where I showcased the usage of GetAllAssetsNew (search for GetAllAssetsNew and my user name to find the other threads). In this thread you can see here how to read the exists field in asset data to know if Cinema 4D can find that asset. But asset handling can get complex when node materials are involved as shown here (also a good place to better understand the data associated with MSG_GETALLASSETS). The thread shows also a simpler approach using BaseDocument.GetAllTextures. You can then just check with os.exists if the paths do exist. You might have to deal with relative paths here, depending on the document. Cheers, Ferdinand
  • 0 Votes
    10 Posts
    2k Views
    fwilleke80F
    Very informative, thank you Ferdinand!
  • 0 Votes
    3 Posts
    663 Views
    B
    In the past I have refrained from CallCommands and CallButtons because they used to add to the undo queue or did. But I suppose in this instance I can just do it for thise purpose.
  • Custom Build C4D.2024.py310 ?

    Cinema 4D SDK 2024 python
    7
    0 Votes
    7 Posts
    2k Views
    gheyretG
    Hi @Unit-Image-Dev Thank you for your reply. That's so cool! and i will try it.
  • 0 Votes
    6 Posts
    2k Views
    H
    Hi Ferdinand, Yeah, I'll need to do dirty checking for sure. Not because I am shipping this to any customers (unless I can find a good licensing framework ), but because the nature of my plugin is to create quite a few objects; We could easily reach 100s or even 1000s of objects, depending on the situation. So I implemented primitive dirty checking from one of the links you provided, and this helps a LOT with the performance - as you're mentioning, just ignoring the cache and recreating everything every time GetVirtualObjects is called would effectively kill Cinema 4D. Especially when fiddling with parameters, as the algorithm to layout all the objects I am creating is quite intensive. So I'm using your code from this topic https://developers.maxon.net/forum/topic/14936/difficulties-to-dedect-the-right-message-data/2 to make sure I do proper dirty checking for my own generator and all linked objects before I decide to return the cache or generate all objects again. I'm not done yet, but early tests seem pretty promosing. Now if only there was a simple way to split the large python file into multiple files, then bundle them all together for one giant python file so I wouldn't have to mess with module paths. 1000 line code files get old real fast. Thanks again!
  • 0 Votes
    4 Posts
    850 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
  • 0 Votes
    9 Posts
    2k Views
    S
    Hi Bjorn, I have a working version of this now which you can download from my site at https://microbion.co.uk/files/rounditr2024.zip It's PC-only at the moment and requires C4D R2024. Try this and see if it does what you need. There's some basic documentation included which I'll tidy up for the final version. There doesn't seem to be a DM facility here so we'd better take any further discussion to email. You can get hold of through the contact page on my site (link is in the PDF in the zip file). Do let me know what you think. Cheers, Steve
  • How to get a Vertex Map to trigger animated object?

    Cinema 4D SDK 2024
    2
    0 Votes
    2 Posts
    440 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
  • 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
  • 0 Votes
    5 Posts
    800 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
  • 0 Votes
    2 Posts
    489 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
  • "maxon::GenericData &extraData" is not documented

    Cinema 4D SDK 2024
    2
    1
    0 Votes
    2 Posts
    494 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);
  • Python module load order in 2024

    Cinema 4D SDK 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.
  • Import NumPy?

    Cinema 4D SDK python 2024
    4
    0 Votes
    4 Posts
    931 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
  • 2024 c4d python doc link error

    Cinema 4D SDK python 2024
    4
    1
    1 Votes
    4 Posts
    727 Views
    chuanzhenC
    @ferdinand Great job!
  • 0 Votes
    5 Posts
    1k Views
    ThomasBT
    @ferdinand This is a command, and you can c4d.CallCommand it, but that is all the control you have. thank you Ferdiand,
  • New Child Render settings with python

    Cinema 4D SDK 2024 python
    6
    0 Votes
    6 Posts
    1k Views
    M
    Thank you @ferdinand, I'll need to work out how I implement but once again a thorough and considered reply....
  • c4d 2024 "MENURESOURCE_SEPERATOR"

    Cinema 4D SDK 2024 python
    5
    2
    0 Votes
    5 Posts
    846 Views
    chuanzhenC
    @ferdinand Thanks,hope to fix spelling in c4dpython doc in future versions
  • Can't debug C4D 2023 and 2024 on macOS

    Cinema 4D SDK 2023 2024 c++ macos
    11
    1
    0 Votes
    11 Posts
    2k Views
    fwilleke80F
    @ferdinand said in Can't debug C4D 2023 and 2024 on macOS: first, thank you very much for investing more time into this and with that saving time for me, truly appreciated. You're welcome. If any of this get any of us further it's worth the time. @ferdinand said in Can't debug C4D 2023 and 2024 on macOS: But let us discuss the details per mail. Okay! Cheers, Frank
  • Gradient Interpolation Error in 2024 release

    Cinema 4D SDK python 2024
    3
    0 Votes
    3 Posts
    621 Views
    D
    @m_adam Brilliant! Thanks a lot!