Skip to content

Commit 391d74e

Browse files
committed
Document input group prefixes
1 parent 66ade0a commit 391d74e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

book/src/api/advanced-scripting/input-groups.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,21 @@ def point_terrain():
7272
w=0
7373
)
7474
).mesh_to_points()
75+
```
76+
77+
## Input Group Prefix
78+
79+
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.
80+
81+
To do this, use square brackets next to the annotation with a string for the prefix.
82+
83+
```python
84+
def mountain_or_canyon(
85+
mountain_inputs: TerrainInputs["Mountain"], # Prefixed with 'Mountain'
86+
canyon_inputs: TerrainInputs["Canyon"], # Prefixed with 'Canyon'
87+
is_mountain: Bool
88+
):
89+
return terrain_generator(
90+
inputs=switch(switch=is_mountain, true=mountain_inputs, false=canyon_inputs)
91+
)
7592
```

0 commit comments

Comments
 (0)