CurveEditorclass
Edits a Curve, CurveRange or named collection of curves. Keys retain the normalized coordinates used by Curve.Frame; numeric fields and axes display actual time and value units. View navigation never edits data.
Constructors1
Showing 1 constructors
public CurveEditor()
No results match this filter.
Methods23
Showing 23 methods
public void AddKey(float time, float value)
Add a normalized key to the active curve. Near-duplicate times select the existing key.
| Parameter | Type | Description |
|---|---|---|
| time | float | — |
| value | float | — |
void—public void ApplyPreset(Sandbox.Curve preset, bool includeRanges = False)
Replace the active curve's keys, optionally applying the preset's axis ranges too.
| Parameter | Type | Description |
|---|---|---|
| preset | Curve | — |
| includeRanges = False | bool | — |
void—public void DeletePreset(int index)
Remove a saved preset.
| Parameter | Type | Description |
|---|---|---|
| index | int | — |
void—public void FitSelection()
void—public void FitView()
void—public void InsertKey(float time)
Split the curve at a normalized time while retaining its shape, including stepped and linear segments.
| Parameter | Type | Description |
|---|---|---|
| time | float | — |
void—public void MoveKey(int index, float time, float value)
Move one key, clamping its time before either neighbour.
| Parameter | Type | Description |
|---|---|---|
| index | int | — |
| time | float | — |
| value | float | — |
void—public void MoveSelection(Vector2 delta)
Translate the selection by a delta in curve A's normalized display space, keeping group spacing intact.
| Parameter | Type | Description |
|---|---|---|
| delta | Vector2 | — |
void—public virtual void OnButtonTyped(Sandbox.UI.ButtonEvent e)
| Parameter | Type | Description |
|---|---|---|
| e | ButtonEvent | — |
void—public void Redo()
void—public void RemoveSelected()
Delete selected keys while keeping at least one key per populated boundary.
void—public void ReplacePreset(int index)
Replace a saved preset with the active curve.
| Parameter | Type | Description |
|---|---|---|
| index | int | — |
void—public void SavePreset()
Save the active curve, including its axis ranges, as a reusable preset.
void—public void SelectAll()
void—public void SelectCurve(int index)
Select a boundary without changing its data or the view.
| Parameter | Type | Description |
|---|---|---|
| index | int | — |
void—public void SelectKey(int index)
| Parameter | Type | Description |
|---|---|---|
| index | int | — |
void—public void SelectKeys(System.Collections.Generic.IEnumerable`1<Sandbox.UI.CurveEditor.CurveKey> keys)
| Parameter | Type | Description |
|---|---|---|
| keys | IEnumerable<CurveKey> | — |
void—public void SetKeyMode(int index, Sandbox.Curve.HandleMode mode)
| Parameter | Type | Description |
|---|---|---|
| index | int | — |
| mode | HandleMode | — |
void—public void SetSelectedMode(Sandbox.Curve.HandleMode mode)
Set interpolation on all selected keys, across both boundaries, as a single edit.
| Parameter | Type | Description |
|---|---|---|
| mode | HandleMode | — |
void—public void SetTangent(int index, bool incoming, float slope)
| Parameter | Type | Description |
|---|---|---|
| index | int | — |
| incoming | bool | — |
| slope | float | — |
void—public void SetViewBounds(Vector2 min, Vector2 max)
Set the visible time/value bounds in actual units.
| Parameter | Type | Description |
|---|---|---|
| min | Vector2 | — |
| max | Vector2 | — |
void—public void SmoothSelected()
Calculate monotone, locally clamped slopes. This is a one-shot operation stored as ordinary mirrored tangents.
void—public void Undo()
void—No results match this filter.
Properties19
Showing 19 properties
public int Sandbox.UI.CurveEditor.ActiveCurve { get; set; }
int—public bool Sandbox.UI.CurveEditor.CanRedo { get; set; }
bool—public bool Sandbox.UI.CurveEditor.CanUndo { get; set; }
bool—public System.Collections.Generic.IReadOnlyList`1<Sandbox.UI.CurveEditor.CurveChannel> Sandbox.UI.CurveEditor.Channels { get; set; }
Display and edit multiple independent curves. Assigning clears undo history without notifying.
public System.Action`1<System.Collections.Generic.IReadOnlyList`1<Sandbox.UI.CurveEditor.CurveChannel>> Sandbox.UI.CurveEditor.ChannelsChanged { get; set; }
Raised once per multi-curve edit, including undo and cancellation. The collection is a snapshot.
public bool Sandbox.UI.CurveEditor.IsRange { get; set; }
bool—public System.Nullable`1<Sandbox.Rect> Sandbox.UI.CurveEditor.NavigationBounds { get; set; }
Navigation bounds in actual time/value units. Only the time limits constrain navigation; vertical pan and zoom remain free. Bounds rescale with edits to the curve's axis ranges.
public Sandbox.CurveRange Sandbox.UI.CurveEditor.RangeValue { get; set; }
The two range boundaries. Assigning enables filled range editing; curves can have different ranges and key times.
public System.Action`1<Sandbox.CurveRange> Sandbox.UI.CurveEditor.RangeValueChanged { get; set; }
Raised once for each change to either boundary in range mode.
public System.Collections.Generic.IReadOnlyList`1<Sandbox.Curve> Sandbox.UI.CurveEditor.SavedPresets { get; set; }
User presets shared between curve editors and retained between sessions.
public int Sandbox.UI.CurveEditor.SelectedIndex { get; set; }
int—public System.Collections.Generic.IReadOnlyCollection`1<Sandbox.UI.CurveEditor.CurveKey> Sandbox.UI.CurveEditor.SelectedKeys { get; set; }
public bool Sandbox.UI.CurveEditor.ShowInspector { get; set; }
Show the advanced key inspector beside the canvas. Hidden by default.
bool—public Vector2 Sandbox.UI.CurveEditor.SnapIncrement { get; set; }
Time and value snap increments in actual units, independent of zoom and grid labels. Non-positive values disable an axis.
public bool Sandbox.UI.CurveEditor.SnapToGrid { get; set; }
Snap dragged keys to SnapIncrement in actual time/value units. Ctrl temporarily enables snapping.
bool—public Sandbox.Curve Sandbox.UI.CurveEditor.Value { get; set; }
The active curve. Assigning switches to single-curve mode and clears undo history without a change event.
public System.Action`1<Sandbox.Curve> Sandbox.UI.CurveEditor.ValueChanged { get; set; }
Raised for user edits to the active curve, including undo and cancellation.
public Vector2 Sandbox.UI.CurveEditor.ViewMax { get; set; }
public Vector2 Sandbox.UI.CurveEditor.ViewMin { get; set; }
Visible time/value bounds in actual curve units. Changing the view does not edit keys.
No results match this filter.