Magnetize

Summary

The Magnetize applies magnetic forces to each instance based on magnet positions. Each magnet can repulse, attract, or spin instances around them within a specified search radius, creating dynamic force-based effects.

Magnet positions can be specified either through a second input connection or via the Magnets POP parameter. Supports three force modes: Repulse (push away), Attract (pull toward), and Spin (rotate around magnets).

Effect intensity is controlled by the Search Radius, Effect Radius, and Force Strength parameters. Optional falloff-based modulation enables spatially varying magnetic effects.

Multiple Magnet Fields: Magnets can be specified via the Magnets POP parameter or Input 1, where each point defines a separate magnet field - one point per magnet. The attributes of the magnet POP are named the same as parameter tokens in the Magnetize operator, and override the parameters for each magnet. Menus and toggles are represented as integers, starting at 0 for the first menu entry. You need only to create a Point POP with attributes named as the Magnetize parameters, and then add a point per magnet, and set their values. (An attribute radius will override the Effect Radius (Radius) parameter.) Alternately you can generate points procedurally with attributes that match the Magnetize parameter names. The workflow is the same as multiple strings defined in a specification DAT of the Geo Text COMP and the Text COMP.

Parameters

Page: Magnetize

Group Group If there are input groups, specifying a group name in this field will cause this POPX to act only upon the group specified.
Solver Mode Solvermode Determines the computation mode for magnetic forces.
Simple simple
Advect advect
Magnets POP Magnetspop Reference to a POP containing points that define magnet positions and attributes when no second input is connected.
Display Magents Displaymagents Enables visual display of magnet positions in the viewport.
Do Falloff Dofalloff Enables falloff-based magnetic force intensity control.
Falloff Attribute Falloffattr Specifies which attribute to use for falloff values that modulate magnetic force strength.
Initial POP Initialpop Reference to a POP containing initial positions for Simple solver mode.
Search Radius Searchradius Maximum distance from magnets within which instances are affected by magnetic forces.
Relaxation Factor Relaxfactor Controls the smoothness and damping of magnetic force application over time.
Force Mode Mode Determines the type of magnetic force: Repulse, Attract, or Spin. Can be overridden per-magnet using a mode point attribute.
Repulse repulse
Attract attract
Spin spin
Position Position Position of the magnet in 3D space. Can be overridden per-magnet using a P point attribute.
Position Positionx
Position Positiony
Position Positionz
Effect Radius Radius Radius of influence for each magnet. Can be overridden per-magnet using a radius point attribute.
Force Strength Strength Intensity of magnetic forces applied to instances. Can be overridden per-magnet using a strength point attribute.
Exponent Exponent Controls the falloff curve of magnetic force with distance. Can be overridden per-magnet using an exponent point attribute.
Spin Direction Spindir Spin rotation direction vector. Can be controlled per-magnet using a spindir point attribute.
Spin Direction Spindirx
Spin Direction Spindiry
Spin Direction Spindirz
Containment Contain Controls how strongly instances are kept within the magnetic field bounds. Can be overridden per-magnet using a contain point attribute.
Affect Position Affectpos Enables position changes based on magnetic forces.
Move Weight Moveweight Controls the intensity of position movement when Affect Position is enabled.
Affect Rotation Affectrot Enables rotation changes based on magnetic force direction.
Aim Weight Aimweight Controls how quickly instances rotate toward their direction of motion when Affect Rotation is enabled.
Output Force Attribute Outputforceattr Outputs a force attribute showing the magnetic force vector applied to each instance.
Output Weight Attribute Outputweightattr Outputs a weight attribute showing the strength of magnetic influence on each instance.
Initialize Initializepulse Resets the simulation state to initial conditions.
Start Startpulse Begins the simulation from the current state.
Play Play Toggles simulation playback on or off.

Page: Common

Bypass Bypass Pass through the first input to the output unchanged.
Free Extra GPU Memory Freeextragpumem Free memory that has accumulated when output memory has grown and shrunk.
Render Primitives Renderprimitives Toggles rendering of POPX Geometry or shows it as point instances only.
SRT / RST Srtrst Sets the transform order when using POPX Geometry as built-in TouchDesigner instances.

Inputs

Input 0 POP POPX/POP Geometry
Input 1 POP Magnets

Outputs

Output 0 POP POPX_out1