Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·part ofmodule generator.module·originates fromworld 07158574-5…

clock

A Generator's clock, frame by frame: the live sources it polls, the material clocks and live material values it writes, the playhead it presents, the transport its peers share, advancing time, cooking again once the device returns, building the graph again once something it was b…

by◐lumi·posted 1mo ago
What it does

generator.clock

A Generator's clock, frame by frame: the live sources it polls, the material clocks and live material values it writes, the playhead it presents, the transport its peers share, advancing time, cooking again once the device returns, building the graph again once something it was built from moved (followBuild), and the tick each frame runs.

One part of the Generator component. ~.generator installs it on a Generator instance's context table, gen, which the component makes once per instance: the part keeps its shared state and the operations other parts call as fields of gen, and what only it reads as locals of its install function, so every instance holds its own.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

generator.clock A Generator's clock, frame by frame: the live sources it polls, the material clocks and live material values it writes, the playhead it presents, the transport its peers share, advancing time, cooking again once the device returns, and the tick each frame runs. Installed on one Generator instance's context, `gen`, by `~.generator`: its state and the operations other parts call are fields of `gen`, and what only this part reads stays local to it.

pollLiveSources( ) → void

Re-read the graph's live sources on a clock, and regenerate only once they have actually moved. The steady-state cost while the scene is still is the digest alone — the entity reads the graph declares — because `regenerate`, which loads and runs the `.procGraph`'s source, is reached only on a change.

drawnMaterialKeys( ) → void

The registry keys of every material this generator draws: one frozen list, the same from frame to frame until a key is filed or released.

driveMaterialClocks(keys: { string }, seconds: number, rate: number, dt: number) → void

Drive the materials this generator draws from its own clock: their shaders read the graph's time as `time`, so an effect's surfaces pause, slow and scrub with the graph. `rate` is how the clock runs on between statements — 1 while the playhead moves with the world, 0 while it stands.

argtypedescription
keys{ string }
secondsnumber
ratenumber
dtnumber

graphSeconds(tl: any) → number

The graph's time where the playhead stands, in seconds.

argtypedescription
tlany

writeLiveMaterials(keys: { string }, clock: any) → void

argtypedescription
keys{ string }
clockany

presentPlayhead( ) → void

Present the frame the playhead stands on now, whether or not the clock is advancing: a seek on a paused generator shows where it landed. The present that takes the playhead there is a seek (`clock.seek`), owed until a present is made with it: a simulation is stepped all the way to where it landed.

presentInputs( ) → void

Present the number inputs as they now stand at the frame the playhead is on, whether or not the clock is advancing, and without moving it: the runs are rewritten for a clock carrying them, or the frame cooked with nothing on the device.

stampTransport( ) → void

Record where the clock stands as the transport every peer applies.

applyTransport( ) → void

Stand on a transport another peer moved: its run state, its playhead, and the frame that playhead is on.

cooksOfRangeLeft( ) → boolean

Whether a cook of the bound timeline is still to land: one running or waiting, or frames the cook-ahead has yet to reach. A cook that has failed for the bound graph is not waited for.

advance(dt: number) → void

Move the playhead and ask for what it now stands on. A clock that is not advancing — paused, or held on the last frame of a range played once — asks for nothing, so nothing cooks and nothing in the scene is touched.

argtypedescription
dtnumber

dropEndedFrames( ) → void

A free that took a buffer the held frames stand on ended the play shown from them: the play stops showing them and cooks, and they are not bound again until they are defined again. Asked only after a free.

cookAgainOnDevice( ) → void

The render device was rebuilt: the runs, meshes and draws this generator realized stood on the device that went. What stood is let go of, and the bound graph is bound again as it was the first time and cooks onto the new device; a graph running in real time begins again at its clock.

tickFrame(dt: number) → void

Every frame the component is enabled, in edit mode — where a generator's inputs are dragged around and the output is expected to follow the hand. A paused play session ticks this hook too, and a generator is part of the world that pause holds still, so it advances here only while authoring.

argtypedescription
dtnumber

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported on this asset or on the parts this page shows. Parts it leaves out are not counted here.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.