• 0 Votes
    3 Posts
    720 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
    725 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
    823 Views
    P
    @ferdinand Thanks for the advice. i'm going to try Have a nice day today
  • 0 Votes
    4 Posts
    759 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
    668 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
    830 Views
    G
    Thankyou! Noted!
  • Use the tab name and open the that window?

    Cinema 4D SDK python
    3
    1
    0 Votes
    3 Posts
    851 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
    935 Views
    S
    super, thanks
  • 0 Votes
    3 Posts
    617 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
    878 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
    823 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
    1k 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
  • 8 Votes
    23 Posts
    24k Views
    DunhouD
    Hi community! Add Basic CentiLeo Material support, also with ConvertPorts data, This a "new" GPU Renderer and in active development. I am very interested in it. Not add AOV due to still being in the early stages of development, waiting for this. Cheers~ DunHou
  • Retrieve GvNodeMaster from Xpresso Editor/Manager

    Cinema 4D SDK python 2023
    3
    0 Votes
    3 Posts
    652 Views
    T
    Hello @ferdinand ! Thank you for such a fast reply! Looks like c4d.modules.graphview.GetMaster(0) does the trick, I was confused at first about "id" in the arguments, but looks like 0 really gives the current active GvNodeMaster! Cheers, Max.
  • Not working FieldLists Keyframes and Tracks

    Cinema 4D SDK python r23
    3
    1
    0 Votes
    3 Posts
    596 Views
    mikeudinM
    @ferdinand Thank you! That was TranslateDescID issue!
  • 0 Votes
    5 Posts
    946 Views
    J
    Hello @GillesKontrol , 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
  • Message system isn't working in python effector

    Cinema 4D SDK python
    4
    1
    0 Votes
    4 Posts
    795 Views
    ferdinandF
    Hello @aghiad322, I have closed this thread as it has been answered. The task has been added to our internal task pool. However, since this is not a bug but a feature limitation, I have not marked this thread as to_fix as there is nothing to fix here. This does not mean that we will not do it, I have added the task for now to the task pool of a close by release. But we treat feature requests differently than bugs, and the task might therefore be postponed/pushed when we run out of time in that release. Cheers, Ferdinand