Skip to content

Commit 840701d

Browse files
committed
Document named outputs syntax
1 parent 16a11e9 commit 840701d

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed
Loading

book/src/api/basics/tree-functions.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,19 @@ def cube_tree():
4141

4242
![](./cube_tree_int.png)
4343

44+
By default, each output is named 'Result'. To customize the name, return a dictionary.
45+
46+
```python
47+
@tree("Cube Tree")
48+
def cube_tree():
49+
return {
50+
"My Cube": cube(),
51+
"Scale Constant": 5
52+
}
53+
```
54+
55+
![](./cube_tree_named_outputs.png)
56+
4457
## Group Input
4558
All arguments in a tree function must be annotated with a valid socket type. These types are provided by Geometry Script, and are not equivalent to Python's built-in types. Let's add a size argument to our Cube Tree.
4659

0 commit comments

Comments
 (0)