C++ Resources
This page contains a list of resources about Cinema 4D C++ plugin development and useful links.
Posts
- Drawing Text in the Viewport
- Saving EXR
- Exposing C++ functionality to Python
- Viewport HUD API
- Saving Custom GUI layouts
Tools
- craftr:NiklasRosenstein.maxon.c4d -- Build Cinema 4D Plugins on Windows, macOS and Linux
Snippets
Hide Dialog Menubar
There is a non-member function available in the SDK that can be accessed
through the C4DOS
to add special gadgets to the dialog, and it appears
that the state "no menubar" is also represented internally as a dialog
gadgets.
inline Bool AddGadget(GeDialog* dlg, Int32 gadget_type) {
String const name;
BaseContainer const bc;
return C4DOS.Cd->AddGadget(dlg->Get(), gadget_type, 0, &name, 0, 0, 0, 0, &bc, nullptr);
}
The gadget to remove the dialog menubar is DIALOG_NOMENUBAR
. Be aware
when adding this gadget: Adding it inside CreateLayout()
won't work
and calling it afterwards will crash C4D. You can call the function
in the dialog's constructor though!
class MyDialog : public GeDialog() {
public:
MyDialog() : GeDialog() { AddGadget(this, DIALOG_NOMENUBAR); }
};