About
NodeData based classic plugin classes can implement NodeData::SetDParameter(). This allows to change parameters that are set and it allows to react to this event. This is typically done to handle data that is not stored in the object's BaseContainer. It is also used to change parameter values when another parameter was changed.
NodeData::SetDParameter() corresponds to C4DAtom::SetParameter().
- Note
- In most cases, when implementing NodeData::SetDParameter(), one will also need to implement NodeData::GetDParameter(). For example, if the value is stored in a member variable.
Usage
NodeData::SetDParameter() is called when the value of a parameter is set with C4DAtom::SetParameter(). It is possible to change this value before it is stored in the element's BaseContainer.
{
return false;
switch (id[0].id)
{
case EXAMPLE_GENERATOR_PARAMETER_NOT_BC:
{
return true;
}
case EXAMPLE_GENERATOR_PARAMETER_VALUE:
{
break;
}
}
return SUPER::SetDParameter(
node,
id, t_data,
flags);
}
PyCompilerFlags * flags
Definition: ast.h:14
Definition: lib_description.h:355
Definition: c4d_gedata.h:83
Int32 GetInt32() const
Definition: c4d_gedata.h:456
Represents a C4DAtom that resides in a 4D list.
Definition: c4d_baselist.h:1975
maxon::Bool Bool
Definition: ge_sys_math.h:51
maxon::Int32 Int32
Definition: ge_sys_math.h:56
DESCFLAGS_SET
Definition: ge_prepass.h:3364
@ PARAM_SET
Parameter set.
#define ConstDescID(...)
Definition: lib_description.h:594
Represents a level within a DescID.
Definition: lib_description.h:298
- Note
- Such member variables must also be handled in NodeData::Read(), NodeData::Write(), NodeData::CopyTo() and NodeData::GetDParameter().
The arguments of the function are:
- The node itself.
- The parameter DescID in question.
- The value of the parameter as GeData object
- These flags:
If the parameter is set through user-interaction in the Attribute Manager the message MSG_DESCRIPTION_POSTSETPARAMETER will be sent to the element. See also Interaction.
Certain cases have to be handled with special functions:
- Note
- It is not safe to call DrawViews() from NodeData::SetDParameter().
Further Reading