AvatarCreationService

แสดงที่เลิกใช้งานแล้ว

*เนื้อหานี้แปลโดยใช้ AI (เวอร์ชัน Beta) และอาจมีข้อผิดพลาด หากต้องการดูหน้านี้เป็นภาษาอังกฤษ ให้คลิกที่นี่

ไม่สามารถสร้าง
บริการ

AvatarCreationService เป็นบริการที่สนับสนุนผู้สร้างอวตารนักพัฒนา โดยให้วิธีที่สนับสนุนการเรียกใช้การสร้างอวตารจากภายในประสบการณ์

สรุป

วิธีการ

คุณสมบัติ

วิธีการ

GetValidationRules


ส่งค่ากลับ

GenerateAvatar2DPreviewAsync

ผลตอบแทน

พารามิเตอร์

avatarGeneration2dPreviewParams: Dictionary
ค่าเริ่มต้น: ""

ส่งค่ากลับ

GetBatchTokenDetailsAsync

ผลตอบแทน

พารามิเตอร์

tokenIds: Array
ค่าเริ่มต้น: ""

ส่งค่ากลับ

LoadAvatar2DPreviewAsync

ผลตอบแทน

พารามิเตอร์

previewId: string
ค่าเริ่มต้น: ""

ส่งค่ากลับ

LoadGeneratedAvatarAsync

ผลตอบแทน

พารามิเตอร์

generationId: string
ค่าเริ่มต้น: ""

ส่งค่ากลับ

PrepareAvatarForPreviewAsync

()
ผลตอบแทน

พารามิเตอร์

humanoidModel: Model
ค่าเริ่มต้น: ""

ส่งค่ากลับ

()

PromptCreateAvatarAsync

ผลตอบแทน

พารามิเตอร์

tokenId: string
ค่าเริ่มต้น: ""
player: Player
ค่าเริ่มต้น: ""
humanoidDescription: HumanoidDescription
ค่าเริ่มต้น: ""

ส่งค่ากลับ

ตัวอย่างโค้ด

PromptCreateAvatarAsync

local AvatarCreationService = game:GetService("AvatarCreationService")
export type BodyPartInfo = {
bodyPart: Enum.BodyPart,
instance: Instance, --Folder with Created MeshParts
}
export type BodyPartList = { BodyPartInfo }
local function publishAvatar(bodyPartInstances: BodyPartList, player: Player, tokenId: string)
local humanoidDescription = Instance.new("HumanoidDescription")
for _, bodyPartInfo in bodyPartInstances do
local bodyPartDescription = Instance.new("BodyPartDescription")
bodyPartDescription.Instance = bodyPartInfo.instance
bodyPartDescription.BodyPart = bodyPartInfo.bodyPart
bodyPartDescription.Parent = humanoidDescription
end
local pcallSuccess, result, resultMessage = pcall(function()
return AvatarCreationService:PromptCreateAvatarAsync(tokenId, player, humanoidDescription)
end)
if pcallSuccess then
if result == Enum.PromptCreateAvatarResult.Success then
print("Successfully uploaded with BundleId: ", resultMessage)
else
print("Unsuccessfully uploaded with error message:", resultMessage)
end
else
print("Avatar failed to create.")
end
end

ValidateUGCAccessoryAsync

ผลตอบแทน

พารามิเตอร์

player: Player
ค่าเริ่มต้น: ""
accessory: Instance
ค่าเริ่มต้น: ""
accessoryType: Enum.AccessoryType
ค่าเริ่มต้น: ""

ส่งค่ากลับ

ValidateUGCBodyPartAsync

ผลตอบแทน

พารามิเตอร์

player: Player
ค่าเริ่มต้น: ""
instance: Instance
ค่าเริ่มต้น: ""
bodyPart: Enum.BodyPart
ค่าเริ่มต้น: ""

ส่งค่ากลับ

ValidateUGCFullBodyAsync

ผลตอบแทน

พารามิเตอร์

player: Player
ค่าเริ่มต้น: ""
humanoidDescription: HumanoidDescription
ค่าเริ่มต้น: ""

ส่งค่ากลับ

เหตุการณ์

AvatarModerationCompleted

พารามิเตอร์

outfitId: number
moderationStatus: Enum.ModerationStatus