SceneParameterAccess
What an environment sees of its scene's parameters, as ctx.parameters: the table, where each stands, and how to move one.
@internote/canvas-sdkimport { SceneParameterAccess } from '@internote/canvas-sdk';all is the scene's table, every control's parameter wherever the control was written plus the loose letters each environment contributed through freeParameters, and it is stable between renders. The two readings are functions rather than snapshots because a swept parameter moves every frame, and a surface asking what t holds is asking about this frame.
A surface that draws with the parameters subscribes through useSceneParameters, since the state lives in the scene's session slot and a write to it does not re-render the environment on its own.
#Fields
allEvery parameter the scene holds, in source order.
Parameter[]declaredEvery name the scene's controls declare, hidden and unfired too — not
all's, which drops those and adds loose letters.ReadonlySet<string>idleReturns the names of
all's parameters that nothing on the scene reads at this moment — the curve that uses one is cued out, say — so moving them would change nothing. Empty whenever an environment cannot say what it reads.ReadonlySet<string>numbersReturns the numeric parameters alone, by name, which is what an expression may be evaluated against.
Record<string, number>setMoves a parameter: to a value for a plain control, or by a sweep displacement for a swept one.
voidstateReturns the reader's raw state, as one object whose identity changes only when something moves. The snapshot a
useSyncExternalStore needs, since values() builds a fresh object every call.ParameterState | undefinedsubscribeCalls the listener after every move, and returns the unsubscribe.
() => voidvaluesReturns what each parameter holds right now, by name, read against the scene clock.
Record<string, ParameterValue>#Example
const { a, b } = ctx.parameters.numbers();
const y = evaluateExpression(curve.js, { a, b, x });Declared in packages/canvas-sdk/src/parameters/index.ts:588.