Reference API Roblox

Engine API

Website

Related

Reference API Roblox

GenerationService

GenerationService is a service that allows developers to generate 3D objects from text prompts utilizing Roblox's Cube 3D foundation model.

This class is not creatable. Instances of this class cannot be created with Instance.new.
This class is a service. It is a singleton that may be acquired with GetService.
Tags: [NotCreatable, Service]

Member index 5

HistoryMember
661GenerateMeshAsync(inputs: Dictionary, player: Player, options: Dictionary, intermediateResultCallback: Function?): Tuple
662InternalGenerateMeshAsync(inputs: Dictionary, userId: int64, options: Dictionary, intermediateResultCallback: Function?): Tuple
661LoadGeneratedMeshAsync(generationId: string): MeshPart
inherited from Instance
553Archivable: bool
635Capabilities: SecurityCapabilities
553Name: string
553Parent: Instance
635Sandboxed: bool
616UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
486GetDescendants(): Array
486GetFullName(): string
641GetStyled(name: string): Variant
657GetStyledPropertyChangedSignal(property: string): RBXScriptSignal
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
664IsPropertyModified(property: string): bool
573Remove(): null
576RemoveTag(tag: string): null
664ResetPropertyToDefault(property: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
648children(): Instances
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
648getChildren(): Instances
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
657StyledPropertiesChanged()
553childAdded(child: Instance)
inherited from Object
647ClassName: string
647className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
650isA(className: string): bool
647Changed(property: string)

Description

GenerationService is a service that allows developers to generate 3D objects from text prompts utilizing Roblox's Cube 3D foundation model.

Mesh generation is a two step process:

  1. 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.
  2. LoadGeneratedMeshAsync() loads the generated mesh into the experience. The mesh is returned as a MeshPart containing an EditableMesh.

Currently, GenerationService only supports the following usage:

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 LoadGeneratedMeshAsync() and retrieve the mesh. Note that since the generated mesh is loaded with EditableMesh content and only on the client, it is not replicated to any other clients.

The following code illustrates this design pattern. See this demo experience for a more detailed example. Click the button and Edit in Studio.

History 6

Members 5

GenerateMeshAsync

Parameters (4)
inputsDictionary
playerPlayer
optionsDictionary
intermediateResultCallbackFunction?
Returns (1)
Tuple

Starts the generation of a new 3D mesh from a text prompt and returns unique IDs used to track and retrieve the result. You can optionally receive intermediate results, such as the untextured mesh, by providing an intermediateResultCallback function. After the generation is complete, use LoadGeneratedMeshAsync() to load and display the generated mesh.

Rate limits

There is a rate limit of 5 generations per minute per experience. If you exceed this limit, further generation requests are blocked until the next minute.

Error codes

ErrorDescriptionRecommended developer action
Rate limit exceededThe maximum number of mesh generations has been exceeded for the minute.Wait until the rate limit resets.
Moderation failureThe mesh generation was flagged for moderation.Review and modify the prompt to ensure it adheres to Roblox's moderation guidelines.
Internal server errorAn unexpected issue occurred on the server.Retry the request later or check server status for issues.
Character limit exceededThe input prompt length for this generation request exceeded the limit.Reduce the number of characters in the Prompt string of the input dictionary.
This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

InternalGenerateMeshAsync

Parameters (4)
inputsDictionary
userIdint64
optionsDictionary
intermediateResultCallbackFunction?
Returns (1)
Tuple
This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

LoadGeneratedMeshAsync

Parameters (1)
generationIdstring
Returns (1)
MeshPart

Retrieves and loads a mesh generated by GenerationService:GenerateMeshAsync() using the provided generationId. The mesh is returned as a MeshPart with EditableMesh content. Because editable meshes are not replicated, the loaded mesh is not replicated to any other clients and can only be loaded once per generationId.

This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

Settings