Tool Tabs and foldable groups
-
I am working on a ToolData plugin , and it's going well enough at the moment. But I see various UI elements that I cannot seem to find any documentation on how to achieve. The best example I can give is the Extrude Tool(although there are many tools that work in this way).
How do you create the tabs like in the extrude tool where you can select 1 or multiple tabs and display all the UI elements? The tabGroupBegin was where I thought but it seems to be strictly tabs, radios, or drop down.
The other thing that is interesting is the foldable sections. Is that using BFV_BORDERGROUP_FOLD or is that something much more complex?
-
Hello @BretBays,
Thank you for reaching out to us. Please provide code and a clear problem description as statements like `How do you create the tabs ... I tried X but it only creates tabs' are a bit confusing for us.
- There are two ways to create tab interfaces, one is via groups and the method GeDialog.TabGroupBegin and the other one is via
CUSTOMGUI_QUICKTAB
. We have a code example for it in Python here. The "tab-look" of descriptions, i.e., what you usually see in the Attribute Manager, is achieved withCUSTOMGUI_QUICKTAB
. - There is no group folding in dialogs anymore, this feature has been deprecated (we probably should update the docs).
There is a difference between dialogs and descriptions. They use similar UI elements but they are not the same. Folding in descriptions is still supported, in dialogs not (but you can implement it yourself when you really need it). You should also be aware that there are
ToolData
andDescriptionToolData
plugins. The former tool type uses dialogs to display its UI in the Attribute Manager, and the latter uses descriptions. Most tools these days in Cinema 4D are implemented asDescriptionToolData
which leads to a distinctive look and set of features which are not trivial to emulate with a plainToolData
.ToolData
is exposed in Python and C++,DescriptionToolData
is only exposed in C++. My colleague @m_adam likes to point out whenever this subject comes up that the type SculptBrushToolData is exposed in Python (which is derived fromDescriptionToolData
) and that you can (ab)use it to implement aDescriptionToolData
in Python. I never tried doing that and what consequences that would have (and neither did Maxime AFAIK). For my taste that would be way too hacky, and I would rather just live with the minor restrictions ofToolData
plugin and its dialog based UI.Cheers,
Ferdinand - There are two ways to create tab interfaces, one is via groups and the method GeDialog.TabGroupBegin and the other one is via