Natsura Wrangle
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
== 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
Overview
Concept
Graph-Level VEX
Upstream Flow
Parameters
Attributes
Graph Attributes : Registers new attributes so they appear in Natsura's UI (dropdowns, sockets). Dynamically manage attributes available for use in custom growth logic.
Attribute : Name of the attribute being manipulated.
Value : Value assigned to the attribute.
Mapped Attribute : Reference external mappings or relationships dynamically.
VEX Code
Graph Snippet : The VEX code to execute. Write VEX code for dynamic evaluations, custom solvers, environmental responses, or attribute-driven adjustments.
Connections
Connect Main : Feeds the simulation output back into Input 1 for self-queries. Enable toggling for main graph connections.
Related
- Grow Node — Primary consumer of Wrangle attributes. Incrementally creates plant structures by defining the size, shape, and direction of individual branches.
- Map Node — Maps Wrangle attributes to parameters for dynamic control.
- Prune Node — Uses Wrangle attributes for conditions. Removes components of the plant structure to simulate natural shedding or manual trimming.
- Split Node — Enables axillary branching by splitting growth into separate paths.
- Repeat Node — Reevaluates Grow over multiple iterations to generate branching hierarchies.
- Signal Node — Guides plant growth using external data such as vector fields or collision geometry.
- Simulate Node — Processes the procedural graph and environmental inputs to generate complete plant structures.
- Switch Node — Enables transitions between different growth behaviors based on attribute-driven thresholds.
@intro
Getting Started
If you're new to the Natsura toolkit, begin by visiting the Overview|../../natsura/index. The index provides a comprehensive overview of the system, including descriptions of all nodes and how they work together to create procedural plant models. It's the ideal starting point for understanding core concepts and deciding which nodes to explore first.
@attributes
== Attributes ==
=== Read/Write ===
The following built-in attributes are available for reading and writing:
id,parent_id,generationu,age,width,internode_lengthP,N,up(modifying these affects growth direction)
=== Custom ===
You can create any attribute (e.g., f@density, i@kill) and use it downstream in Map or Switch nodes.
@workflow
== Workflow ==
- Insert a Wrangle node in your graph.
- Write VEX code to calculate a value (e.g., sample a noise field).
- Store it in an attribute (e.g.,
f@noise_val). - (Optional) Register
noise_valin the Graph Attributes multiparm. - Use
noise_valin a Map or Switch to drive logic.
@applications
== Applications ==
- Dynamic Growth Models: Use procedural rules to create responsive and adaptable plant structures.
- Simulation Optimization: Replace complex node chains with efficient, script-based operations.
- Environmental Adaptation: Incorporate factors like light exposure, gravity, or collisions directly into growth logic.
- Attribute Authoring: Create custom attributes consumed by Map and Switch nodes downstream.
@notes
- Flexibility: Allows unparalleled customization in procedural workflows.
- Advanced Users: Requires familiarity with VEX scripting to maximize its potential.
- Deferred Execution: Runs within the solver loop on active growth tips, not as a standard SOP operation.
- Upstream Flow: Attributes created here are available to upstream nodes via sockets and mappings.