Natsura Prune

Removes branches during growth by re-testing conditions across multiple cycles, simulating natural die-back and self-pruning.
This node is experimental.
The Prune node removes existing branches when certain conditions are met.
  • Conditional Removal: Evaluates attributes on internodes and marks them for deletion.
  • Time-Varying: Can re-evaluate conditions over multiple cycles, allowing branches to be pruned later in their life (e.g., when they get too old or crowded).
  • Delayed: Supports a start delay to allow initial growth before pruning begins.
== Concept ===== Iterative Evaluation ===Unlike a one-shot filter, Prune is designed to work within the iterative growth loop. It checks every internode against its rules multiple times (Test Lifetime), allowing for dynamic behaviors like "survival of the fittest" where branches compete for space over time.=== Conditions ===Pruning logic can be simple (Thresholds) or complex (Snippets/Wrangles).
  • Threshold: Height > 10
  • Attribute: Width < Length
  • Mapping: Density > Map(u)
Unlike Kill (which halts future growth immediately), Prune re-evaluates over time -- branches can survive for several cycles before being removed if conditions persist.Two testing modes are available: Threshold compares an attribute against a value, while Expression evaluates a custom rule. The Test Lifetime parameter controls how many cycles the condition is checked, and Start Delay lets branches grow for a period before testing begins -- mimicking how real trees grow branches first and shed them later as light competition increases.

Inputs

Input 0 -- Graph: The incoming Apex graph.

Outputs

Output -- Graph: The graph with pruned internodes removed.

Parameters

Overview

Concept

Iterative Evaluation

Conditions

Parameters

Condition

Use Expression : Threshold: Removes components based on attribute or value thresholds.Snippet: Removes components based on a custom VEX snippet condition.

Threshold

Compare Attribute : Specifies the attribute name for the first operand (used when Type A is Attribute). Common choices include height, age, u, generation.operation : Options: ==, !=, >, >=, <, <=.graph_type_b : Gate Value: A constant value for comparison.Attribute: A specific attribute from the plant structure.Test Value : Specifies the constant value for the second operand (used when Type B is Gate Value). Range: 0-10.Test Attribute : Specifies the attribute name for the second operand (used when Type B is Attribute).

Snippet

Prune Snippet : Inline VEX for custom logic (e.g., f@height > 5).

Prune Cycle Settings

Test Lifetime : Defines the number of iterations for pruning operations, allowing progressive refinement. Controls how many times the condition is re-evaluated for each internode. Range: 0-10.Start Delay : Specifies the time delay (in steps/iterations) before pruning takes effect. Useful for allowing initial growth before evaluation begins. Range: 0-10.
  • Grow Node — Generates the geometry to be pruned. The primary node for procedural growth.
  • Wrangle Node — Calculates custom attributes for pruning logic. Write VEX to compute density, shading, or other metrics.
  • Switch Node — Alternative gating (stops growth instead of removing it). Enables transitions between different growth behaviors based on attribute-driven thresholds.
  • Split Node — Creates explicit parallel branches in the graph topology.
  • 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.
@attributes== Attributes ==Prune consumes attributes but does not typically emit new ones.Common inputs: height, age, u, generation, density (custom).@workflow== Workflow ==
  1. Place a Prune node after your growth logic (e.g., inside a Repeat block).
  2. Select an attribute to test (e.g., height).
  3. Set the condition (e.g., > 5.0).
  4. (Optional) Use a Wrangle before the Prune node to calculate complex metrics like "local density" and store them in an attribute for Prune to check.
  5. Adjust Test Lifetime to control how many cycles the condition is re-evaluated.
  6. Use Start Delay to allow initial growth before pruning begins.
@applications== Applications ==
  • Natural Die-Back: Simulate how trees shed lower branches as the canopy grows and light competition increases.
  • Density Control: Remove excess branches to maintain a target density in dense growth patterns.
  • Age-Based Cleanup: Prune old or stagnant branches that exceed a certain age threshold.
  • Conditional Thinning: Use custom attributes (via Wrangle) to selectively remove branches based on complex criteria.
@notes
  • Iterative Nature: Prune re-evaluates conditions over multiple cycles, unlike Kill which acts immediately. This makes it suitable for gradual die-back behaviors.
  • Integration with Wrangle: For complex pruning logic, calculate custom attributes in a Wrangle node upstream and use them as the test attribute in Prune.
  • Start Delay: Use this to let branches establish before testing begins, mimicking natural growth-then-shed patterns.