• Github Example group_nodes_r26 is broken.

    sdk python 2023
    4
    1
    0 Votes
    4 Posts
    493 Views
    ferdinandF
    Hello @Dunhou, I noticed maxon api changed every version and almost the major part of sdk change log We are aware that this fact is disliked by especially technical artists. But the Nodes API is still under active development and probably will be for the intermediate foreseeable future. Some changes from time to time are therefore inevitable. But we usually do not just remove something, but first mark it as deprecated and then remove it one or two cycles later, giving third parties more time to adapt. For S26, GraphModelInterface::IsSelected in graph.h changed for example into this: [[deprecated("Use GraphModelHelper static functions")]] MAXON_METHOD Result<Bool> IsSelected(const GraphNode& node); The problem is that this information is not visible at all for Python developers and still could also be improved for C++. We are aware of the problem, and working on the quality of change notes is something we already did over the last cycles and are still doing. Mapping such information to Python is certainly something I would like to do, but my main focus was for now gathering C++ API change notes in a more consistent manner. For now, I would recommend having an eye on the C++ change notes as a Python developer. The color coded deprecated markup should make it fairly easy to find upcoming removals, see for example the 2023.2 C++ API change notes. We are still working on improving API change notes for C++ and Python, because we are aware that it is crucial to clearly communicate our intentions with an API. I for example would like to make such information more searchable or pull it into the relevant documentary units. I.e., pull change notes also into the class, method, etc. descriptions, which are the subject of change. But that will be very hard to do with our current solutions might therefore have to wait a bit. Cheers, Ferdinand
  • Interaction Tag - def message seems to not work

    4
    1
    0 Votes
    4 Posts
    636 Views
    ferdinandF
    Hey @Smolak, You must expose the ID as explained in the posting and shown in the second code listing. Forgot to do it in the second one. I have updated the listing. Cheers, Ferdinand
  • 0 Votes
    5 Posts
    1k Views
    ymoonY
    @ferdinand It Works. Thank You
  • CUSTOMGUI_QUICKTAB trigger twice when click

    sdk python 2023 windows
    3
    0 Votes
    3 Posts
    418 Views
    DunhouD
    @m_adam Thanks man! this @dataclasses.dataclass decorator is pretty handy , new knowledge incoming And maybe some similar bug I have seen before , but I don't remember what it is (and even didn't know it is a bug or my bad coding ) , if I met some similar bugs I will update the topic , but now let's hope it will be fixed next release . Thanks for your help again Cheers~
  • How to obtain all vertices of an object in C++.

    s26 c++ sdk
    3
    0 Votes
    3 Posts
    607 Views
    P
    @m_adam Thanks
  • EnhanceMainMenu Inconsistent results in different c4d versions

    2023 python
    3
    1
    0 Votes
    3 Posts
    449 Views
    chuanzhenC
    @i_mazlov Thanks
  • 0 Votes
    3 Posts
    652 Views
    B
    @i_mazlov Gotcha. Thanks. Works as expected.
  • Inserting items into dropbox to TreeView

    4
    1
    0 Votes
    4 Posts
    724 Views
    M
    Hi @simonator420 for this purpose you have to define GetDropDownMenu and SetDropDownMenu. GetDropDownMenu is called by Cinema 4D to retrieve the content of the menu to display from the menuInfo dictionary. For more information about this dictionary please have a look at TreeViewDropDownMenuInfo Dict. SetDropDownMenu is called by Cinema 4D when the user select a value from the dropdown. Find bellow an implementation example: def GetDropDownMenu(self, root, userdata, obj: Entry, lColumn, menuInfo): menuInfo["entry"] = 1001 # Select teh second entry menuInfo["menu"][1000] = "First Entry" menuInfo["menu"][1001] = "Second Entry" menuInfo["menu"][1002] = "ThirdEntry" menuInfo["state"] = int(menuInfo["state"]) # Workaround to not have warning in Cinema 4D. Will be fixed in the next C4D version. def SetDropDownMenu(self, root, userdata, obj, lColumn, entry): print(f"User selected the entry with the ID: {entry}") Finally note that due to an issue that will be fixed in the upcoming version of Cinema 4D, even if you do not change the state, you need to override it to an int value otherwise it will print an error in the console (this is not blocking but still). Cheers, Maxime.
  • MoGraph color tag access

    c++
    4
    0 Votes
    4 Posts
    868 Views
    M
    Hi @Aaron sorry I have to admit I totally overlooked your case. So Fracture Object is a bit special in how color is handled, and this is not as an usual mograph object, where there is Modata and an array of color. Instead each part is a different PolygonObject and the color is simply the color of the object (the one from the basic tab when you select a polygon object in the attribute manager). So with that said find bellow a code to read color. // Get the fracture object BaseObject* obj = doc->GetFirstObject(); if (!obj && obj->GetType() == 1036557) return false; // Retrieve the cache. The Cache of a fracture object consist of a null and a bunch of PolygonObject where // each PolygonObject represents a part of the fracture. BaseObject* rootObjCache = obj->GetCache(); if (!rootObjCache) return false; BaseObject* child = rootObjCache->GetDown(); Random randomGenerator = Random(); while (child) { // Read Color GeData data; child->GetParameter(DescID(ID_BASEOBJECT_COLOR), data, DESCFLAGS_GET::NONE); Vector color = data.GetVector(); ApplicationOutput("@"_s, color); // Write Color with new random value, note that we write the cache, meaning each new re-evaluation of the Fracture object will reset these changes Vector randomColor = Vector(randomGenerator.Get01(), randomGenerator.Get01(), randomGenerator.Get01()); child->SetParameter(DescLevel(ID_BASEOBJECT_COLOR), randomColor, DESCFLAGS_SET::NONE); // Get Next Polygon Object aka the next part from the fracture child = child->GetNext(); } Cheers, Maxime.
  • Rendering render queue on program startup

    Moved
    6
    0 Votes
    6 Posts
    887 Views
    Z
    Hi @karol_w! This is exactly what I am looking for, because Octane keeps crashing on me. Unfortunately, I am not very good with coding. Is there any chance you would share your plug-in? Or point me towards where to find resources to build that myself? Thank you very much!
  • GetActiveUVSet() returns None if multiple UVs are active?

    python
    4
    0 Votes
    4 Posts
    880 Views
    ferdinandF
    Hello @Gene, So far it's doing exactly what I need. Only issue I have is if I need to undo the script. I have to press the Undo button several times because C4D creates an undo state for every Tag/Object selection step in the script, instead of putting all of them under one undo state. I think this is a long-existing limitation of C4D's Undo system? Well, it depends a bit on what you would consider a "long-existing limitation", but you can consolidate multiple operations into a singular item in the undo-stack. The most relevant methods are BaseDocument.StartUndo, BaseDocument.EndUndo, and BaseDocument.AddUndo (there more undo related methods on BaseDocument). Cheers, Ferdinand """Demonstrates wrapping selecting all top-level objects in a document into one undo item. """ import c4d doc: c4d.documents.BaseDocument def main(): """ """ obj: c4d.BaseObject = doc.GetFirstObject() # Start an undo item in the undo stack. doc.StartUndo() while obj: # Add an operation to the undo item, most operations must be invoked BEFORE the actual # operation is carried out. The only exception is inserting new nodes, AddUndo must here # be called AFTER the operation. doc.AddUndo(c4d.UNDOTYPE_ACTIVATE, obj) doc.SetActiveObject( obj, c4d.SELECTION_NEW if obj == doc.GetFirstObject() else c4d.SELECTION_ADD) obj = obj.GetNext() # Close the item. doc.EndUndo() c4d.EventAdd() if __name__ == "__main__": main()
  • FieldLayer Plugin Globals

    r20 sdk c++
    3
    0 Votes
    3 Posts
    746 Views
    J
    Thanks for the response, that seems to have solved the problem.
  • Multi-menu menu, how to

    sdk c++
    5
    1
    0 Votes
    5 Posts
    1k Views
    WickedPW
    Thanks @ferdinand, Agree. I've avoided using OS-specific calls up until now. But for this one I've had to make an exception. Not an ideal solution, but it seems to work: [image: 1681381734409-e9057cac-086c-4810-bb9c-c198ecdc2427-image.png] To get around the lost window focus issue, I'm using the first dialog's Timer() to poll and check if any dialog in the menu has window focus. If none do, e.g., a user has clicked away, the system self-destructs. If a menu selection is made, it sends a Message() back to the calling object with details, and then self-destructs. It's all a bit of a hack. But it works. WP. Update: I'll mark this thread as solved. If I have any further questions I'll pop back in.
  • Cinema 4D Unable to use MATLAB library

    s26 c++
    4
    0 Votes
    4 Posts
    664 Views
    i_mazlovI
    Hello @pchg, Please note that the subject is out of scope of support as declared in the forum guidelines, namely: We cannot provide support for third party libraries. As a direction of your further investigation you can consider checking MATLAB library for using incompatible dependencies. Another guess would be to check if plugin registration succeeds at all. Thanks for your understanding! Cheers, Ilia
  • Cinema 4D Connector not working on 2023.2.0 on Air M1 MacOs 12.6.3

    c++ 2023
    3
    0 Votes
    3 Posts
    811 Views
    mikeudinM
    Thank you @ferdinand !
  • 0 Votes
    9 Posts
    2k Views
    A
    Hi @Manuel I have checked the new update 2023.2.0 and the feature works just fine with custom bitmaps without any change from my side. Congrats with a very quick bugfix! This is very cool! Also it's great the half-year version 2023.2 doesn't need 3rd party plugin rebuild and recompile as in S24, S26. Thanks for this!
  • 0 Votes
    2 Posts
    196 Views
    ferdinandF
    Hello @chuanzhen, Thank you for reaching out to us. Thank you for pointing this out, half of the word "offline" was pointing towards the offline C++ documentation. I have updated the link. Cheers, Ferdinand
  • Detect CTRL + RightMouseButton in SceneHook

    r25 c++ 2023
    3
    0 Votes
    3 Posts
    697 Views
    C4DSC
    Thanks for taking the time to respond, even during the weekend. I must say this is quite embarrassing: I already had forgotten about the response in the other thread, and it's not even 3 weeks old. I sincerely apologize for wasting your time with this duplicate thread. I can confirm the GetInputState is working fine, no need to waste more of your time trying it out. Thanks again.
  • Displaying tag properties as part of object's properties

    c++ maxon api sdk
    3
    1
    0 Votes
    3 Posts
    640 Views
    yesbirdY
    Thanks, @Manuel. The reason was in definition of TAG_MULTIPLE at the moment of registration. Now the tag properties are displayed as I was expecting. .... YB
  • 0 Votes
    3 Posts
    503 Views
    J
    Hi @ferdinand , First of all, I apologize for my poor explanation. I ran into an unexplainable situation, but your example solved my problem nicely. I couldn't get consecutive characters because I mistakenly called the self.GetInputState(c4d.BFM_INPUT_MOUSE, msg.GetInt32(c4d.BFM_INPUT_CHANNEL), msg) method and it would interrupt getting the original input. now I have solved the problem. Thank you very much you guys are the best! Cheers~