Create fluid sim
create_fluid_simCreate a real-time 2D fluid simulation in TouchDesigner with controllable dye, viscosity, and audio-reactive injection, outputting node paths and a preview image.
Instructions
Build a real-time 2D fluid/ink/dye simulation (stable-fluids style: semi-Lagrangian advection + Jacobi pressure solve + gradient-subtract projection + dye advection) as a stack of GLSL TOPs in feedback loops inside a new baseCOMP under parent_path. Exposes artist-facing controls (dye color, injection radius/strength, viscosity, dissipation, pressure iterations, inject U/V) and optionally binds a CHOP at audio_path so audio drives the dye injection strength. With injection_mode='auto', a slow LFO drives the splat point so the sim shows life with no input. Returns a summary plus a JSON block with the container path, created node paths, the dye_out output path, exposed controls, any node errors, warnings, and an inline preview image.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "create_fluid_sim"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dye_color | No | Injected dye color as a '#rrggbb' hex string. | #ff3a8c |
| viscosity | No | Velocity dissipation per frame (0–1). Higher = thicker fluid. | |
| audio_path | No | Optional CHOP path; channel 0 multiplies injection strength when set. | |
| resolution | No | Sim grid resolution (square). 512 is safe on integrated GPUs. | 512 |
| dissipation | No | Dye decay per frame (0.9–1.0). <1 fades trails. | |
| parent_path | No | Parent network where the fluid_sim container is created. | /project1 |
| injection_mode | No | How the splat point/strength is driven. | auto |
| expose_controls | No | Auto-expose an artist-facing control panel on the container. | |
| injection_radius | No | Radius of the dye/force splat in UV units (0.01–0.5). | |
| injection_strength | No | Multiplier on dye + velocity splat per frame (0–2). | |
| pressure_iterations | No | Jacobi iterations per frame (1–60). Higher = more incompressible. |