Add curve support
This commit is contained in:
parent
1ffed55184
commit
467ae71ec6
6 changed files with 96 additions and 0 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
32
book/src/api/advanced-scripting/curves.md
Normal file
32
book/src/api/advanced-scripting/curves.md
Normal 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`.
|
||||
)
|
||||
)
|
||||
```
|
||||
|
||||

|
||||
|
||||
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]
|
||||
)
|
||||
```
|
||||
BIN
book/src/api/advanced-scripting/float_curve.png
Normal file
BIN
book/src/api/advanced-scripting/float_curve.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
Reference in a new issue