Python Field Object / Layer¶
It’s possible to create a Python Field Object and a Python Field Layer. The main differences are:
A Python Field Object is an object within the scene (this means that it gets a position the user can define).
A Python Field Object is independent (this means it can’t retrieves previous fields values from a
A Python Field Layer is not an object exposed in the scene, it only exists in a
c4d.FieldList, which is, most of the time, owned by an object.
A Python Field Layer can retrieves previous
Python Field Object can be found in the Create Menu -> Field -> Python Field or in the falloff tab of some objects.
Python Field Layer can be found in the falloff tab of some objects.
A Python Field Object/ Layer should not create/modify objects in the scene.
The important Threading Information.
- Override - Optional method, called once before all sampling occurs. Usually used to allocate or create objects.It can be called multiple time per frame.
If global variables are allocated it’s mandatory to free them in
Sample(op, inputs, outputs, info)
- Override - called for each FieldOutputBlock. FieldOutput values should be defined in this function.It can be called multiple time per frame.
In a Python Field Layer only, output variable is already populated with previous values of the
c4d.modules.mograph.FieldObject.) – The Python Field Object / Layer.
c4d.modules.mograph.FieldInput.) – The FieldInput linked to the current sampling pass.
FieldOutput.) – The FieldOutput to be feded with data, linked to the current sampling pass.
FieldInfo.) – The FieldInfo linked to the current sampling pass.
Override - called once after all sampling has occurred. Usually used to clean object created in
InitSampling(). It can be called multiple time per frame.