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
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 = 45Properties
World
| Name | Type | Default | Description |
|---|---|---|---|
| Background | Color3 | 0.063, 0.071, 0.086 | The colour the picture is cleared to when the DataModel has no Parts. |
| SkyStrength | number | 1 0 to 20 | Multiplies the sky colours in the path tracer; Solid uses them as they are. |
| SunAngle | number | 1.5 0.05 to 45 | The cone the path tracer samples the sun over, giving soft shadows. |
| SunAzimuth | number | 115 -360 to 360 | |
| SunElevation | number | 38 -90 to 90 | |
| SunStrength | number | 6 0 to 100 | Set it to 0 to light the scene by the Sky Image alone: the sun stays separate from it. |
Camera
| CurrentCamera | Camera | The Camera that draws this DataModel: model:RenderTo(image) is CurrentCamera:RenderTo(image), and errors without one. |
Simulation
| Gravity | number | 196.2 -10000 to 10000 | The simulation's gravity, like Roblox's Workspace.Gravity. |
| SimulationStatus | read-only text | Properties window only | Says what is baked; a baked DataModel plays its bake instead of simulating live. |
| Bake | button | Properties window only | Keeps the simulation's result so it can be scrubbed in Edit. |
| FreeBake | button | Properties window only | A bake made before a scene edit still plays: press Free bake, then Bake again. |
Sky
| SkyGround | Color3 | 0.35, 0.34, 0.335 | The ground colour of the sky gradient, which a Sky Image replaces. |
| SkyHorizon | Color3 | 0.63, 0.73, 0.87 | The horizon colour of the sky gradient, which a Sky Image replaces. |
| SkyImage | ImageContent | An equirectangular panorama that replaces the sky gradient in both renderers and, when traced, lights the scene too. | |
| SkyTop | Color3 | 0.3, 0.49, 0.79 | The top colour of the sky gradient, which a Sky Image replaces. |
Methods
| Name | Arguments | Returns | Description |
|---|---|---|---|
| BakeSimulation | (path: string?) | () | Bakes like the Bake button; given a path, the baked data goes in that file beside the project instead. |
| FreeSimulation | () | boolean | The 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. |
