GenerationService
만들 수 없음
서비스

*이 콘텐츠는 AI(베타)를 사용해 번역되었으며, 오류가 있을 수 있습니다. 이 페이지를 영어로 보려면 여기를 클릭하세요.


요약

메서드
GenerateMeshAsync(inputs: Dictionary,player: Player,options: Dictionary,intermediateResultCallback: function?):Tuple
사용되지 않음
GenerateModelAsync(inputs: GenerateModelInputs,schema: GenerateModelSchema,options: Dictionary?):Tuple
SegmentMeshAsync(meshPart: MeshPart,schema: GenerateModelSchema,options: Dictionary?):Tuple
상속된 멤버

API 참조
메서드
GenerateMeshAsync
사용되지 않음

GenerateModelAsync
생성
기능: DynamicGeneration
GenerationService:GenerateModelAsync(
inputs:GenerateModelInputs, schema:GenerateModelSchema, options:Dictionary?
매개 변수
inputs:GenerateModelInputs
schema:GenerateModelSchema
options:Dictionary?
반환
코드 샘플
기본 자동차 섀시 생성
local GenerationService = game:GetService("GenerationService")
local Workspace = game:GetService("Workspace")
-- 생성된 기하학을 위한 입력 설정
local inputs = {
TextPrompt = "4개의 바퀴가 있는 초록색 드래곤 자동차"
}
-- 미리 정의된 다섯 모델 자동차 섀시로 스키마 설정
local schema = {
PredefinedSchema = "Car5"
}
-- 모델 생성을 위한 호출
local success, model = pcall(function()
return GenerationService:GenerateModelAsync(inputs, schema)
end)
if success then
-- 모델을 목표 크기로 조정하고 세계 중심 근처에 위치
local targetSize = 16
local modelSize = model:GetExtentsSize()
local scaleFactor = targetSize / math.max(modelSize.X, modelSize.Y, modelSize.Z)
model:ScaleTo(scaleFactor)
model:PivotTo(CFrame.new(15, model:GetExtentsSize().Y / 2, 0))
-- 모든 부품을 고정하여 메시가 분리되지 않도록 함
for _, descendant in model:GetDescendants() do
if descendant:IsA("BasePart") then
descendant.Anchored = true
end
end
-- 모델 이름 지정 및 작업 공간에 부모로 설정
model.Name = "BasicDragonCarGeneration"
model.Parent = Workspace
end
사용자 정의 스키마를 이용한 생성
local GenerationService = game:GetService("GenerationService")
local Workspace = game:GetService("Workspace")
-- 생성할 객체를 설명합니다.
local inputs = {
TextPrompt = "네 바퀴가 달린 나무 수레",
}
-- 미리 정의된 스키마 대신 사용자 정의 다중 파트 구조를 정의합니다.
-- `Groups`의 각 항목은 생성해야 할 파트를 명명합니다.
local schema = {
SchemaDefinition = {
Groups = { "body", "wheel_fl", "wheel_fr", "wheel_rl", "wheel_rr" },
},
}
-- 모델 생성을 위한 호출을 합니다.
local success, model = pcall(function()
return GenerationService:GenerateModelAsync(inputs, schema)
end)
if success then
-- 메쉬가 분리되지 않도록 모든 파트를 고정합니다.
for _, descendant in model:GetDescendants() do
if descendant:IsA("BasePart") then
descendant.Anchored = true
end
end
-- 모델의 이름을 지정하고 작업 공간에 부모로 설정합니다.
model.Name = "CustomSchemaGeneration"
model.Parent = Workspace
end
이미지를 기반으로 한 생성
local GenerationService = game:GetService("GenerationService")
local Workspace = game:GetService("Workspace")
-- 생성 조건으로 사용되는 참조 이미지입니다. `0`을 자신의 업로드한 이미지의 자산
-- ID로 교체하세요.
local imageAssetId = 0
local inputs = {
Image = Content.fromAssetId(imageAssetId),
TextPrompt = "낮은 다각형 보물 상자",
}
-- 단일 메쉬 출력을 생성합니다.
local schema = {
PredefinedSchema = "Body1",
}
-- 모델 생성을 위한 호출을 합니다.
local success, model = pcall(function()
return GenerationService:GenerateModelAsync(inputs, schema)
end)
if success then
-- 메쉬가 분리되지 않도록 모든 부품을 고정합니다.
for _, descendant in model:GetDescendants() do
if descendant:IsA("BasePart") then
descendant.Anchored = true
end
end
-- 모델의 이름을 지정하고 작업 공간에 부모로 설정합니다.
model.Name = "ImageConditionedGeneration"
model.Parent = Workspace
end

LoadGeneratedMeshAsync
생성
기능: DynamicGeneration
GenerationService:LoadGeneratedMeshAsync(generationId:string):MeshPart
매개 변수
generationId:string
반환

SegmentMeshAsync
생성
기능: DynamicGeneration
GenerationService:SegmentMeshAsync(
meshPart:MeshPart, schema:GenerateModelSchema, options:Dictionary?
매개 변수
meshPart:MeshPart
schema:GenerateModelSchema
options:Dictionary?
반환

©2026 Roblox Corporation. Roblox 및 Roblox 로고, 'Powering Imagination'은 미국 및 기타 국가 내 당사의 등록 및 미등록 상표입니다.