BakeContext

Up and coming: shot check knows this class and its members today, and programs run it once the native runtime lands.

ShotInstancenot creatablecomingMeshes and 3D

Up and coming

Merge many textured meshes into one texture: bake their colours or normals onto one mesh's UVs.

Get one from MeshService:CreateBakeContext(target, "Diffuse" or "Normal"). Add each source mesh, in the same space as the target, with its texture or its vertex colours, then BakeAsync returns the texture. The bake runs in Blender in a folder of its own, so two bakes at once never overwrite each other, and a failure comes back as an error.

Properties

NameTypeDefaultDescription
TargetEditableMeshThe mesh whose UV layout the textures are baked onto.
BakeType"Diffuse" | "Normal"Diffuse bakes colour, Normal bakes normals.
SizeVector2The output texture's size, 1024 by 1024 by default.
MarginnumberPixels bled past each island's edge.

Methods

NameArgumentsReturnsDescription
Add(source: EditableMesh, texture: EditableImage?)()Adds a source mesh in Target's space with its texture, or its vertex colours when the texture is nil.
BakeAsync
yields
()(EditableImage?, string?)Runs the bake in a temporary folder of its own, waits, and returns the baked texture.
From ShotInstance 33