Add curve support

This commit is contained in:
Carson Katri 2023-02-12 11:43:16 -05:00 • committed by Carson Katri
commit 467ae71ec6
6 changed files with 96 additions and 0 deletions

View file

@ -21,6 +21,7 @@
- [Input Groups](./api/advanced-scripting/input-groups.md)
- [Attributes](./api/advanced-scripting/attributes.md)
- [Boolean Math](./api/advanced-scripting/boolean-math.md)
- [Curves](./api/advanced-scripting/curves.md)
- [Drivers](./api/advanced-scripting/drivers.md)
- [Simulation](./api/advanced-scripting/simulation.md)

View file

@ -0,0 +1,32 @@
# Curves
Some nodes, such as *Float Curve* take a curve as a property. You can create a curve with the `Curve` class.
```python
float_curve(
mapping=Curve(
Point(0, 0),
Point(0.5, 0.25),
Point(1, 1, HandleType.VECTOR), # Optionally specify a handle type, such as `AUTO`, `VECTOR`, or `AUTO_CLAMPED`.
)
)
```
![](./float_curve.png)
You can also pass the points as a list to `Curve`.
```python
points = [Point(0, 0), Point(1, 1)]
float_curve(
mapping=Curve(points)
)
```
If a node has multiple curve properties, such as the *Vector Curves* node, pass a list of curves to the node.
```python
vector_curves(
mapping=[x_curve, y_curve, z_curve]
)
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB