Table of Contents

Struct NodeContext

Namespace
Ofs
Assembly
Ofs.Api.dll

Evaluation context passed to every node callback. Pure value — safe on any thread. The params buffer is valid only for the duration of the call; do not store it.

public readonly struct NodeContext

Properties

IsCancelled

True once the host has cancelled this eval (a newer edit superseded it). A long discrete generator/modifier should poll this at loop boundaries and return early — the host discards a cancelled eval's output, so bailing only frees the worker thread sooner. Always false when the host supplies no cancellation (e.g. a preview eval).

public bool IsCancelled { get; }

Property Value

bool

Params

The node parameter values. Valid only during the node callback.

public ReadOnlySpan<float> Params { get; }

Property Value

ReadOnlySpan<float>

RegionEnd

End time of the region being evaluated, in seconds.

public double RegionEnd { get; }

Property Value

double

RegionStart

Start time of the region being evaluated, in seconds.

public double RegionStart { get; }

Property Value

double

Methods

Param(int, float)

Returns param i, or fallback if out of range.

public float Param(int i, float fallback = 0)

Parameters

i int
fallback float

Returns

float