From 391d74ec6144a1ff174417df6423df8465ceb36b Mon Sep 17 00:00:00 2001 From: Carson Katri Date: Sat, 19 Nov 2022 15:04:36 -0500 Subject: [PATCH] Document input group prefixes --- book/src/api/advanced-scripting/input-groups.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/book/src/api/advanced-scripting/input-groups.md b/book/src/api/advanced-scripting/input-groups.md index f5667f5..66b5902 100644 --- a/book/src/api/advanced-scripting/input-groups.md +++ b/book/src/api/advanced-scripting/input-groups.md @@ -72,4 +72,21 @@ def point_terrain(): w=0 ) ).mesh_to_points() +``` + +## Input Group Prefix + +If you use the same `InputGroup` multiple times, you need to provide a prefix. Otherwise, inputs with duplicate names will be created on your tree. + +To do this, use square brackets next to the annotation with a string for the prefix. + +```python +def mountain_or_canyon( + mountain_inputs: TerrainInputs["Mountain"], # Prefixed with 'Mountain' + canyon_inputs: TerrainInputs["Canyon"], # Prefixed with 'Canyon' + is_mountain: Bool +): + return terrain_generator( + inputs=switch(switch=is_mountain, true=mountain_inputs, false=canyon_inputs) + ) ``` \ No newline at end of file