About
FieldLayerData is the base class for custom field layers (FieldLayer)
A new FieldLayerData based class is registered with RegisterFieldLayerPlugin().
FieldLayerData
In a FieldLayerData based class the following functions can be implemented:
Register
A FieldLayerData based class has to be registered with RegisterFieldLayerPlugin(). The flags are:
- Note
- Modifier layers are registered with FIELDLAYER_DIRECT.
Example
{
public:
{
{
return nullptr;
}
return result;
}
{
if (layerBc.
GetParameter(FIELDLAYER_HUESHIFT_OFFSET, data) ==
false)
}
{
{
hue =
FMod(hue + _offset, 1.0);
}
}
{
}
{
return true;
}
private:
};
"Hue Shift Layer"_s,
"Changes the color hue."_s,
"Hue Shift Layer"_s,
HueShiftFieldLayer::Alloc,
"Flhueshift"_s,
nullptr,
0,
nullptr);
if (registerFieldLayerSuccess == false)
Further Reading
Bool RegisterFieldLayerPlugin(Int32 id, const maxon::String &name, const maxon::String &help, const maxon::String &pickInstruction, Int32 info, DataAllocator *g, const maxon::String &description, BaseBitmap *icon, Int32 disklevel, FieldLayerAcceptDragFunction *dragFunc=nullptr)
#define DebugStop(...)
Definition: debugdiagnostics.h:231
Definition: c4d_fielddata.h:1147
Definition: c4d_fieldplugin.h:108
virtual void FreeSampling(FieldLayer &layer, const FieldInfo &info, FieldShared &shared)
Definition: c4d_fieldplugin.h:162
maxon::Int Int
Definition: ge_sys_math.h:64
virtual maxon::Result< void > InitSampling(FieldLayer &layer, const FieldInfo &info, FieldShared &shared)
Definition: c4d_fieldplugin.h:126
#define FIELDLAYER_NOVALUEOUT
The FieldLayer doesn't calculate values.
Definition: ge_prepass.h:956
#define FIELDLAYER_NOROTATIONOUT
The FieldLayer doesn't calculate rotational velocities.
Definition: ge_prepass.h:962
Definition: c4d_fielddata.h:338
virtual Bool IsEqual(const FieldLayer &layer, const FieldLayerData &comp) const
Definition: c4d_fieldplugin.h:171
maxon::Float Float
Definition: ge_sys_math.h:66
Float32 FMod(Float32 v1, Float32 v2)
Definition: apibasemath.h:183
#define FIELDLAYER_PREMULTIPLIED
The FieldLayer will receive FieldOutputBlock data premultiplied by alpha values.
Definition: ge_prepass.h:961
return OK
Definition: apibase.h:2620
virtual maxon::Result< void > Sample(const FieldLayer &layer, const FieldInput &inputs, FieldOutputBlock &outputs, const FieldInfo &info) const =0
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:67
Thread local information for this field sample invocation.
Definition: c4d_fielddata.h:900
Definition: c4d_nodedata.h:38
Bool GetParameter(const DescID &id, GeData &t_data) const
Definition: c4d_basecontainer.h:628
const BaseContainer & GetDataInstanceRef() const
Definition: c4d_baselist.h:2329
Definition: c4d_fielddata.h:474
Definition: c4d_gedata.h:82
#define INSTANCEOF(X, Y)
Definition: c4d_baselist.h:38
#define NewObj(T,...)
Definition: newobj.h:108
#define iferr(...)
Definition: errorbase.h:388
maxon::Block< Vector > _color
The alpha value for color and direction at this point in space, only available when color or directio...
Definition: c4d_fielddata.h:459
maxon::Bool Bool
Definition: ge_sys_math.h:55
#define FIELDLAYER_NODIRECTIONOUT
The FieldLayer doesn't calculate directions.
Definition: ge_prepass.h:958
Definition: c4d_basecontainer.h:46
#define FIELDLAYER_DIRECT
The FieldLayer will have access to directly manipulate the 'result' data in ModifyValues rather than ...
Definition: ge_prepass.h:954
Float GetFloat(void) const
Definition: c4d_gedata.h:439