FilamentViewState
Hoisted handle to a FilamentView's live Filament objects. Create with rememberFilamentViewState, pass to a FilamentView, and use it for imperative access — picking, captures, reading the viewport, or reaching the raw View/Renderer for advanced work.
view and renderer are null until the state is attached to an on-screen FilamentView, and become null again when that view leaves composition.
val viewState = rememberFilamentViewState()
FilamentView(scene = scene, viewState = viewState, ...)
// Pick on tap — pick() takes Compose coordinates (top-left origin), no flipping needed:
Modifier.pointerInput(Unit) {
detectTapGestures { offset ->
viewState.pick(offset.x.toInt(), offset.y.toInt()) { result -> ... }
}
}Properties
Functions
The view as it looks now, at its size in pixels: its scene rendered once more off-screen and read back, for saving or sharing. Null while not attached. A view paused with renderingEnabled = false renders until the image is in, as Filament reads it back on a later frame. Call it from the main thread, like every Filament call.
Issues a Filament picking query at viewport pixel (x, y) in Compose coordinates (origin top-left, like pointer-input offsets) and delivers the result to onResult on the render thread. The conversion to Filament's bottom-left viewport origin happens internally. No-op while not attached, or for a pixel outside the view. A view paused with renderingEnabled = false renders until the result is in, as Filament answers a query by rendering.