Due to the winter holidays, support is currently reduced to a minimum. Support will resume in 2027.
Happy holidays from the Maxon team!
Is there a 2-input attribute type ?
-
A vector has 3 inputs

A 2D vector unfortunately comes with a cursor panel

I like the RSvector2
but I'm afraid the name is instructive to be used only with RS data types... is it safe to use it in a non-RS context ? -
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 -
@ferdinand Thank you Ferdinand for this informative demonstration.
Will I have issues if I use the RSvector2 in a Python Plugin running on a C4D version before the merge of C4D and RS ? -
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.