You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en-us/reference/engine/classes/GenerationService.yaml
+55-48Lines changed: 55 additions & 48 deletions
Original file line number
Diff line number
Diff line change
@@ -3,11 +3,23 @@ type: class
3
3
category:
4
4
memory_category: Instances
5
5
summary: |
6
-
Generate 3D objects from text prompts using Roblox's
7
-
[Cube 3D foundation model](https://corp.roblox.com/newsroom/2025/03/introducing-roblox-cube).
6
+
`GenerationService` is a service that allows developers to generate 3D objects from text prompts utilizing Roblox's [Cube 3D foundation model](https://corp.roblox.com/newsroom/2025/03/introducing-roblox-cube).
8
7
description: |
9
-
`GenerationService` lets you generate 3D objects from text prompts using
10
-
Roblox's [Cube 3D foundation model](https://corp.roblox.com/newsroom/2025/03/introducing-roblox-cube).
8
+
`GenerationService` is a service that allows developers to generate 3D objects from text prompts utilizing Roblox's [Cube 3D foundation model](https://corp.roblox.com/newsroom/2025/03/introducing-roblox-cube).
9
+
10
+
Mesh generation is a two step process:
11
+
12
+
1. `Class.GenerationService:GenerateMeshAsync()|GenerateMeshAsync()` starts the mesh generation process using a text prompt and other required parameters. It returns a unique identifier (generation ID) that can be used to retrieve the future result.
13
+
2. `Class.GenerationService:LoadGeneratedMeshAsync()|LoadGeneratedMeshAsync()` loads the generated mesh into the experience. The mesh is returned as a `Class.MeshPart` containing an `Class.EditableMesh`.
14
+
15
+
Currently, GenerationService only supports the following usage:
16
+
17
+
- `Class.GenerationService:GenerateMeshAsync()|GenerateMeshAsync()` must be called from server scripts.
18
+
- `Class.GenerationService:LoadGeneratedMeshAsync()|LoadGeneratedMeshAsync()` must be called from client scripts.
19
+
20
+
As a result, when a mesh generation request originates from a client, the client must send a signal to the server to initiate generation. Once the server determines that generation is complete, it should notify the appropriate client to call `Class.GenerationService:LoadGeneratedMeshAsync()|LoadGeneratedMeshAsync()` and retrieve the mesh. Note that since the generated mesh is loaded with `Class.EditableMesh` content and only on the client, it is not replicated to any other clients.
21
+
22
+
The following code illustrates this design pattern. See [this demo experience](https://www.roblox.com/games/86571743597273/Mesh-Generation-Template) for a more detailed example. Click the **⋯** button and **Edit in Studio**.
11
23
code_samples:
12
24
- GenerationService-ServerSideMeshGeneration
13
25
- GenerationService-ClientSideMeshGeneration
@@ -21,27 +33,33 @@ properties: []
21
33
methods:
22
34
- name: GenerationService:GenerateMeshAsync
23
35
summary: |
24
-
Generates a new mesh from a text prompt and returns unique IDs to track
25
-
and retrieve the result.
36
+
Starts the generation of a new 3D mesh from a text prompt and returns
37
+
unique IDs used to track and retrieve the result. After the generation is
| Rate limit exceeded | The maximum number of mesh generations has been exceeded for the minute. | Wait until the rate limit resets. |
60
+
| Moderation failure | The mesh generation was flagged for moderation. | Review and modify the prompt to ensure it adheres to Roblox's moderation guidelines. |
61
+
| Internal server error | An unexpected issue occurred on the server. | Retry the request later or check server status for issues. |
62
+
| Character limit exceeded | The input prompt length for this generation request exceeded the limit. | Reduce the number of characters in the `Prompt` string of the `input` dictionary. |
0 commit comments