CurveEditor¶
CurveEditor edits a NumberSequence, the curve used by particles, beams and trails. It is a plot of a smooth curve with keypoints you can drag, tangent handles to shape it, and number fields for the selected keypoint.
Usage¶
Call Components.CurveEditor with a scope and a table of properties:
local curve = scope:Value(NumberSequence.new(0, 1))
C.CurveEditor(scope, {
Value = curve, -- (1)!
Min = 0,
Max = 1,
ShowEnvelope = true,
})
- A
Valueand the editor follow each other. Assigncurve:get()to aParticleEmitter.Size, for example. ANumberSequenceis a list of straight pieces, so the curve is sampled into up to 20 keypoints, spread over the curved segments.
Editing¶
- Drag a keypoint to move it. The first keypoint stays at time
0and the last at time1, and a keypoint cannot pass its neighbours. - Select a keypoint to show its two tangent handles (the diamonds). Drag one to bend the curve. Keypoints you have not shaped get smooth tangents that follow their neighbours and stay flat at peaks.
- Double click the plot to add a keypoint. It starts on the curve and splits it where it is, so the curve does not change.
- Select a keypoint and press the trash button, or focus it and press Delete, to remove it. The first and last keypoints cannot be removed.
- The fields under the plot edit the selected keypoint:
Tis its time,Vits value and±its envelope, whenShowEnvelopeis on. - A focused keypoint moves with the arrow keys.
Properties¶
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
Id |
string |
- | Key that identifies this component when state is kept across rebuilds. See Persist. |