Add InputGroup to simplify large sets of inputs
This commit is contained in:
parent
e7bae54662
commit
aa11b398a0
4 changed files with 51 additions and 8 deletions
17
api/static/input_group.py
Normal file
17
api/static/input_group.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
class InputGroup:
|
||||
"""
|
||||
A group of inputs that will be expanded in the node tree.
|
||||
|
||||
All properties must be annotated:
|
||||
```python
|
||||
class MyInputGroup(InputGroup):
|
||||
my_float: Float
|
||||
my_bool: Bool
|
||||
my_string # Invalid
|
||||
```
|
||||
"""
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
for p in dir(self):
|
||||
if p in kwargs:
|
||||
setattr(self, p, kwargs[p])
|
||||
Reference in a new issue