About
NodeData based classic plugin classes can implement NodeData::GetDParameter(). This allows to define the values of parameters accessed with C4DAtom::GetParameter(). This is done to handle data that is not stored in the object's BaseContainer. It is also used to create parameters that depend on the value of other parameters or element properties.
NodeData::GetDParameter() corresponds to C4DAtom::GetParameter().
- Note
- In most cases, when implementing NodeData::GetDParameter(), one will also need to implement NodeData::SetDParameter(). For example, if the value is stored in a member variable.
Usage
NodeData::GetDParameter() is called when the value of a parameter is accessed with C4DAtom::GetParameter(). It is possible to define or change the returned value.
{
return false;
switch (id[0].id)
{
case EXAMPLE_GENERATOR_PARAMETER_NOT_BC:
{
return true;
}
}
return SUPER::GetDParameter(
node,
id, t_data,
flags);
}
PyCompilerFlags * flags
Definition: ast.h:14
Definition: lib_description.h:355
Definition: c4d_gedata.h:83
void SetInt32(Int32 v)
Definition: c4d_gedata.h:645
Represents a C4DAtom that resides in a 4D list.
Definition: c4d_baselist.h:1844
maxon::Bool Bool
Definition: ge_sys_math.h:55
DESCFLAGS_GET
Definition: ge_prepass.h:3317
@ PARAM_GET
Parameter retrieved.
- Note
- Such member variables must also be handled in NodeData::Read(), NodeData::Write(), NodeData::CopyTo() and NodeData::SetDParameter().
The arguments of the function are:
- The node itself.
- The parameter DescID in question.
- A GeData object to return the read parameter value.
- These flags:
Certain cases have to be handled with special functions:
Further Examples
{
return false;
switch (id[0].id)
{
case EXAMPLE_TAG_VOLUME:
{
if (tag != nullptr)
{
if (hostObject != nullptr)
{
{
{
volume = (4.0 / 3.0) *
maxon::PI * radius * radius * radius;
break;
}
{
volume =
maxon::PI * radius * radius * height;
break;
}
default: break;
}
}
}
return true;
}
}
return SUPER::GetDParameter(
node,
id, t_data,
flags);
}
Definition: c4d_baseobject.h:248
Definition: c4d_basetag.h:50
BaseObject * GetObject()
Definition: c4d_basetag.h:100
Bool GetParameter(const DescID &id, GeData &t_data, DESCFLAGS_GET flags) const
Int32 GetType() const
Definition: c4d_baselist.h:1412
void SetFloat(Float v)
Definition: c4d_gedata.h:639
Float GetFloat() const
Definition: c4d_gedata.h:468
maxon::Float Float
Definition: ge_sys_math.h:66
static constexpr Float64 PI
floating point constant: PI
Definition: apibasemath.h:139
#define Ocylinder
Cylinder.
Definition: ge_prepass.h:1121
#define Osphere
Sphere.
Definition: ge_prepass.h:1111
#define ConstDescID(...)
Definition: lib_description.h:594
@ PRIM_CYLINDER_HEIGHT
Definition: ocylinder.h:13
@ PRIM_CYLINDER_RADIUS
Definition: ocylinder.h:8
@ PRIM_SPHERE_RAD
Definition: osphere.h:6
Represents a level within a DescID.
Definition: lib_description.h:298
Further Reading