Add InputGroup to simplify large sets of inputs

This commit is contained in:
Carson Katri 2022-11-17 18:13:07 -05:00
commit aa11b398a0
4 changed files with 51 additions and 8 deletions

17
api/static/input_group.py Normal file
View 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])