ModelThumbnails class final

Pictures of model files for the Assets dock and the palettes, rendered off screen with the 3-D renderer — no engine, no scene — one at a time, and kept until the file changes.

Where there is no GPU (a test, the web) every picture is null and the dock shows the file's icon.

Constructors

ModelThumbnails({required String root, int size = 128, String? cacheFolder, GpuDevice? device})
Thumbnails size pixels square of files under root.

Properties

cacheFolder → String?
Where pictures are kept between sessions (PNG files named after the model and when it changed), or null to keep them in memory only.
final
hashCode → int
The hash code for this object.
no setterinherited
revision → ValueNotifier<int>
Bumped when a picture is ready; what a view listens to.
final
root → String
The project folder model paths are under.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
size → int
Width and height of each picture, in pixels.
final

Methods

dispose() → void
Lets the pictures go.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
of(String path, {DateTime? modified}) → Future<Image?>
The picture of the model at path as it was at modified: null without a GPU or when the file can't be read as a model.
peek(String path, {DateTime? modified}) → Image?
The picture of the model at path (project-relative) as it was at modified, if it is ready; asking starts it.
renderer() → Future<Renderer3D?>
The renderer the pictures are made with (shadows off), shared with whatever else previews models; null without a GPU.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

frameBounds(Aabb3 box, int width, int height, {Vector3? toward, double yaw = -0.6, double pitch = -0.45}) → RenderView
A view of box, width by height, far enough back to see all of it: from toward (a direction from its middle to the eye), or — when that is null — turned yaw and tipped pitch (radians).
frameModel(ModelData data, int size) → RenderView
A view of data from above and to the front-left, far enough back to see all of it, size pixels square.