Skip to content

Commit 22370bf

Browse files
update Open Source Docs from Roblox internal teams
1 parent 8667bd2 commit 22370bf

File tree

1 file changed

+42
-53
lines changed

1 file changed

+42
-53
lines changed

content/en-us/reference/engine/classes/GenerationService.yaml

Lines changed: 42 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,20 @@ name: GenerationService
22
type: class
33
memory_category: Instances
44
summary: |
5-
`GenerationService` is a service that allows developers to generate 3D objects
6-
from text prompts utilizing Roblox's
7-
[Cube 3D foundation model](https://corp.roblox.com/newsroom/2025/03/introducing-roblox-cube).
5+
Service that allows developers to generate 3D objects from text prompts.
86
description: |
9-
`GenerationService` is a service that allows developers to generate 3D objects
10-
from text prompts utilizing Roblox's
11-
[Cube 3D foundation model](https://corp.roblox.com/newsroom/2025/03/introducing-roblox-cube).
12-
13-
Mesh generation is a two step process:
7+
`GenerationService` allows developers to generate 3D objects from text
8+
prompts. Mesh generation is a two step process:
149
1510
1. `Class.GenerationService:GenerateMeshAsync()|GenerateMeshAsync()` starts
1611
the mesh generation process using a text prompt and other required
1712
parameters. It returns a unique identifier (generation ID) that can be used
1813
to retrieve the future result.
1914
2. `Class.GenerationService:LoadGeneratedMeshAsync()|LoadGeneratedMeshAsync()`
2015
loads the generated mesh into the experience. The mesh is returned as a
21-
`Class.MeshPart` containing an `Class.EditableMesh`.
16+
`Class.MeshPart` or `Class.Model`.
2217
23-
Currently, GenerationService only supports the following usage:
18+
Currently, `GenerationService` only supports the following usage:
2419
2520
- `Class.GenerationService:GenerateMeshAsync()|GenerateMeshAsync()` must be
2621
called from server scripts.
@@ -36,13 +31,16 @@ description: |
3631
`Class.EditableMesh` content and only on the client, it is not replicated to
3732
any other clients.
3833
39-
The following code illustrates this design pattern. See
34+
The following code samples illustrate this design pattern. See
4035
[this demo experience](https://www.roblox.com/games/86571743597273/Mesh-Generation-Template)
41-
for a more detailed example. Click the **⋯** button and **Edit in
42-
Studio**.
36+
for a more detailed example (click the **⋯** button and **Edit in
37+
Studio**).
4338
code_samples:
4439
- GenerationService-ServerSideMeshGeneration
4540
- GenerationService-ClientSideMeshGeneration
41+
- GenerationService-ServerSideMeshGeneration-WithSuggestedSize
42+
- GenerationService-ClientSideMeshGeneration-WithSuggestedSize
43+
- GenerationService-StarterPlayerScripts-WithSuggestedSize
4644
inherits:
4745
- Instance
4846
tags:
@@ -54,10 +52,7 @@ methods:
5452
- name: GenerationService:GenerateMeshAsync
5553
summary: |
5654
Starts the generation of a new 3D mesh from a text prompt and returns
57-
unique IDs used to track and retrieve the result. After the generation is
58-
complete, use
59-
`Class.GenerationService:LoadGeneratedMeshAsync()|LoadGeneratedMeshAsync()`
60-
to load and display the generated mesh.
55+
unique IDs used to track and retrieve the result.
6156
description: |
6257
Starts the generation of a new 3D mesh from a text prompt and returns
6358
unique IDs used to track and retrieve the result. You can optionally
@@ -67,24 +62,17 @@ methods:
6762
`Class.GenerationService:LoadGeneratedMeshAsync|LoadGeneratedMeshAsync()`
6863
to load and display the generated mesh.
6964
70-
**Rate limits**
71-
72-
There is a rate limit of 5 generations per minute per experience. If you
73-
exceed this limit, further generation requests are blocked until the next
74-
minute.
65+
**Error Codes**
7566
76-
**Error codes**
77-
78-
| Error | Description | Recommended developer action |
79-
| ------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
80-
| Rate limit exceeded | The maximum number of mesh generations has been exceeded for the minute. | Wait until the rate limit resets. |
81-
| Moderation failure | The mesh generation was flagged for moderation. | Review and modify the prompt to ensure it adheres to Roblox's moderation guidelines. |
82-
| Internal server error | An unexpected issue occurred on the server. | Retry the request later or check server status for issues. |
83-
| 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. |
84-
code_samples:
85-
- GenerationService-GenerateMeshAsync-BasicUsage
86-
- GenerationService-GenerateMeshAsync-WithIntermediateResultsCallback
87-
- GenerationService-GenerateMeshAsync-ServerSideGenerationWithErrorHandling
67+
| Error | Description | Recommended developer action |
68+
| -------------------------------------- | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
69+
| Rate limit exceeded | The maximum number of mesh generations has been exceeded for the minute. | Wait until the rate limit resets. |
70+
| Moderation failed | The mesh generation was flagged for moderation. | Review and modify the prompt to ensure it adheres to Roblox's moderation guidelines. |
71+
| Internal server error | An unexpected issue occurred on the server. | Retry the request later or check server status for issues. |
72+
| 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. |
73+
| Service overloaded | The service is overloaded. | Retry the request later. |
74+
| Size dimensions must be greater than 0 | Invalid size provided. | Change the size to above `0`. |
75+
code_samples: []
8876
parameters:
8977
- name: inputs
9078
type: Dictionary
@@ -102,22 +90,25 @@ methods:
10290
type: Dictionary
10391
default:
10492
summary: |
105-
Additional generation options. Currently, no options are supported.
93+
A dictionary for additional generation options to influence the
94+
result. The following key is supported:
95+
96+
- `SuggestedSize` — Optional
97+
`Datatype.Vector3` representing a size guide for the generated asset.
98+
The service will attempt to create a model with a size and proportion
99+
similar to the provided `Datatype.Vector3`. This does not guarantee
100+
the final output size.
106101
- name: intermediateResultCallback
107102
type: Function?
108103
default:
109104
summary: |
110105
A callback function triggered with intermediate generation results.
111-
Useful for retrieving early mesh versions (e.g. before textures are
112-
applied).
106+
Useful for retrieving early mesh versions before textures are applied.
113107
returns:
114108
- type: Tuple
115109
summary: |
116-
A tuple of generation ID and context ID.
117-
118-
- Generation ID: A unique ID returned for each invocation of
119-
`GenerateMeshAsync()`.
120-
- Context ID: Not currently used.
110+
A tuple of the generation ID (a unique ID returned for each invocation
111+
of `GenerateMeshAsync()`) and context ID (not currently used).
121112
tags:
122113
- Yields
123114
deprecation_message: ''
@@ -129,17 +120,15 @@ methods:
129120
summary: |
130121
Retrieves and loads a mesh generated by
131122
`Class.GenerationService:GenerateMeshAsync()` using the provided
132-
`generationId`. The mesh is returned as a `Class.MeshPart` with
133-
`Class.EditableMesh` content.
123+
`generationId`.
134124
description: |
135125
Retrieves and loads a mesh generated by
136-
`Class.GenerationService:GenerateMeshAsync()` using the provided
137-
generationId. The mesh is returned as a `Class.MeshPart` with
138-
`Class.EditableMesh` content. Because editable meshes are not replicated,
139-
the loaded mesh is not replicated to any other clients and can only be
140-
loaded once per `generationId`.
141-
code_samples:
142-
- GenerationService-LoadGeneratedMeshAsync-LoadAGeneratedMesh
126+
`Class.GenerationService:GenerateMeshAsync()|GenerateMeshAsync()` using
127+
the provided `generationId`. The mesh can be returned as a
128+
`Class.MeshPart` or `Class.Model`. Because editable meshes are not
129+
replicated, the loaded mesh is not replicated to any other clients and can
130+
only be loaded once per `generationId`.
131+
code_samples: []
143132
parameters:
144133
- name: generationId
145134
type: string
@@ -151,8 +140,8 @@ methods:
151140
returns:
152141
- type: MeshPart
153142
summary: |
154-
The generated mesh, returned as a `Class.MeshPart` containing an
155-
`Class.EditableMesh`.
143+
The generated asset, returned as a `Class.Model` with a single
144+
`Class.MeshPart` containing an `Class.EditableMesh`.
156145
tags:
157146
- Yields
158147
deprecation_message: ''

0 commit comments

Comments
 (0)