• 0 Votes
    5 Posts
    511 Views
    chuanzhenC
    @m_adam Thanks
  • Overriding arrow keys in the Object Manager?

    Cinema 4D SDK r23 python
    9
    0 Votes
    9 Posts
    1k 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
    763 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
    653 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
    486 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
    506 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
    685 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
    794 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
    821 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
    1k 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
    941 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
    656 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
    620 Views
    ?
    @ferdinand Thank you. I'll try to cache myself.
  • Add button to run a script

    Cinema 4D SDK
    12
    0 Votes
    12 Posts
    2k Views
    ferdinandF
    Hello @stereo_stan, 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
  • How to detect a document switching?

    Cinema 4D SDK python r23 s24 sdk
    5
    0 Votes
    5 Posts
    871 Views
    ferdinandF
    Hello @mocoloco, 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
  • HUD Text issues

    Cinema 4D SDK r23 python
    9
    1
    0 Votes
    9 Posts
    1k Views
    K
    Oh! sorry @fwilleke80 I misread your first message. @ferdinand, I think I got confused from the beginning. I made a copy of my code from an objectData plugin to a scenehook plugin without changing DRAWPASS to SCENEHOOKDRAW Everything is working just fine now(... except the aliasing) but the result is acceptable. [image: 1627633821978-ok.png] Thanks to both of you! Best Regards,
  • How to Highlight a Button

    Cinema 4D SDK python
    2
    0 Votes
    2 Posts
    527 Views
    ferdinandF
    Hello @Ling, thank you for reaching out to us. Please remember to open a new topic of you own when you have a question and not to hijack other topics. The exception to that rule is when you have a question that aligns exactly with a currently ongoing topic. The reason we enforce this, is so that the form remains a nicely searchable knowledge base. I have forked your question for that very reason; it did not align with the other topic. About your question: It depends on what you mean by it. You cannot modify the background color of a Button element. What you can do, is create a LONG element and define QUICKTABRADIO as its custom GUI; here is how the muscle object in Cinema makes use of this GUI element: LONG ID_CA_MUSCLE_OBJECT_STATE { SCALE_H; ANIM OFF; PARENTCOLLAPSE; CUSTOMGUI QUICKTABRADIO; CYCLE { ID_CA_MUSCLE_OBJECT_STATE_RELAX; ID_CA_MUSCLE_OBJECT_STATE_COMPRESSED; ID_CA_MUSCLE_OBJECT_STATE_EXTENDED; } } This will give you the tabs look as shown in many places in Cinema 4D. You will however need multiple elements to make this useful, as this is effectively an options group. What you could also do, is create a BITMAPBUTTON and then have different images for its normal and pressed stated. Cheers, Ferdinand