• How to Register "Hot key" plugin in python?

    Cinema 4D SDK python r23
    5
    2
    0 Votes
    5 Posts
    1k Views
    gheyretG
    Hi @ferdinand , Thank you very much for your detailed reply. I think it is very helpful to me. Cheers!
  • How to check if document is rendering?

    Cinema 4D SDK python
    6
    0 Votes
    6 Posts
    2k Views
    P
    Hey sorry for gravedigging. i have the problem that my tag plugin recognises the difference between rendering and not rendering. unfortunately it also always changes the state in the doc itself and not only in the doc that is rendered [image: 1720870787719-6484d884-61c7-454c-a256-0f1167238772-grafik.png]
  • 0 Votes
    3 Posts
    538 Views
    D
    Hello Maxime, first of all, thanks for the quick response. You gave me a great clue with the compiled dll version. C4D R23 is compatible with scipy 1.4.0 so the solution was to downgrade it. Thanks again, Daniel
  • 1 Votes
    3 Posts
    556 Views
    ferdinandF
    Hello @SteveJLV, the example has been fixed and both computations now will reflect the correct result. The fixed example will be included with an upcoming release of the Python SDK documentation. Cheers, Ferdinand
  • c4d.BFH_LEFT is not work in menu line?

    Cinema 4D SDK s24 python
    3
    1
    0 Votes
    3 Posts
    369 Views
    gheyretG
    @ferdinand Thanks to your replay, Some of the features I wanted seemed to be addressed in the R25! Let's rock and roll for R25! Cheers!
  • Detect unicode character keypress in a Python script

    General Talk
    6
    0 Votes
    6 Posts
    2k Views
    R
    Ah yes thank you so much!
  • ScrollGroupBegin() is not work in GeUserArea()

    Cinema 4D SDK python s24
    7
    0 Votes
    7 Posts
    945 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
    676 Views
    orestiskonO
    @m_adam That clears it up, thanks Maxime!
  • 0 Votes
    7 Posts
    831 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
    546 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
    956 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
    752 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
    538 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
    587 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
    1k 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
    789 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
    918 Views
    V
    Hello, Adding the path to the plugin in g_additionalModulePath fixed the issue. Thank you very much for your help.