• 0 Votes
    5 Posts
    944 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
    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
    710 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
    664 Views
    ?
    @ferdinand Thank you. I'll try to cache myself.
  • Add button to run a script

    Cinema 4D SDK
    12
    0 Votes
    12 Posts
    3k 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
    1k 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
    643 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
  • SplineCustomGui settings issue

    Cinema 4D SDK r21 python windows
    11
    2
    0 Votes
    11 Posts
    2k Views
    ferdinandF
    You need to call NodeData.InitAttr() in NodeData.Init. E.g.: def Init(self, node): """ """ self.InitAttr(node, float, c4d.PY_TUBEOBJECT_RAD) self.InitAttr(node, float, c4d.PY_TUBEOBJECT_IRADX) node[c4d.PY_TUBEOBJECT_RAD] = 200.0 node[c4d.PY_TUBEOBJECT_IRADX] = 50.0 return True But you should check the allocation problem first, it is the most likely culprit. Se the edit in my last posting. Cheers, Ferdinand
  • 0 Votes
    5 Posts
    1k Views
    ferdinandF
    Hello @delizade, 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
  • Modifying Scene On First Open or Before Save?

    Cinema 4D SDK s24 python
    5
    0 Votes
    5 Posts
    1k Views
    dskeithbuckD
    @C4DS @kbar @ferdinand - Thank you so much for the in-depth responses. @kbar I'll see if I can get my employer to pony up for a license for Call Python as that seems like the simplest root. Although, this is potentially a light enough lift that I can finally make the transition into C++ development. @ferdinand Helpful to know that I won't be able to interrupt the save process (probably a good thing from the user POV).
  • Volume Builder Index returning None

    General Talk python
    4
    0 Votes
    4 Posts
    788 Views
    ferdinandF
    Hello @falcon, 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 and Set Move Tool's XYZ Axis Lock State

    Cinema 4D SDK python
    7
    1
    0 Votes
    7 Posts
    2k Views
    eZioPanE
    Thank you @ferdinand for the detailed answer and code. I will do more reading in the sdk document.
  • Face associated with a selection

    Moved Cinema 4D SDK python
    4
    1
    0 Votes
    4 Posts
    758 Views
    KantroninK
    Thanks for your quick replies I used GetBaseSelect() which allowed me to have the selected faces for each selection list_polygon = obj.GetAllPolygons() dim = len(list_polygon) L = [] tag = obj.GetFirstTag() while tag: if tag.GetType() == c4d.Tpolygonselection: sel = tag.GetBaseSelect() L2 = [] for i in range(0,dim): if sel.IsSelected(i): L2.append(i) L.append([tag.GetName(),L2]) tag = tag.GetNext() for item in L: print item[0] print item[1]
  • 0 Votes
    9 Posts
    2k Views
    M
    Hello! @ferdinand ,@Cairyn Thank you for politely teaching me! I was able to solve the title problem. I will use an external editor. I also understood loading plugins! I was restarting the software many times. I have a new question, but if you study a little more and don't solve it, let me ask you another thread. I'm really thankful to you!
  • Python Cloner/Scatter plugin

    Cinema 4D SDK python
    4
    0 Votes
    4 Posts
    1k Views
    C
    Thanks to both of you! This helps alot! You guys are so nice and helpful
  • CKey.SetValue() for BaseTime object as value

    General Talk python
    2
    0 Votes
    2 Posts
    547 Views
    I
    I actually found the solution while posting the question but wanted to still post it in order to help others who might have the same problem. (If this is against community guidelines I apologise) The solution is to use the CKey.SetGeData() method. Done!
  • Arranging Objects by order of Object Manager

    Cinema 4D SDK python
    10
    0 Votes
    10 Posts
    2k Views
    ferdinandF
    Hello @orestiskon, without any further questions, we will consider this topic as solved by Monday, the 25th and flag it accordingly. Thank you for your understanding, Ferdinand