AvatarCreationService
A service to support developer avatar creators.
Memory category | Instances |
---|
Member index 26
Removed member index 2
History | Member | |
---|---|---|
641 | CreateAvatarGenerationSessionAsync(player: Player): AvatarGenerationSession |
Description
AvatarCreationService
is a service that supports developer avatar creators,
providing methods that support the prompting of avatar creation from within
experiences.
History 37
- 648 Change ReturnType of LoadAvatarPreviewImageAsync from EditableImage to Object
- 648 Add DeserializeAvatarModel
- 647 Change Parameters of UgcValidationSuccess from (guid: string, serializedModel: string) to (guid: string, serializedModel: string, price: int64)
- 647 Change Parameters of PromptCreateAvatarAsync from (player: Player, humanoidDescription: HumanoidDescription) to (tokenId: string, player: Player, humanoidDescription: HumanoidDescription)
- 646 Add GetBatchTokenDetailsAsync
- 646 Change Parameters of GenerateAvatarPreviewAsync2 from (sessionId: string, fileId: string, textPrompt: string) to (sessionId: string, fileId: string, textPrompt: string, options: Dictionary)
- 645 Add
- 645 Add
- 645 Add PromptSelectAvatarGenerationImageAsync
- 642 Add
- 642 Add
- 641 Add RequestAvatarGenerationSessionAsync
- 641 Add LoadAvatarHumanoidDescriptionAsync
- 641 Add GenerateAvatarPreviewAsync2
- 641 Add GenerateAvatarAsync
- 641 Remove CreateAvatarGenerationSessionAsync
- 640 Add GetValidationRules
- 638 Add GenerateAvatarPreviewAsync
- 638 Add GenerateAvatarModelAsync
- 627 Add ValidateUGCFullBodyAsync
- 627 Add ValidateUGCBodyPartAsync
- 627 Add ValidateUGCAccessoryAsync
- 626 Add SendAnalyticsEvent
- 624 Add GetAvatarGenerationConfig
- 622 Remove
- 622 Add
- 622 Add CreateAvatarGenerationSessionAsync
- 620 Add
- 620 Change Parameters of from (serializedModel: string, bufferMap: Dictionary) to (id: string, serializedModel: string, bufferMap: Dictionary)
- 620 Add LoadAvatarPreviewImageAsync
- 620 Add LoadAvatarModelAsync
- 618 Add
- 607 Add UgcValidationSuccess
- 607 Add UgcValidationFailure
- 607 Change Tags of AvatarCreationService from [NotCreatable, Service, NotReplicated] to [NotCreatable, Service]
- 597 Add PromptCreateAvatarAsync
- 597 Add AvatarCreationService
Members 26
DeserializeAvatarModel
Parameters (1) | ||
---|---|---|
serializedModel | string | |
Returns (1) | ||
Instance |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
GenerateAvatarAsync
Parameters (2) | ||
---|---|---|
sessionId | string | |
previewId | string | |
Returns (1) | ||
string |
Thread safety | Unsafe |
---|
History 1
GenerateAvatarModelAsync
Parameters (4) | ||
---|---|---|
player | Player | |
previewJobId | string | |
options | Dictionary | |
progressCallback | Function | |
Returns (1) | ||
string |
Thread safety | Unsafe |
---|
History 1
GenerateAvatarPreviewAsync
Parameters (4) | ||
---|---|---|
player | Player | |
textPrompt | string | |
options | Dictionary | |
progressCallback | Function | |
Returns (1) | ||
string |
Thread safety | Unsafe |
---|
History 1
GenerateAvatarPreviewAsync2
Parameters (4) | ||
---|---|---|
sessionId | string | |
fileId | string | |
textPrompt | string | |
options | Dictionary | |
Returns (1) | ||
string |
Thread safety | Unsafe |
---|
History 2
- 646 Change Parameters of GenerateAvatarPreviewAsync2 from (sessionId: string, fileId: string, textPrompt: string) to (sessionId: string, fileId: string, textPrompt: string, options: Dictionary)
- 641 Add GenerateAvatarPreviewAsync2
GetAvatarGenerationConfig
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Dictionary |
Thread safety | Unsafe |
---|
History 1
GetBatchTokenDetailsAsync
Parameters (1) | ||
---|---|---|
tokenIds | Array | |
Returns (1) | ||
Array |
Gets the avatar creation token details for a list of avatar creation tokens at once. Returns an array of avatar creation token details; each token detail is a dictionary with the fields indicated in the example result below:
1 2 3 4 5 6 7 8 9 10 11 12 |
|
Thread safety | Unsafe |
---|
History 1
GetValidationRules
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Dictionary |
Gets data regarding rules that assets must abide by to pass UGC validation. Validation is an essential step before creating avatars and there are various checks that occur, including mesh triangle limits, texture sizes, body part size limits, attachment positions, and more.
The returned dictionary of validation rules takes the following form:
{
["MeshRules"] = {
["BodyPartMaxTriangles"] = {
Enum.AssetType.DynamicHead: number,
Enum.AssetType.LeftArm: number,
Enum.AssetType.RightArm: number,
Enum.AssetType.Torso: number,
Enum.AssetType.LeftLeg: number,
Enum.AssetType.RightLeg: number,
},
["AccessoryMaxTriangles"]: number,
["MeshVertColor"]: Color3,
["CageMeshMaxDistanceFromRenderMesh"]: number,
},
["TextureRules"] = {
["MaxTextureSize"]: number,
},
["BodyPartRules"] = {
[Enum.AssetType.DynamicHead] = {
["Bounds"] = {
["Classic"] = {
["MinSize"]: Vector3,
["MaxSize"]: Vector3,
},
["ProportionsSlender"] = {
["MinSize"]: Vector3,
["MaxSize"]: Vector3,
},
["ProportionsNormal"] = {
["MinSize"]: Vector3,
["MaxSize"]: Vector3,
},
},
["SubParts"] = {
["Head"] = {
["NeckRigAttachment"] = {
["LowerBound"]: Vector3,
["UpperBound"]: Vector3,
},
["FaceFrontAttachment"] = {
["LowerBound"]: Vector3,
["UpperBound"]: Vector3,
},
["HatAttachment"] = {
["LowerBound"]: Vector3,
["UpperBound"]: Vector3,
},
["HairAttachment"] = {
["LowerBound"]: Vector3,
["UpperBound"]: Vector3,
},
["FaceCenterAttachment"] = {
["LowerBound"]: Vector3,
["UpperBound"]: Vector3,
},
},
},
},
[Enum.AssetType.LeftArm] = {
["Bounds"] = {
["Classic"] = {
["MinSize"]: Vector3,
["MaxSize"]: Vector3,
},
["ProportionsSlender"] = {
["MinSize"]: Vector3,
["MaxSize"]: Vector3,
},
["ProportionsNormal"] = {
["MinSize"]: Vector3,
["MaxSize"]: Vector3,
},
},
["SubParts"] = {
["LeftHand"] = {
["LeftWristRigAttachment"] = {
["LowerBound"]: Vector3,
["UpperBound"]: Vector3,
},
["LeftGripAttachment"] = {
["LowerBound"]: Vector3,
["UpperBound"]: Vector3,
},
},
["LeftUpperArm"] = {
["LeftShoulderRigAttachment"] = {
["LowerBound"]: Vector3,
["UpperBound"]: Vector3,
},
["LeftShoulderAttachment"] = {
["LowerBound"]: Vector3,
["UpperBound"]: Vector3,
},
["LeftElbowRigAttachment"] = {
["LowerBound"]: Vector3,
["UpperBound"]: Vector3,
},
},
["LeftLowerArm"] = {
["LeftElbowRigAttachment"] = {
["LowerBound"]: Vector3,
["UpperBound"]: Vector3,
},
["LeftWristRigAttachment"] = {
["LowerBound"]: Vector3,
["UpperBound"]: Vector3,
},
},
},
},
...
},
["AccessoryRules"] = {
[Enum.AssetType.HairAccessory] = {
["Attachments"] = {
{
["Size"]: Vector3,
["Offset"]: Vector3,
["Name"]: string,
},
},
["RigidAllowed"]: boolean,
},
...
}
}
Thread safety | Unsafe |
---|
History 1
LoadAvatarHumanoidDescriptionAsync
Parameters (1) | ||
---|---|---|
id | string | |
Returns (1) | ||
HumanoidDescription |
Thread safety | Unsafe |
---|
History 1
LoadAvatarModelAsync
Parameters (1) | ||
---|---|---|
id | string | |
Returns (1) | ||
Instance |
Thread safety | Unsafe |
---|
History 1
LoadAvatarPreviewImageAsync
Parameters (1) | ||
---|---|---|
avatarPreview | string | |
Returns (1) | ||
Object |
Thread safety | Unsafe |
---|
History 2
- 648 Change ReturnType of LoadAvatarPreviewImageAsync from EditableImage to Object
- 620 Add LoadAvatarPreviewImageAsync
PromptCreateAvatarAsync
Parameters (3) | ||
---|---|---|
tokenId | string | |
player | Player | |
humanoidDescription | HumanoidDescription | |
Returns (1) | ||
Tuple |
Prompts a Player to purchase and create an avatar from a HumanoidDescription. The price of the creation is dictated by the price attributed to the avatar creation token.
For avatar creation, the HumanoidDescription is expected to include new assets to be created for each of the 6 body parts (Head, Torso, RightLeg, LeftLeg, RightArm, LeftArm). Optionally, it can also include a new Hair accessory.
To support this, the HumanoidDescription should include 6
BodyPartDescription children (one for each body part). For each,
the BodyPartDescription.Instance property references a
Folder which includes all of the MeshPart instances which
make up the body part, for example a LeftArm
folder which has
LeftHand
, LeftUpperArm
, and LeftLowerArm
MeshParts.
The BodyPartDescription.BodyPart property should also be set to
the relevant BodyPart.
Each body part MeshPart will also need to include:
- An EditableImage.
- A WrapDeformer with an EditableMesh.
If including an accessory such as hair, the HumanoidDescription should include a child AccessoryDescription where:
- The AccessoryDescription.Instance property references the Accessory instance.
- The AccessoryDescription.AccessoryType property is set to the relevant AccessoryType.
Finally, the HumanoidDescription should include the humanoid scales of BodyTypeScale, HeadScale, HeightScale, WidthScale, and ProportionScale. Be mindful of the scales that a base body is imported with so that they match the scales provided to the HumanoidDescription.
Thread safety | Unsafe |
---|
History 2
- 647 Change Parameters of PromptCreateAvatarAsync from (player: Player, humanoidDescription: HumanoidDescription) to (tokenId: string, player: Player, humanoidDescription: HumanoidDescription)
- 597 Add PromptCreateAvatarAsync
PromptSelectAvatarGenerationImageAsync
Parameters (1) | ||
---|---|---|
player | Player | |
Returns (1) | ||
string |
Thread safety | Unsafe |
---|
History 1
RequestAvatarGenerationSessionAsync
Parameters (2) | ||
---|---|---|
player | Player | |
callback | Function | |
Returns (1) | ||
Tuple |
Thread safety | Unsafe |
---|
History 1
SendAnalyticsEvent
Parameters (2) | ||
---|---|---|
eventName | string | |
params | Dictionary | |
Returns (1) | ||
null |
Thread safety | Unsafe |
---|
History 1
UgcValidationFailure
Parameters (2) | |
---|---|
guid | string |
errorMessage | string |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
UgcValidationSuccess
Parameters (3) | |
---|---|
guid | string |
serializedModel | string |
price | int64 |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 2
- 647 Change Parameters of UgcValidationSuccess from (guid: string, serializedModel: string) to (guid: string, serializedModel: string, price: int64)
- 607 Add UgcValidationSuccess
ValidateUGCAccessoryAsync
Parameters (3) | ||
---|---|---|
player | Player | |
accessory | Instance | |
accessoryType | AccessoryType | |
Returns (1) | ||
Tuple |
Studio only. Given a Player and Instance for an AccessoryType, determines if UGC validation passes.
Thread safety | Unsafe |
---|
History 1
ValidateUGCBodyPartAsync
Parameters (3) | ||
---|---|---|
player | Player | |
instance | Instance | |
bodyPart | BodyPart | |
Returns (1) | ||
Tuple |
Studio only. Given a Player and Instance for an
BodyPart, determines if UGC validation passes. The instance
parameter is expected as a Folder in the following example format
with relevant MeshParts:
LeftArm
(Folder)
However, if the expected bodyPart
is BodyPart.Head, the function
takes a singular Head
MeshPart directly.
Thread safety | Unsafe |
---|
History 1
ValidateUGCFullBodyAsync
Parameters (2) | ||
---|---|---|
player | Player | |
humanoidDescription | HumanoidDescription | |
Returns (1) | ||
Tuple |
Studio only. Given a Player and HumanoidDescription, all instances in the HumanoidDescription will be validated.
The HumanoidDescription is expected to include instances set on
BodyPartDescription children for each of the 6 required
BodyPart values. Optionally, it can include instances set on
AccessoryDescription children for Eyebrow
, Eyelash
, and Hair
AccessoryTypes.
Thread safety | Unsafe |
---|
History 1
Removed members 2
CreateAvatarGenerationSessionAsync
Parameters (1) | ||
---|---|---|
player | Player | |
Returns (1) | ||
AvatarGenerationSession |
Thread safety | Unsafe |
---|