• 0 Votes
    2 Posts
    688 Views
    ferdinandF
    Hello @Hohlucha, Welcome to the Maxon developers forum and its community, it is great to have you with us! Getting Started Before creating your next postings, we would recommend making yourself accustomed with our forum and support procedures. You did not do anything wrong, we point all new users to these rules. Forum Overview: Provides a broad overview of the fundamental structure and rules of this forum, such as the purpose of the different sub-forums or the fact that we will ban users who engage in hate speech or harassment. Support Procedures: Provides a more in detail overview of how we provide technical support for APIs here. This topic will tell you how to ask good questions and limits of our technical support. Forum Features: Provides an overview of the technical features of this forum, such as Markdown markup or file uploads. It is strongly recommended to read the first two topics carefully, especially the section Support Procedures: Asking Questions. About your First Question This is a development forum and your question does not seem to be development related. Please read our forum guidelines lined out above. I have moved this topic into General Talk for now. When this is indeed an end user question we must ask you to use our Support Center, the developer forum is not the right place for end user questions. When this is a development question, then please line out the current code you have and provide a meaningful problem description. Cheers, Ferdinand
  • 0 Votes
    2 Posts
    916 Views
    ferdinandF
    Hey @moghurt, Thank you for reaching out to us. I tried using the pyp plugin to execute Python scripts when starting the software to modify the project file, but when I use the '-render' parameter, the Python code in the pyp plugin is executed after the rendering is complete. I can only speculate as to what exactly you have been doing here, as you do not provide any details or code. Please have a look at Support Procedures: Asking Questions for how to ask good technical questions. The general workflow for what you want to do here (given that one really wants to follow the plugin route) would be to implement PluginMessage for your plugin, and then try to run your code from there at a fitting point of time in the startup sequence of Cinema 4D. And while I would not rule out that -render has an impact on the startup sequence of Cinema 4D, the general claim that your Python code only runs after the rendering seems a bit far fetched. Because for events such as C4DPL_INIT_SYS and C4DPL_INIT modules and plugins have not been loaded yet, i.e., rendering is literally impossible at these points. The plugin approach also assumes that you can inject without problems alien command line arguments into a Cinema 4D app call, e.g., \CINEMA 4D.exe"-nogui -render "render.c4d" -script "myscript.py" with -script being the alien argument. I am not quite sure that this would work, I would have to try myself. What also is problematic, is that you are likely not able to get hold of the render document on this route. The active document will be the empty document, not the render document, i.e., you cannot get hold of the BaseDocument for render.c4d. And you cannot just open and modify the document yourself, as Cinema might have already a lock on that file or is even already loading it. All this makes using c4dpy instead much more attractive as you won't have these problems there. It is also the intended solution for what you want to do here: Modify one or many documents without a GUI in a fire and forget manner. A while ago we had the topic Extending the Command Line with Python where I showed a workflow for how to treat c4dpy as a Script Manager environment. The thread is four years old, written in Python 2 syntax (you will have to convert to Python 3 syntax), and I was then not yet a Maxon employee but a student. So, you might run into some issues. But the principle is definitively reproduceable and I also do not see anything in my old code which seems like a really bad idea. Your workflow could then look like this for doing the pre and post rendering events (as a bat, ps1, sh, or command file and assuming that you do not want to overwrite files): c4dpy script_manager_environment.py -script my_script.py -in my_doc.c4d -out my_doc_pre.c4d CommandLine -my_doc_pre.c4d ... c4dpy script_manager_environment.py -script my_script.py -in my_doc_pre.c4d -out my_doc_post.c4d Cheers, Ferdinand
  • 0 Votes
    3 Posts
    863 Views
    ThomasBT
    @ferdinand Thanks a lot Ferdinand for your time and effort. It is always admirable how carefully and thoroughly you answer many questions. At first it was often difficult to understand and follow your code examples...now it is a little easier. Thanks for that. I found out that the following method also does the job: c4d.SendCoreMessage(c4d.COREMSG_CINEMA, c4d.BaseContainer(c4d.COREMSG_CINEMA_FORCE_AM_UPDATE), 0) Sorry for the second question about why this buttonDesc[c4d.DESC_FITH] = True buttonDesc[c4d.DESC_SCALEH] = True in the GetDDescription method are not working. I thought this is a follow-up question. I will open another topic for that.
  • Error compiling R23 framework

    Cinema 4D SDK r23 c++
    2
    0 Votes
    2 Posts
    564 Views
    i_mazlovI
    Hi @dgould, Welcome to the Maxon developers forum and its community, it is great to have you with us! Getting Started Before creating your next postings, we would recommend making yourself accustomed with our forum and support procedures. You did not do anything wrong, we point all new users to these rules. Forum Overview: Provides a broad overview of the fundamental structure and rules of this forum, such as the purpose of the different sub-forums or the fact that we will ban users who engage in hate speech or harassment. Support Procedures: Provides a more in detail overview of how we provide technical support for APIs here. This topic will tell you how to ask good questions and limits of our technical support. Forum Features: Provides an overview of the technical features of this forum, such as Markdown markup or file uploads. It is strongly recommended to read the first two topics carefully, especially the section Support Procedures: Asking Questions. About your First Question You are completely right with finding the thread with the answer: Manuel posted in a separate thread the solution for this issue: Building R23 SDK with Visual Studio 16.9. As he states there inside the R23.107 sdk you need to find the file frameworks/core.framework/source/maxon/objectbase.h and make there two changes. This will allow your solution to build without errors. The issue was later resolved in S24 and onwards, so there's no need in changing this file there. Cheers, Ilia
  • 0 Votes
    2 Posts
    637 Views
    ferdinandF
    Hey @ThomasB, Thank you for reaching out to us. Without your code we cannot really help you, we are not the oracle of Delphi There are many things which could go wrong in your plugin. But in general what you are doing is correct; add a dummy point object with your snap points to your cache, when you want to introduce special snapping points for your custom generator object. Snapping onto the points of the returned geometry should work out of the box (but snapping sometimes struggles a bit with deep caches). There is however only limited support for adding special snapping points, as it is not really intended to add you own snap logic in that manner. The snapping module both in Python and C++ does not allow you to implement your own snapping logic, you can just read some data. You should also keep in mind that the snapping is an older part of Cinema 4D which has its flaws. You should check if your problem also does occur when you try to snap onto the converted cache of your object (current state to object). If that is the case, you know it is not something your plugin does, but simply the fact that the snapping struggles with that specific geometry/scenario. Cheers, Ferdinand
  • 0 Votes
    4 Posts
    958 Views
    ferdinandF
    Good to hear!
  • 0 Votes
    8 Posts
    2k Views
    C
    @i_mazlov , Do you speak Russian?
  • 0 Votes
    3 Posts
    2k Views
    ThomasBT
    @ferdinand Hello Ferdinand, Thank you very much first of all. yes, you're right, I worked extremely sloppily with the SMC method, of course I'll take the threading into account and also work with a Temp Document. Regarding the problem itself, I can only say that reinstalling CINEMA 4D solved our problem. Cheers
  • 0 Votes
    6 Posts
    1k Views
    ferdinandF
    Hey @ThomasB, That has nothing to do with the highlighting but with the fact that Maxime used incorrect links. developers.maxon.net/docs/ links will only work from outside of the forum. Inside the forum you currently have to use dvelopers.maxon.net/assets/docs/ as otherwise nodebb is trying to take over the routing. I am working on fixing that issue. I have fixed both links of Maxime. Cheers, Ferdinand
  • 0 Votes
    5 Posts
    1k Views
    ThomasBT
    @ferdinand This is a command, and you can c4d.CallCommand it, but that is all the control you have. thank you Ferdiand,
  • R23 Monterey SDK compile errors

    Cinema 4D SDK r23 c++ macos
    9
    0 Votes
    9 Posts
    1k Views
    S
    Thanks Ferdinand. That's very helpful. TBH, for me the best option is probably to support only R2023/4/5 if that just needs the one development environment. It would be different for commercial plugins but for mine I think the most I want to do is support the 2-3 latest versions of Cinema. It just gets too confusing for earlier releases. But it's very useful to know that Monterey/XCode 13 is good for the current two latest releases and maybe the next one too. Cheers, Steve
  • urllib.request module is missing

    Cinema 4D SDK
    5
    0 Votes
    5 Posts
    1k Views
    B
    @ferdinand Brilliant, thank you.
  • 0 Votes
    4 Posts
    805 Views
    ThomasBT
    @ferdinand Thank you Ferdinand for your leniency regarding the three questions.. Will take note of that in the future. =====BaseTime===== Which just surprises me about the BaseTime problem is, that it worked in the Python tag. I didn't get an error message and the prototype worked very well. So I also tried instead of BaseTime int type value in the plugin, but it crashed. It confused me a bit. So I try your suggestion. # In the python tag it worked with int # starf_frame was an int frame = doc.GetTime().GetFrame(doc.GetFps()) - op[c4d.ID_USERDATA,start_frame] ====PoseMorph Symbol==== Regarding the posmorph ID, I should have figured that out myself Thanks for your quick respond Tom
  • 0 Votes
    3 Posts
    794 Views
    ThomasBT
    @ferdinand Many thanks for this detailed example, I'll try it out P.S. Oh my gosh, it's working perfectly. I decided to go the easiest way, just to check the dirtyness of the linked object. linkDirty: bool = link.IsDirty(c4d.DIRTYFLAGS_DATA) Many many thanks Thomas
  • MessageDialog in NodeData plugin

    Cinema 4D SDK python r23 r20 2023
    2
    0 Votes
    2 Posts
    636 Views
    ferdinandF
    Hey @mikeudin, Thank you for reaching out to us. In short, there is no good answer to your question. There is no guarantee that anything will ever run on the main thread. You must always check yourself with c4d.threading.GeIsMainThread. Scene computations, e.g., ObjectData.GetContour is run in parallel off-main-thread and is therefore subject to access restriction to avoid access violations, i.e., crashes. There is no "hack" for this. The essence is that you cannot have both the benefits of sequentialism (can use shared resources) and parallelism (is fast). There are of course data structures which allow you to handle a singular resource from multiple threads, but doing this always entails lining up multiple users in a line, each waiting for users ahead in the line to be done, i.e., hidden sequentialism. In Python this might be hard to grasp because Python itself mostly ignores the concept of parallelism and we only experience here the side effects of the parallelism of the underlying C++ Cinema 4D API. There is also the problem that your request does not make too much sense for me on a practical level. Imagine having a plugin MySpline which opens an error dialog once its GetContour method strays from the right path. A user now edits one hundred instances of MySpline at once and triggers the error. Cinema 4D sometimes executes passes two or three times in a row to resolve dependency problems. This would then mean that you would open three hundred error dialogs for one user interaction (if that would be technically possible in the first place). In general, no node should open any form of dialogs on its own. Opening a dialog after a button press in the description of a node via NodeData.Message is okay. When you are hell-bent on doing this, you could do this: Add a field to your plugin, e.g., self._error: str = "". When you are in your GetContour and an error happens, instead of raising it, simply write it to _error. Implement any NodeData method which often runs on the main thread. NodeData.Message is a good candidate. On each execution of it, check if _error has content and if you are on the main thread. If so, display the message and then null _error. You will still need some kind of throttling so that the user is not spammed with the same error over and over again. I.e., you need an "only-new-errors" mechanism. It is up to you to implement that. An alternative approach could go via core messages. But that is also non-ideal because setting off a c4d.SpecialEventAdd will work from a non main thread but will cause the global core message lock to engage, which is of course a bad thing to happen and exactly the "no-hack" problem I described under (4). You could also try using c4d.StatusSetText and the other status functions. While not officially supported, they will work from non-main-thread environments. But there is no guarantee and we do not officially support this. Cheers, Ferdinand
  • How to apply new fixed FieldList securely

    Cinema 4D SDK r23 python 2023
    5
    0 Votes
    5 Posts
    1k Views
    J
    Hello @mikeudin , without further questions or postings, we will consider this topic as solved by Friday, the 11th of august 2023 and flag it accordingly. Thank you for your understanding, Maxon SDK Group
  • Not working FieldLists Keyframes and Tracks

    Cinema 4D SDK python r23
    3
    1
    0 Votes
    3 Posts
    592 Views
    mikeudinM
    @ferdinand Thank you! That was TranslateDescID issue!
  • 0 Votes
    4 Posts
    841 Views
    J
    Hello @ThomasB , without further questions or postings, we will consider this topic as solved by Friday, the 11th of august 2023 and flag it accordingly. Thank you for your understanding, Maxon SDK Group
  • TranslateDescID with FieldsList

    Moved Bugs python r23 2023
    7
    0 Votes
    7 Posts
    2k Views
    ferdinandF
    Hey @mikeudin, just as an FYI, one of our engineers pointed out that Description.CheckDescID is the likely culprit for the problem and that this method should be avoided when possible due to its resource hungry nature. Instead, you would just manually define the parameter ID you mean, e.g., c4d.DescID(c4d.ID_TAGFIELDS). The problem with this is of course that this statement has been made disjunct from the dynamic parameters example because I stripped that aspect away in my minimized code. The original code example says: # Fills DescLever type and creator completeId = desc.CheckDescID(descId, None) return True, completeId, tag So, they seem to be only after filling in the data type and creator ID and not resolving multi-level IDs. Which you could also do manually when you know the parameters you want to wrap, e.g.,: descId: c4d.DescID = c4d.DescID(c4d.DescLevel(c4d.ID_TAGFIELDS, c4d.CUSTOMDATATYPE_FIELDLIST, c4d.MAXON_CREATOR_ID)) return True, descId, tag Cheers, Ferdinand
  • Setting DESC_DEFAULT for a Parameter has no Effect

    Cinema 4D SDK r23 python
    3
    0 Votes
    3 Posts
    778 Views
    J
    Hello @mikeudin , without further questions or postings, we will consider this topic as solved by Friday, the 11th of august 2023 and flag it accordingly. Thank you for your understanding, Maxon SDK Group