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:230
Definition: c4d_fielddata.h:1125
Definition: c4d_fieldplugin.h:104
virtual void FreeSampling(FieldLayer &layer, const FieldInfo &info, FieldShared &shared)
Definition: c4d_fieldplugin.h:158
maxon::Int Int
Definition: ge_sys_math.h:49
virtual maxon::Result< void > InitSampling(FieldLayer &layer, const FieldInfo &info, FieldShared &shared)
Definition: c4d_fieldplugin.h:122
#define FIELDLAYER_NOVALUEOUT
The FieldLayer doesn't calculate values.
Definition: ge_prepass.h:918
#define FIELDLAYER_NOROTATIONOUT
The FieldLayer doesn't calculate rotational velocities.
Definition: ge_prepass.h:924
Definition: c4d_fielddata.h:339
virtual Bool IsEqual(const FieldLayer &layer, const FieldLayerData &comp) const
Definition: c4d_fieldplugin.h:167
maxon::Float Float
Definition: ge_sys_math.h:51
Float32 FMod(Float32 v1, Float32 v2)
Definition: apibasemath.h:207
#define FIELDLAYER_PREMULTIPLIED
The FieldLayer will receive FieldOutputBlock data premultiplied by alpha values.
Definition: ge_prepass.h:923
return OK
Definition: apibase.h:2462
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:66
Thread local information for this field sample invocation.
Definition: c4d_fielddata.h:888
Definition: c4d_nodedata.h:34
Bool GetParameter(const DescID &id, GeData &t_data) const
Definition: c4d_basecontainer.h:624
const BaseContainer & GetDataInstanceRef() const
Definition: c4d_baselist.h:2240
Definition: c4d_fielddata.h:475
Definition: c4d_gedata.h:77
#define INSTANCEOF(X, Y)
Definition: c4d_baselist.h:26
#define NewObj(T,...)
Definition: newobj.h:108
#define iferr(...)
Definition: errorbase.h:487
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:460
maxon::Bool Bool
Definition: ge_sys_math.h:40
#define FIELDLAYER_NODIRECTIONOUT
The FieldLayer doesn't calculate directions.
Definition: ge_prepass.h:920
Definition: c4d_basecontainer.h:42
#define FIELDLAYER_DIRECT
The FieldLayer will have access to directly manipulate the 'result' data in ModifyValues rather than ...
Definition: ge_prepass.h:916
Float GetFloat(void) const
Definition: c4d_gedata.h:423