61 lines
887 B
Markdown
61 lines
887 B
Markdown
|
# NODE_REGISTRY
|
||
|
|
||
|
# How to store nodes in the registry?
|
||
|
|
||
|
The nodes need:
|
||
|
|
||
|
## ID: string/string/string
|
||
|
I could imagine something like jimfx/nature/branch
|
||
|
|
||
|
## INPUTS:
|
||
|
We need a way to define how the UI should render the input ui. Could be something like:
|
||
|
|
||
|
```json
|
||
|
{
|
||
|
"inputs": [
|
||
|
“a”: {
|
||
|
“type”: “select”,
|
||
|
“options”: [
|
||
|
“curly”,
|
||
|
“straight”
|
||
|
]
|
||
|
},
|
||
|
"b": {
|
||
|
"type":"float",
|
||
|
"value": 0.5,
|
||
|
"max": 10.0,
|
||
|
"min": 0
|
||
|
},
|
||
|
"res":{
|
||
|
"type": "integer",
|
||
|
"value": 5,
|
||
|
"setting":"leaves/resolution"
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
```
|
||
|
|
||
|
## OUTPUTS
|
||
|
The nodes output, could look something like this:
|
||
|
|
||
|
```json
|
||
|
{
|
||
|
"outputs": ["stem","float"]
|
||
|
}
|
||
|
```
|
||
|
|
||
|
# How to store serialized nodes
|
||
|
|
||
|
```json
|
||
|
{
|
||
|
"id":"jimfx/nature/branch",
|
||
|
"inputs": [0,8.4],
|
||
|
"position": [0.6, 10]
|
||
|
"meta": {
|
||
|
"title":"Branch Node"
|
||
|
}
|
||
|
}
|
||
|
```
|
||
|
|
||
|
|