• ScrollGroupBegin() is not work in GeUserArea()

    Cinema 4D SDK python s24
    7
    0 Votes
    7 Posts
    1k Views
    gheyretG
    @ferdinand I will handle it. Thanks for your help! Cheers~
  • Enabling Team Render in Render Queue

    Cinema 4D SDK s24 python
    4
    1
    0 Votes
    4 Posts
    1k Views
    CairynC
    (Yes, I notice that the thread has been closed, and marked as solved, and I probably shouldn't barge in, but it seems the original script error has never been addressed, so I must mansplain because that's the obnoxious guy I am.) Two points: The error in the script above is that the index used in SetUseNet is wrong. The indices in the BatchRender element list begin at 0, so the first valid index is 0, and the last is GetElementCount()-1. dBatchCount starts as GetElementCount(), which is fine as counter, but as an index, it is the first unused index. Then this counter is increased += 1, so now it is the second unused index after the list. When AddFile is called with that index, it simply adds the file as last element because it cannot leave empty gaps in the list. It returns True although it didn't use the desired index - it used index-1. Now SetUseNet is called with the same index. The reason it fails is that this index is not the index that AddFile actually used. This index is not even valid. There is no element with that index. So, nothing happens. If you use dBatchCount-1 as index at this point, or simply never increase dBatchCount in the first place, the script works fine. The actual API error is that SetUseNet does not raise an IndexError as the docs claim. (Other methods like GetElementStatus do.) Okay, I go annoy someone else now.
  • Creating "Objects" on Python tag

    Cinema 4D SDK python
    3
    0 Votes
    3 Posts
    747 Views
    orestiskonO
    @m_adam That clears it up, thanks Maxime!
  • 0 Votes
    7 Posts
    895 Views
    ThomasBT
    @m_magalhaes yes thanks that was my idea, too , I created a temporary object, in my case a spline with 0 points and 0 segments and simply exchanged it, thanks.....
  • 0 Votes
    5 Posts
    597 Views
    chuanzhenC
    @m_adam Thanks
  • Overriding arrow keys in the Object Manager?

    Cinema 4D SDK r23 python
    9
    0 Votes
    9 Posts
    2k Views
    ManuelM
    @cairyn said in Overriding arrow keys in the Object Manager?: I guess they didn't make the cut at all...) Good guess, there's no particular reason for not being there.
  • 0 Votes
    3 Posts
    1k Views
    J
    @m_magalhaes This worked great, thank you.
  • Faster way of converting dict of Vector3 to Vector4

    Cinema 4D SDK python
    3
    0 Votes
    3 Posts
    842 Views
    orestiskonO
    @m_adam Thanks a lot for the benchmarking Maxime. I was planning to go for the string method, I'm surprised it's not faster. I wasn't planning to use this for a plugin, not to mention C++, but it's good information to have.
  • Trigger Autosave

    Cinema 4D SDK python
    3
    0 Votes
    3 Posts
    589 Views
    H
    Hi Ferdinand, No worries! Thanks for the reply, it was very helpful as a starting point. I ended up using the c4d.GetWorldContainerInstance() and then c4d.WPREF_AUTOSAVE_DEST_PATH to get the custom filepath and then just a SaveDocument with the AUTOSAVE flag seems to be doing the trick. thanks again!
  • 0 Votes
    2 Posts
    639 Views
    ferdinandF
    Hello @thomasb, thank you for reaching out to us. Please remember to open a new thread for new questions of yours. It is fine to ask follow-up questions in a topic, but when the threshold to a new topic is being crossed, a new thread should be opened. I have done this for you here. In principle this is at least partially possible. You can determine the visibility for a user data description element with the description field DESC_HIDE, see example at the end of the posting for details. It is not possible to gray-out, i.e., disable, user data description elements. It is also a bit a case of an unusual workflow for user data, since you would have to rebuild the user data container every time you want to hide or show and element in it. You could overwrite for example message() in a Python scripting tag and then react to when a user clicks a button, drags a slider, etc. in the user data and rebuild the user data based on that. Which would give you the dynamic GUI feeling you are probably after. I have done this in the past, but more as a hack for fun to see how far I can push user data. I would not recommend doing it as it will complicate things like animation and can lead to "janky" interfaces. Being bound to the execution order of expressions can also lead to problems. If you want dynamic GUIs, you should implement a plugin. There you can overwrite NodeData.GetDDescription() to modify the description, e.g., add, remove, or hide stuff. To disable stuff, i.e., gray it out, you must overwrite NodeData.GetDEnabling(). Cheers, Ferdinand """Example for adding a hidden user data element. """ import c4d def main(): """Adds a hidden check box and a visible integer element to the user data of the selected object. """ if op is None: raise ArgumentError("Please select an object for running this script.") datenDesc = c4d.GetCustomDataTypeDefault(c4d.DTYPE_BOOL) datenDesc[c4d.DESC_NAME] = "Daten" datenDesc[c4d.DESC_HIDE] = True # Element will be hidden stepsDesc = c4d.GetCustomDataTypeDefault(c4d.DTYPE_LONG) stepsDesc[c4d.DESC_NAME] = "steps" stepsDesc[c4d.DESC_HIDE] = False # Element will be visible op.AddUserData(datenDesc) op.AddUserData(stepsDesc) c4d.EventAdd() if __name__ == '__main__': main()
  • 0 Votes
    8 Posts
    2k Views
    ManuelM
    Hi, I'm happy that you solved your issue. For your next post, and i know you can see that as a waste of time, please follow our guidelines. Use the functionalities of the forum to mark your thread as a question, and mark it as solved when it's done. (Even for a negative answer). Please use also tags, that help us to understand and answer faster without guessing. Language you are using (python, c++) cinema4D version, everything that can help us to understand your issue. You will also find on those guidelines how to explain your issue. Sometimes people want a solution for an issue creating by a bad workflow. In your case, it looks more like sharing information between plugins. There are several answers/possibilities for that. This forum is also about stepping back, having a fresh eye on your issue and move forward Cheers, Manuel
  • What's really happening inside a CKey?

    Cinema 4D SDK c++ python r23
    10
    0 Votes
    10 Posts
    2k Views
    CairynC
    DTYPE_LONG can be used with SetGeData if the track category is CTRACK_CATEGORY_DATA, see the third post in this thread. This is the only ambiguous datatype at the moment, and as other datatypes wouldn't make sense with SetValue I think it will remain the only one. But I do claim that the category of the track determines whether you need to use SetValue or SetGeData. (That is almost the same in effect... but in case of DTYPE_LONG not quite.)
  • Apply Substance Preset with no User Input.

    Moved Cinema 4D SDK
    5
    0 Votes
    5 Posts
    855 Views
    ferdinandF
    Hello @janine-mcmaster, without further questions or replies, we will consider this topic as solved by Monday, the 30th and flag it accordingly. Thank you for your understanding, Ferdinand
  • Python plugin and Linux CLR arguments

    Cinema 4D SDK python s24 r23
    5
    0 Votes
    5 Posts
    992 Views
    V
    Hello, Adding the path to the plugin in g_additionalModulePath fixed the issue. Thank you very much for your help.
  • 0 Votes
    5 Posts
    1k Views
    ferdinandF
    Hello @Spools_Arbuckle, without further questions or replies, we will consider this topic as solved by Monday, the 30th and flag it accordingly. Thank you for your understanding, Ferdinand
  • Get port id of xpresso node

    Cinema 4D SDK python s24
    6
    0 Votes
    6 Posts
    2k Views
    kbarK
    Was just searching for something related and came across this post and thought I would also point out my site that also displays all the data from the resource files. https://plugins4d.com/Description/Nodes Here is the page for GVSpline: https://plugins4d.com/Description/Node?containerName=GVspline It is similar to the documentation now supplied in the official maxon docs.
  • Target Tag not fixing to target

    Cinema 4D SDK r21 python
    8
    0 Votes
    8 Posts
    2k Views
    A
    Hi @Cairyn, Understood and works like a charm! Many thanks guys
  • 0 Votes
    4 Posts
    1k Views
    ferdinandF
    Hello @lasselauch, without further questions or replies, we will consider this topic as solved by Monday, the 30th and flag it accordingly. Thank you for your understanding, Ferdinand
  • Get a Deformed Point Position Over Time

    Cinema 4D SDK windows python s24
    7
    0 Votes
    7 Posts
    802 Views
    ferdinandF
    Hello @blastframe, yes, there is a loop in that script which is like my pseudo-code one. If they are doing the same thing is a bit a point of view. The script evaluates each frame to do something each frame, while my pseudo code evaluates all frames to do something after that. So, for clarity again as pseudo code: # Evaluate all frames and do something for each frame, i.e., what Maxime's # script does. for frame in FRAMES: for item in document: item = evaluate(item, frame) DoSomthing(item) # Evaluate all frames and after that do something, i.e., what I am proposing. # From a more abstract point of view, both are doing the same thing. The only # difference here is that we are not interested in the intermediate results, # only in updating an item with is prior state: `item = evaluate(item, frame)` for frame in FRAMES: for item in document: item = evaluate(item, frame) DoSomthing(someItem) If you say, you are fine with not respecting this than this will simplify things. And most things that impact (deform) caches, won't be impacted by that. But there are direct cases which are affected, e.g. cloth simulations, some deformers like for example the collision the deformer and more. And indirect cases like when you have a particle system whose state over three corners will impact some deformation. And yes, this is very taxing to do, because you must evaluate a lot of stuff each frame. And you will have likely to execute all passes (animation, expressions, and caches); in the end it depends on how a specific scene is setup. The performant way to do this is cache the required data yourself. Like for example the collision deformer can do it; i.e., you click a button and then all data is calculated which then later is only played back. I would not say that it is impossible to do this in Python, but you will lack some important types to store such data in Python that are exposed in our C++ API. Python is also in general not well suited for such task, due to its inherent slowness of iteration. But that does not mean that with some smart thinking you could not make it work in Python in a performant way. This all depends on what you are exactly trying to do and is more of a general complexity of an algorithm or project design question (and therefore out of scope of support). The bottom line is that your initial question of Get a Deformed Point Position Over Time might contain more complexity than anticipated by you, because it implies something is the recursive function itself and time. Which is always a pain in the *** to handle. Cheers, Ferdinand
  • 0 Votes
    5 Posts
    732 Views
    ?
    @ferdinand Thank you. I'll try to cache myself.