NodeData::GetDEnabling() Manual

Table of Contents

About

NodeData based Cinema API plugin classes can implement NodeData::GetDEnabling(). This allows to dynamically enable and disable parameters in the Attribute Manager.

NodeData::GetDEnabling() corresponds to C4DAtom::GetEnabling().

Usage

NodeData::GetDEnabling() is called with the DescID of each parameter. The function simply returns true if the given parameter should be enabled and false if the given parameter should be disabled.

Bool GetDEnabling(const GeListNode* node, const DescID& id, const GeData& t_data, DESCFLAGS_ENABLE flags, const BaseContainer* itemdesc) const
{
if (node == nullptr)
return false;
// check parameter ID
switch (id[0].id)
{
case EXAMPLE_GENERATOR_PARAMETER_VALUE:
{
// get the value of another parameter
GeData data;
node->GetParameter(ConstDescID(DescLevel(EXAMPLE_GENERATOR_PARAMETER_BOOL)), data, DESCFLAGS_GET::NONE);
// if true, then enable the parameter
// if not, disable the parameter
if (data.GetBool())
return true;
else
return false;
break;
}
}
return SUPER::GetDEnabling(node, id, t_data, flags, itemdesc);
}
NONE
Definition: asset_browser.h:1
PyCompilerFlags * flags
Definition: ast.h:14
DESCFLAGS_ENABLE
Definition: ge_prepass.h:3422
#define ConstDescID(...)
Definition: lib_description.h:596
maxon::Bool Bool
Definition: ge_sys_math.h:46
Definition: node.h:10

The arguments of the function are:

  • The node itself.
  • The parameter DescID in question.
  • The parameter value.
  • Some flags that are currently not used.
  • The parameter description stored in a BaseContainer.

Further Reading