The RSvector2 custom gui is part of the Redshift module. Users who do not have Redshift will not be able to use your plugin properly, because reading its description will raise an error. The GUI of your plugin will still load and might default to the default 3-component vector custom gui for the Vector data type, but there are a lot of ifs and buts in the way. I would not rely on this "throws errors but sort of works anyway" working everywhere.
Global Moderators
Forum wide moderators
Posts
-
RE: Is there a 2-input attribute type ?
-
RE: Is there a 2-input attribute type ?
Hey @Dimitris_Derm. ,
Thank you for your question. It depends a bit on how you meant that question for what the answer would be. The Cinema and Maxon API contain multiple two component vector data types (of which not all are ported to Python) . But you show us here an image of a description. Descriptions are the GUI that wraps what Cinema calls parameters, the fields of entities such as objects or materials. Descriptions have their own data types, which means you cannot just use any data type for them; you need to use the data type that the description expects.
On top of that exists the concept of custom GUIs. Each description data type has a default GUI representation, but developers can create custom GUIs to change how the data is presented and interacted with in the interface. This is here the case for both the 2D Vector and RSvector2 custom GUIs you showed us. They are both custom GUIs for the default (three component) vector data type of Cinema 4D, in Python
c4d.Vector. So, long story short, in this case you can use the RS custom GUI, because it sits on top of one of the basic data types. Other RS Custom GUIs sit on top of specific RS data types which are then neither exposed to Python or C++. In some cases you can still sort of deal with these unexposed types, but that would be its on topic to discuss.So, when you only want a visual two component vector in the interface, you can use the RS custom GUI for that purpose. You would then just ignore the third component of the underlying
c4d.Vectorand work with the two components you care about. On a pure data level there is currently no two component vector data type for descriptions. You can indirectly store Maxon API two component vectors over containers, but such parameters would then have no GUI representation.
Cheers,
Ferdinand -
RE: Can a plugin use the native Node Editor for its own graph?
Hey,
when you are happy with your HTML solution I am happy. I just meant writing your own node editor can be quite a bit of work, even with AI. Your material system seems to be quite unique, given how many object manager nodes it uses. Material nodes other than scene nodes have object manager drag and drop disabled by default; but you could implement a node which just links an object manager node manually. I think there is also a drag and drop override hook in the node space, but I would have to ask the node team if this is possible for public API users.
The old GraphView (i.e. Xpresso) API editor will already display the selected node for you in the attribute manager. So, when you want for example a field node, you would have to let the relevant field settings of the field object shine through on that node (dynamically copy part of its description).
You could technically also do some "select instead logic", but that will likely result in race conditions. It would go like this: Implement some kind of plugin that has access to the core message stream, e.g., a GeDialog or MessageData plugin. There hook into EVMSG_CHANGE and traverse the whole scene graph or the parts you are interested in such as an Xpresso graph to record the selection state of nodes. The diff to a previously recorded state will then tell you which nodes just have been selected with the current EVMSG_CHANGE. You can then overwrite the the attribute manager selection.
A bit more brutish version would be to check with each EVMSG_CHANGE which nodes are active in the attribute manager via cinema::ActiveObjectManager_GetObjects (this is indeed the attribute manager and not the object manager), and then overwrite the selection to your needs. But as I said, this is very hacky, and I would not recommend doing this. There is no way to naturally overwrite the event of a node X being selected and therefore shown in the AM as to translate to the node Y actually being shown in the AM. This would violate core UX principles in Cinema 4D. If you want a node to have the parameters of other nodes "shine through", the way to go is incorporating parts of the other nodes description. The cheapest way to do this is a
Baselinkas you have nothing to do then other than adding this parameter to your node.
Cheers,
Ferdinand -
RE: Support for C++20
Hey @thomasmfields,
unfortunately not yet. Cinema 4D is targeting C++ 20 since release 2026.0.0 and I had not yet had the time to also move Cineware over. I roughly have it on my backlog to give Cineware a makeover in 2027, which would include CMake and C++ 20 support, as well as some other smaller features. But as always, I cannot give a hard guarantee on that.
In the meantime, I am afraid you would have to ask an agent to do it for you.
Cheers,
Ferdinand -
RE: C++ SDK 2026.4 — Supported ordered mouse movement input for keyboard-initiated modal transforms
Hey @hey2495,
okay, this changes things a bit. I also overlooked the
SetCursorPosin your first posting, I do not know what you are exactly doing, but setting the cursor position is a bit unusual for a plugin.When you say "G/R/S transform" I assume you are trying to implement some kind of move/scale/rotate gizmo for your tool plugin? And the main issue you currently have is that when you set the cursor, that you read (from your perspective) incorrect input information?
- As you said it yourself, I would try to switch to input states here rather than events. You gave the special condition that your events are without any button being pressed which is rather unusual for Cinema event polling. I would have to check myself having no pressed button impacts mouse pos polling.
- I would for sure use here the global input polling (cinema::GetInputState and not the specialization attached to viewports or dialogs. You talk about screen borders and using there a filtered version of the input stream (even when you viewport or dialog seemingly fills the whole screen) does not seem like a good idea.
- There is
EVMSG_ASYNCEDITORMOVE, a core message that is sent when the user moves something in the editor window. Our Cappucino mouse movement recorder tool uses this.
Is there a supported Cinema 4D C++ SDK input callback or API that can supply mouse movement during a keyboard-initiated, button-free modal interaction with documented semantics that distinguish real user motion from SetCursorPos()-related repositioning or delayed events?
Our input handling is probably about thirty years old (with improvements made along the way). The rigid modern day system boundaries you are asking for (does this and that under these conditions) do not exist. This was written in a time when devs thought using more than one character for a variable name is something offensive

When you implement a tool (be it ToolData or ToolDescriptionData), you should use its mouse and keyboard functions to track inputs. Using a scene hook (which would also have dedicated polling functions) and on top manual polling also seems not necessary (but I only have a very superficial view on your project).
When you are still stuck, I would recommend sharing a brief executable/compile-able code snippet, so that I can better understand what is going wrong for you. And with executable I mean for example a minimal SceneHook impl that shows your problem. There are so many things that could go wrong for such a delicate issue as yours. But my key idea would be that you might operate on stale data when polling for events instead of states.
we want to avoid taking ownership of Cinema 4D's window event loop.
This could mean a lot, but a plugin which does runtime monkey patching is not allowed. Maybe I am misunderstanding you here, but at face value, 'taking ownership of Cinema 4D's window event loop' is absolutely off limits and we will ban any plugin ID and their owners who would attempt to do such openly malicious actions.
Cheers,
Ferdinand -
RE: Can a plugin use the native Node Editor for its own graph?
You can implement your own material node spaces, all of example.nodes in the C++ SDK is about this. Just compile the SDK and you will find a custom material node space in Cinema once you load the SDK. It also shows you how to implement nodes.
Another alternative could be the old Xpresso system. You can also use HTML if you want but I would advise against reinventing the wheel and either pick Xpresso or the node editor.
I thought you wanted to use the node editor to implement your own node subject, think of a node particle system, or a node system to create sound.
Cheers,
Ferdinand -
RE: Can a plugin use the native Node Editor for its own graph?
Hey,
that menu is a different menu. I assume you are talking about this menu?
.These are the node spaces and it is intended that you can add stuff there, the SDK shows you how to. The other menu is something different, there does not even exist a defined term for that. I would call it Node space groups, i.e. enclosing entities for a collection of node spaces of similar purpose. All render engine node spaces (Redshift, VRay, Arnold, etc.) are for example all material node nodespaces. The Nodes API currently defines two larger groups of node spaces. Scene nodes and material nodes; capsules are sort of an extension of scene nodes. And they come with certain conventions for the node editor. Which are hardcoded in the menu I showed you.
You could technically setup shop in a material nodes space and just let your nodes do there what you want to be done, and implement a hacky end node. But that would be very hacky. Currently there is no way to implement such concept of a node space group as third party.
-
RE: VS Code -> Cinema 4D Connector -> Agent
Hello @mogh,
your question is a bit ambiguous. What is 'Connector Debug output' for you and what is exactly 'inside VSCode' for you, especially under the condition of 'limited access to the machine'?
The connection between VSCode and Cinema 4D to exchange scripts and console output of Cinema 4D is proprietary. It is an websocket connection that runs on the port you define in Cinema (by default 7788), e.g.,
127.0.0.1:7788. The payload is JSON but I would rather not publicly document its details, primarily because I do not want to give the impression that there is any guarantee that the protocol is meant to be a stable API third parties can hook into. But since this is a VSCode extension, you can of course just look at the source to understand the details, or ask an agent to do it for you.When you mean with debug output the actual debugger, then we are using the Microsoft library
debugpy. We use port 5678 but you could also use any other port because your app is the server, not the consumer. I.e., the debug IP could be127.0.0.1:5678. The old (2026.3) docs contained a section that showed how to manually attach from your code to a debugpy client, e.g. VS Code. But I have removed this section in the 2027 Debugging Manual because the debugger is currently not properly working under MacOS and I did not find the time to fix that for 202.0.0 (but I will fix it within 2027.X.X).Note that the debugger connection is made from your code; your code is the server, VSCode is the client.
debugpyis a proprietary Microsoft library and the only meaningful enterprise debugger for Python at the moment. There is the builtinpdblibrary which you can use but it IMHO has its limits. There are also some smaller third party alternatives, but they are all inconsequential and I do not know if they work with Cinema 4D.debugpyis using the open DAP protocol, so it is not impossible to create your own consumer, but it is probably also not trivial (I am mentioning this because your message somewhat implies that you want to sidestep the VS Code debugger interface).Cheers,
Ferdinand -
RE: Deadlock: TakeData.SetCurrentTake() from Python holds the GIL
@nik684 said in Deadlock: TakeData.SetCurrentTake() from Python holds the GIL:
Also worth to note:
We hit the same freeze in BaseDocument.AddUndo() and maxon.GraphTransaction.Commit() on the main thread while a Python tag was drawing.
py-spy showed the same pattern: the main thread holds the GIL and waits, and the draw/ca thread sits in PyGILState_Ensure.
Could those wrappers be missing the GIL release too?Undo maybe be related to Take switch though.
AddUndo just as some other Undo methods does not release the GIL, I just checked. But other than for the take system, this could be intentional here, due to adding an undo could imply changes to
PyObjectinstances (which are not allowed while you drop the GIL).For
maxon.GraphTransaction.Commit()I would have to check, things work entirely different there, the Maxon API is not implemented in a traditional way, things work much differently there. I would need code and a context for the latter. For the former I probably need a good night sleep to think about it and a reason where this would be relevant.Cheers,
Ferdinand -
RE: Deadlock: TakeData.SetCurrentTake() from Python holds the GIL
You picked a terrible spot to start your Cinema journey, the take system while beloved by users, is both complicated and not performance-wise not great when it comes to the API

That is why I added my "It can entail a lot of data copying and scene traversal to bring the current scene into its new state" warning above. The take system entails a lot of copying of data containers or at least parts of them. The data itself is probably only a small portion of the spike you see, what makes this then really expensive, is the fact that when you make half your scene dirty by applying new parameters to it, you also have to rebuild half your scene from scratch which eats a lot of memory.
But I cannot really do anything about this, as this is not my domain, I do not own the take system, just the Python bindings to it. When you consider the take system too slow, I would encourage you to make a user report in our Support Center. This is also probably not something you fix in five minutes.
Cheers,
Ferdinand