Wrangle

Advanced VEX interface. Emit attributes, define gates, or prototype effectors directly into the Apex graph.

The Wrangle node provides a VEX interface into the procedural graph.

  • Deferred Execution: Runs on active growth tips during simulation, not on static geometry.
  • Attribute Authoring: The primary way to create custom attributes for mappings, gates, and effectors.
  • Environment Awareness: Can sample external Houdini geometry (SDFs, attributes) to guide growth.

Concept

Graph-Level VEX Unlike a standard SOP Wrangle, this node operates within the Natsura solver loop. It allows you to modify the state of the growing skeleton.

Upstream Flow Attributes you create here flow upstream to parent nodes and sockets. For example, if you set f@my_bend in a Wrangle, you can use it in a Map connected to a Grow node's Pitch socket.


Inputs

  • Input 0 — Graph The Apex graph. Wrangle runs on the active tips.
  • Input 1 — Skeleton (Optional) The full simulated skeleton (if enabled). Useful for nearpoints() queries.
  • Input 2+ — Geometry (Optional) Standard Houdini geometry/volumes for environment sampling.
  • Output — Graph The modified graph.

Parameters

  • Graph Snippet: The VEX code to execute.
  • Graph Attributes: Registers new attributes so they appear in Natsura's UI (dropdowns, sockets).
  • Connect Main: Feeds the simulation output back into Input 1 for self-queries.

Attributes

Read/Write

  • id, parent_id, generation
  • u, age, width, internode_length
  • P, N, up (modifying these affects growth direction)

Custom You can create any attribute (e.g., f@density, i@kill) and use it downstream.


Workflow

  1. Insert a Wrangle node in your graph.
  2. Write VEX code to calculate a value (e.g., sample a noise field).
  3. Store it in an attribute (e.g., f@noise_val).
  4. (Optional) Register noise_val in the Graph Attributes multiparm.
  5. Use noise_val in a Map or Switch to drive logic.

NodeRelationship
GrowPrimary consumer of Wrangle attributes
MapMaps Wrangle attributes to parameters
PruneUses Wrangle attributes for conditions