• Get All Description of Object

    Cinema 4D SDK 2023 python
    3
    1
    0 Votes
    3 Posts
    581 Views
    chuanzhenC
    @ferdinand Thanks
  • 0 Votes
    3 Posts
    965 Views
    S
    @ferdinand Thanks a lot. Very useful information. You are the best!
  • 0 Votes
    3 Posts
    868 Views
    E
    @i_mazlov Thank you very much for your help!
  • Problems with Reused Asset Resources in MGS_GETALLASSETS

    Moved Bugs python
    3
    0 Votes
    3 Posts
    1k Views
    P
    Hi @ferdinand , thanks a ton for the very extensive reply. I do understand where you are coming from decision/code wise and that it might indeed be intended behavior, but I also appreciate you flagging this behavior to be looked at! I will look into the code you provided and see what I can make of it to work for our specific case. As with all the examples i receive on here it is also about learning itself, to become better. I already found out that I can run my piece of code 2 times to catch the first set of instances, perhaps it is also possible to run that on a loop until the len() doesn't increase anymore It's a hack-job but it might be a good last resort. To address the first comment about the post itself, my reasoning was that since it was about GetAllAssetsNew which we talked about last, I added it to my post to keep it all together. But I can see how it deviated too much from the original question that started the topic, my apologies. Cheers,
  • Object Opacity Animation by Python Tag

    Cinema 4D SDK 2023 python
    5
    0 Votes
    5 Posts
    1k Views
    ymoonY
    @ferdinand Thank You for Reply
  • 0 Votes
    3 Posts
    842 Views
    J
    Thank you Ilia, Let me digest your extremely kind advice and example, learn from it, and come back tom you. Kind regards, James.
  • 0 Votes
    3 Posts
    847 Views
    S
    @i_mazlov got it! thx for answer!
  • using python Layerset - Generate Alpha option?

    Cinema 4D SDK python sdk
    5
    2
    0 Votes
    5 Posts
    941 Views
    P
    @ferdinand Thanks for the advice. i'm going to try Have a nice day today
  • 0 Votes
    4 Posts
    936 Views
    i_mazlovI
    Hi @ymoon, Thanks for reaching out to us. Glad your problem is solved! Here are some pointers to the docs with related toolset: c4d.Vector, c4d.Matrix, c4d.utils. Please note, there's Matrix Manual, although math questions are generally out of scope of the support on this forum. Cheers, Ilia
  • MessageDialog in NodeData plugin

    Cinema 4D SDK python r23 r20 2023
    2
    0 Votes
    2 Posts
    778 Views
    ferdinandF
    Hey @mikeudin, Thank you for reaching out to us. In short, there is no good answer to your question. There is no guarantee that anything will ever run on the main thread. You must always check yourself with c4d.threading.GeIsMainThread. Scene computations, e.g., ObjectData.GetContour is run in parallel off-main-thread and is therefore subject to access restriction to avoid access violations, i.e., crashes. There is no "hack" for this. The essence is that you cannot have both the benefits of sequentialism (can use shared resources) and parallelism (is fast). There are of course data structures which allow you to handle a singular resource from multiple threads, but doing this always entails lining up multiple users in a line, each waiting for users ahead in the line to be done, i.e., hidden sequentialism. In Python this might be hard to grasp because Python itself mostly ignores the concept of parallelism and we only experience here the side effects of the parallelism of the underlying C++ Cinema 4D API. There is also the problem that your request does not make too much sense for me on a practical level. Imagine having a plugin MySpline which opens an error dialog once its GetContour method strays from the right path. A user now edits one hundred instances of MySpline at once and triggers the error. Cinema 4D sometimes executes passes two or three times in a row to resolve dependency problems. This would then mean that you would open three hundred error dialogs for one user interaction (if that would be technically possible in the first place). In general, no node should open any form of dialogs on its own. Opening a dialog after a button press in the description of a node via NodeData.Message is okay. When you are hell-bent on doing this, you could do this: Add a field to your plugin, e.g., self._error: str = "". When you are in your GetContour and an error happens, instead of raising it, simply write it to _error. Implement any NodeData method which often runs on the main thread. NodeData.Message is a good candidate. On each execution of it, check if _error has content and if you are on the main thread. If so, display the message and then null _error. You will still need some kind of throttling so that the user is not spammed with the same error over and over again. I.e., you need an "only-new-errors" mechanism. It is up to you to implement that. An alternative approach could go via core messages. But that is also non-ideal because setting off a c4d.SpecialEventAdd will work from a non main thread but will cause the global core message lock to engage, which is of course a bad thing to happen and exactly the "no-hack" problem I described under (4). You could also try using c4d.StatusSetText and the other status functions. While not officially supported, they will work from non-main-thread environments. But there is no guarantee and we do not officially support this. Cheers, Ferdinand
  • Sliders in Python plugin

    Cinema 4D SDK sdk python 2023
    5
    0 Votes
    5 Posts
    1k Views
    ferdinandF
    Hello @filipst, Without further questions or updates we will consider this topic as solved by Friday the 11th, and flag it accordingly. Cheers, Maxon SDK Group
  • How to use external libraries inside of a plugin

    Cinema 4D SDK python
    4
    0 Votes
    4 Posts
    954 Views
    G
    Thankyou! Noted!
  • Use the tab name and open the that window?

    Cinema 4D SDK python
    3
    1
    0 Votes
    3 Posts
    982 Views
    ymoonY
    @ferdinand There is no command to invoke the viewport window, so I was looking for an alternative. I will tagging the version in the next post. (R2023) Thank You.
  • abc exported object names

    Moved Bugs r25 python
    3
    2
    1 Votes
    3 Posts
    1k Views
    S
    super, thanks
  • 0 Votes
    3 Posts
    745 Views
    K
    hi @i_mazlov , I understand that it is not supported, so I will use Scene Nodes to generate the spline this time. No other questions, thank you very much.
  • Reading unicode from file Python

    Moved General Talk python
    3
    0 Votes
    3 Posts
    1k Views
    A
    Thanks, I guess.. For anyone else coming across this issue, to decode in python you need to ensure that you're using the correct encoding when reading the CSV file. Even if the CSV file is already encoded to what you are expecting. To make it work for us we did the below: with open(CSV, encoding='utf-8') as csv_file: Rather than with open(CSV) as csv_file:
  • 0 Votes
    5 Posts
    1k Views
    D
    @ferdinand Thanks for your comprehensive explanation. I really appreciate that. Cheers
  • 0 Votes
    4 Posts
    932 Views
    J
    Hello @Thodos , without further questions or postings, we will consider this topic as solved by Friday, the 11th of august 2023 and flag it accordingly. Thank you for your understanding, Maxon SDK Group
  • How to apply new fixed FieldList securely

    Cinema 4D SDK r23 python 2023
    5
    0 Votes
    5 Posts
    1k Views
    J
    Hello @mikeudin , without further questions or postings, we will consider this topic as solved by Friday, the 11th of august 2023 and flag it accordingly. Thank you for your understanding, Maxon SDK Group
  • How to: Plugin parent folder on extensions menu

    Cinema 4D SDK python
    5
    1
    0 Votes
    5 Posts
    2k Views
    J
    Hello @cybor09 , without further questions or postings, we will consider this topic as solved by Friday, the 11th of august 2023 and flag it accordingly. Thank you for your understanding, Maxon SDK Group