DataModel

A world of its own, with its own sun and sky. Build as many as you like, fill them with parts, lights and cameras, and film any of them.

A DataModel is a 3D scene with its own sun (SunElevation, SunAzimuth, SunStrength), sky (Top, Horizon and Ground colours or a SkyImage) and Background colour. Its CurrentCamera draws it: model:RenderTo(image) is CurrentCamera:RenderTo(image). Motor6Ds, constraints and NullObjects work only inside one. Double-click it in the Explorer to open it in a viewport. Gravity drives its simulation, and Simulation > Bake keeps the simulated frames in the project.

Example

Aim the view and set the sunLuau
local studio = Root.Sandbox.DataModels.Studio
studio.CurrentCamera.CFrame = CFrame.lookAt(Vector3.new(0, 40, 30), Vector3.new(0, 40, 0))
studio.SunAzimuth = 0
studio.SunElevation = 45

Properties

World

NameTypeDefaultDescription
BackgroundColor30.063, 0.071, 0.086The colour the picture is cleared to when the DataModel has no Parts.
SkyStrengthnumber1
0 to 20
Multiplies the sky colours in the path tracer; Solid uses them as they are.
SunAnglenumber1.5
0.05 to 45
The cone the path tracer samples the sun over, giving soft shadows.
SunAzimuthnumber115
-360 to 360
SunElevationnumber38
-90 to 90
SunStrengthnumber6
0 to 100
Set it to 0 to light the scene by the Sky Image alone: the sun stays separate from it.

Camera

CurrentCameraCameraThe Camera that draws this DataModel: model:RenderTo(image) is CurrentCamera:RenderTo(image), and errors without one.

Simulation

Gravitynumber196.2
-10000 to 10000
The simulation's gravity, like Roblox's Workspace.Gravity.
SimulationStatusread-only textProperties window onlySays what is baked; a baked DataModel plays its bake instead of simulating live.
BakebuttonProperties window onlyKeeps the simulation's result so it can be scrubbed in Edit.
FreeBakebuttonProperties window onlyA bake made before a scene edit still plays: press Free bake, then Bake again.

Sky

SkyGroundColor30.35, 0.34, 0.335The ground colour of the sky gradient, which a Sky Image replaces.
SkyHorizonColor30.63, 0.73, 0.87The horizon colour of the sky gradient, which a Sky Image replaces.
SkyImageImageContentAn equirectangular panorama that replaces the sky gradient in both renderers and, when traced, lights the scene too.
SkyTopColor30.3, 0.49, 0.79The top colour of the sky gradient, which a Sky Image replaces.

Methods

NameArgumentsReturnsDescription
BakeSimulation(path: string?)()Bakes like the Bake button; given a path, the baked data goes in that file beside the project instead.
FreeSimulation()booleanThe script form of the Free bake button.
Raycast(origin: Vector3, direction: Vector3, params: RaycastParams?)RaycastResult?
RenderTo(target: ImageContent)()Draws the DataModel into the image through its CurrentCamera; errors when there is none.
From Instance 22