Python Modifier

Summary

With this modifier, you can arrange for Python code to be executed when a particle is within the modifier's field of effect. You have access to the particle data, which enables you to change the data in any way you like.

Interface

This is the modifier's interface:

For the 'Groups Affected' and 'Falloff' tabs, and for the buttons at the bottom of the interface, please see the 'Common interface elements' page.

Parameters

Enabled

Uncheck this switch to disable the modifier.

Mode

Independent [default setting]

In this mode, the modifier will work in the same way as a standard Cinema 4D particle modifier: particles will be affected if they come into the field of effect of the modifier. X-Particle Actions have no effect on the modifier in this mode.

Action-Controlled

In this mode, the modifier will only act on a particle when told to do so by an Action. Until that point, the particle will not be affected, but once activated for a particular particle, the modifier will continue to influence it as long as it is in the field of effect of the modifier. The modifier's effect on a particle can be halted by means of another Action, if desired.

Visible in editor

To make the modifier invisible in the editor, but still active, check this switch.

Script

This is where you enter the Python script to be carried out. A simple default script is provided. To see how to use this, see the page 'Using Python in X-Particles'.

Open Editor...

This button opens the Cinema 4D script editor, which provides a better coding environment for writing your scripts. When you finish with the editor, simply close it and the Script field in the modifier will be updated automatically (this sometimes seems to take a few seconds).