• Implementing a watermark on render

    Cinema 4D SDK c++ windows r21
    6
    0 Votes
    6 Posts
    2k Views
    ferdinandF
    Hello @dunhou, Thank you for reaching out to us. Please read our Forum Guidelines regarding the scope of topics, your question does not seem to be a valid follow-up question to me, and therefore should be its own topic. I also struggle to see how this is an API question, as you seem to report an end-user problem which has nothing to do with one of our APIs. Please contact user support via the Support Center for such questions. Cheers, Ferdinand
  • 0 Votes
    7 Posts
    877 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
    2 Posts
    604 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()
  • Get a Deformed Point Position Over Time

    Cinema 4D SDK windows python s24
    7
    0 Votes
    7 Posts
    738 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
    708 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
  • 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
    3 Posts
    971 Views
    a_blockA
    Hello Ferdinand, yes, I was talking about the plugin ID argument of GeDialog.Open() and Restore(). Thanks for your explanation. I'm completely fine with your answer, despite some seeming here and there. I do understand the problems a codebase grown over decades can cause for answering such questions definitely. Nevertheless your explanations largely sync with my expectations from quite a few experiments. Regarding the mentioned issue of the other thread, I can acknowledge, the plugin ID parameter did not seem to have influence on the issue in my experiments. This question here was really more targeted the sizing issues I have with requesters of varying content. And your answer provides me with some confidence, I can make use of different plugin IDs (I should probably rather say unique IDs from Plugin Café) even if they are not related to any registered plugins at all. While I had already thought so and did not find any issues with this practice, it's always a bit hard to know for sure from the outside. And there's always this feeling one could be doing something harmful, which will only bite at the worst possible point in future. Thanks for the clarification. Cheers, Andreas
  • 0 Votes
    16 Posts
    4k Views
    ferdinandF
    Hey Andreas, no need to feel sorry. It is valuable for us to be aware of this, as this could cause more serious problems further down the road, even though it is hard to reproduce for now. We have pushed this off to QA for now, due to them having the required tools (hardware) to assess this more thoroughly. I do not see anything inherently wrong with that. But the only ones who could answer this with complete certainty are the developers who wrote the Cinema 4D core. And until we cannot say with a reasonable degree of certainty that this is a reproduceable bug that we want to address, I will not bother them with this, since there is other "stuff" in front of the queue for them anyway. I have forked your second part of the question, as I would like to keep this thread clean, as I would anticipate that QA will confirm this bug, it then going to the developers, and we will then report back here. Which will get a bit convoluted when there is a second question being discussed here. The topic can be found here. I understand that this is not the most satisfying procedure for you, as it will take a bit of time. The issue of yours must go through our bug tracking system now first, rather than taking the shortcut we sometimes offer here, of us talking with the developers and then creating an issue if we decide to do so. Cheers, Ferdinand
  • 0 Votes
    5 Posts
    2k Views
    a_blockA
    Hi Ferdinand, thanks for the confirmation and looking into it. While it's a bit unfortunate, I do not consider this a major road block. From my side this thread can be considered close. Cheers
  • 0 Votes
    2 Posts
    512 Views
    M
    Hi, @Boony2000 you are right, the documentation will be fixed. Cheers, Maxime.
  • No save prompt after userchange

    Cinema 4D SDK r21 windows python
    3
    0 Votes
    3 Posts
    659 Views
    B
    Hi! Thanks for your input! I just found the cause. There is an os.kill call on the C4DPL_ENDPROGRAM message. If you leave it out some python stuff seems to keep running and preventing Cinema from being opened again. I am assuming that's why the original author did that. I will just catch the dirty flag myself and deal with unsaved scenes before terminating the process. Unless you know a more elegant way. I will mark this as solved. Thanks again. P.S.: This is off topic, but trying to reply I would always get an error and I had to log out and in again to post this. EDIT: I found the elegant solution - Adding c4d.documents.CloseAllDocuments() before the process termination handles the save dialogs perfectly!
  • VariableChanged Struct is missing its maps?

    Cinema 4D SDK r23 c++ windows
    8
    0 Votes
    8 Posts
    1k Views
    CairynC
    @ferdinand said in VariableChanged Struct is missing its maps?: TEST TEST forbidden to post? No, it's not Sorry, that's the message from the system that I got in the other thread, repeatedly. So I tried it here, and it posted without difficulty. Then I tried in the other thread again, and it worked. Then I deleted all these postings. But as the original message that I tried to post was lost to the error, I didn't bother to write it again. Quite strange error, haven't seen it before, and it didn't come with any explanation WHY it was forbidden to post.
  • DescID [] operator crashes?

    Cinema 4D SDK c++ windows r23
    3
    1
    0 Votes
    3 Posts
    478 Views
    fwilleke80F
    Already found the reason, sorry to bother you, all good Cheers, Frank
  • Errors building math.framework

    Cinema 4D SDK c++ windows r23
    5
    0 Votes
    5 Posts
    582 Views
    fwilleke80F
    Oh yes, it works. Therefore, the topic is solved Cheers, Frank
  • 0 Votes
    5 Posts
    968 Views
    K
    Hi, It looks like the problem got solved by Sized function. Thanks a lot @m_magalhaes and @m_adam !!
  • 2 Votes
    8 Posts
    2k Views
    ferdinandF
    Dear community, this bug has been fixed and will be integrated with an upcoming release of Cinema 4D S24 (hopefully the next one). Cheers, Ferdinand
  • Is MSG_TRANSLATE_POINTS still in use?

    Cinema 4D SDK c++ r23 windows
    5
    0 Votes
    5 Posts
    907 Views
    CairynC
    thank you for looking! Looks as if that message is indeed dead. Without a translation map, it would be fairly useless... The original use I had for it was in a Morph plugin (goes back to R8) so the various morph shapes could keep track of changes done to the original mesh. It's not properly working there any more; guess I know now why My current use is a Symmetry plugin I just finished. Right now, it only works by mapping right points and left points, and duplicating positional changes. I am now looking into possibilities to track added or removed points (and maybe polygons) on one side to duplicate that too. The TRANSLATE messages used to do that, including special information like "point A was merged with point B", but naturally all tools need to support that, and apparently the new kernel has moved on to some other method. I guess I'll investigate whether MSG_POINTS_CHANGED is now carrying the required information...
  • 0 Votes
    2 Posts
    352 Views
    ferdinandF
    Dear user, thank you for reaching out to us. Is it possible, via C++, to add a command to the right click menu that pops up for a parameter in C4D? Unfortunately, that is not possible. The context menu of a DescriptionCustomGui is sealed off from user access. The specific context menu is not meant to be modified. I would like to call a command and somehow get the parameter that was right clicked on as well. I don't think this is possible at all, but can't hurt to ask just in case. You are right, this is also not possible, at least in the context you are most likely talking about. You can get hold of the selected element(s) in a DescriptionCustomGui via GetDescIDSelection() (Link), but this requires one to get hold of that DescriptionCustomGui obviously. Since you are very likely talking about the Attribute Manger, this is effectively not possible, since you cannot get hold of it from the SDK side (in the way you want to). For a custom GeDialog with a DescriptionCustomGui this would be possible. While we can technically get hold of an Attribute Manager when implementing nodes, I do not see a way to get hold of its DescriptionCustomGui nonetheless. Cheers, Ferdinand
  • 0 Votes
    3 Posts
    846 Views
    M
    Aha I see, this makes sense for the NormalTag data. And yeah of course cross product is what I need... Regarding the primitives not turning into polygon object, I thought that was happening with a cube, but now after testing it again it definitely is. So I must have been mistaken before. Thanks for the help, going to mark this as solved.