CUSTOMGUI_SUPPORT

Detailed Description

Macros

#define CUSTOMGUI_SUPPORT_LAYOUTSWITCH
 
#define CUSTOMGUI_SUPPORT_LAYOUTDATA
 
#define CUSTOMGUI_DISALLOW_TAKESOVERRIDE
 

Macro Definition Documentation

◆ CUSTOMGUI_SUPPORT_LAYOUTSWITCH

#define CUSTOMGUI_SUPPORT_LAYOUTSWITCH

Supports layout switching.

◆ CUSTOMGUI_SUPPORT_LAYOUTDATA

#define CUSTOMGUI_SUPPORT_LAYOUTDATA

Supports layout data. If set, the custom GUI saves and restores data to a BaseContainer when the GUI is rebuilt.
For example imagine the following: the user adds a gradient needle. The number of GUI elements changes (sub-descriptions are shown) and the dialog needs to be rebuilt.
In order that the GUI does not lose its settings (e.g. which needle was active etc.) it can store its data to a BaseContainer under its description ID.
Some excerpts from the gradient custom GUI:

iGradientCustomGui::iGradientCustomGui(const BaseContainer &settings,CUSTOMGUIPLUGIN *plugin) : iBaseCustomGui(settings,plugin)
{
Bool alpha = settings.GetBool(GRADIENTPROPERTY_ALPHA);
editcolor = !settings.GetBool(GRADIENTPROPERTY_NOEDITCOLOR);
if (col && alpha)
else if (alpha)
area.mode=GRADIENTMODE_ALPHA;
else
area.mode=GRADIENTMODE_COLOR;
m_bIsTristate = false;
area.m_pParent = nullptr;
if (data)
{
area.editalpha = data->GetInt32(1);
area.displayresult = data->GetInt32(2);
area.active_knot = data->GetInt32(3);
area.active_bias = data->GetInt32(4);
}
}
Int32 iGradientCustomGui::Message(const BaseContainer &msg,BaseContainer &result)
{
switch (msg.GetId())
{
result.SetInt32(1,area.editalpha);
result.SetInt32(2,area.displayresult);
result.SetInt32(3,area.active_knot);
result.SetInt32(4,area.active_bias);
return true;
...
}
}
Definition: c4d_basecontainer.h:47
Int32 GetInt32(Int32 id, Int32 preset=0) const
Definition: c4d_basecontainer.h:303
BaseContainer * GetContainerInstance(Int32 id)
Definition: c4d_basecontainer.h:425
Bool GetBool(Int32 id, Bool preset=false) const
Definition: c4d_basecontainer.h:295
PyObject PyObject * result
Definition: abstract.h:43
maxon::Bool Bool
Definition: ge_sys_math.h:55
maxon::Int32 Int32
Definition: ge_sys_math.h:60
#define CUSTOMGUI_SAVEDLAYOUTDATA
BaseContainer Saved layout data.
Definition: customgui_base.h:29
@ BFM_GETCUSTOMGUILAYOUTDATA
Private.
Definition: gui.h:978
#define GRADIENTMODE_ALPHA
Alpha only.
Definition: customgui_gradient.h:108
#define GRADIENTMODE_COLORALPHA
Color and alpha.
Definition: customgui_gradient.h:109
#define GRADIENTMODE_COLOR
Color only.
Definition: customgui_gradient.h:107
#define GRADIENTPROPERTY_ALPHA_WITH_COLOR
Definition: customgui_gradient.h:44
#define GRADIENTPROPERTY_NOEDITCOLOR
Definition: customgui_gradient.h:54
#define GRADIENTPROPERTY_ALPHA
Definition: customgui_gradient.h:49
const char const char * msg
Definition: object.h:438

◆ CUSTOMGUI_DISALLOW_TAKESOVERRIDE

#define CUSTOMGUI_DISALLOW_TAKESOVERRIDE

Disallows Takes override e.g. the GUI does not hold real data but just react to the node changes (e.g. Material Preview).

Since
R17.032