Pose

사용되지 않는 항목 표시

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

포즈는 연결된 Motor6D 에 적용된 BasePart 을 포함합니다. 제어되는 부품은 1> 포즈의 이름1>에 따라 이름이 변경됩니다.

포즈는 애니메이션의 기본 빌딩 블록이며, Keyframes 와 함께, KeyframeSequences 를 구성합니다.

포즈, 조인트 및 계층

Class.BasePart에 포즈가 이름별로 지정되지만, 애니메이션 플레이백 동안 조작된 개체는 실제로 이 부분에 연결된 Motor6D입니다. 애니메이션 리그는 모델의 루트 부분을 통해 확장됩니다.

R15 캐릭터 리그에서 뿌리 부분은 HumanoidRootPart입니다. 하부 몸통은 'Root'라는 이름의 모터에 연결되어 HumanoidRootPart에 연결됩니다. 따라서 CFrame 의 포즈 이름 'LowerTorso' 아래에 있는 Keyframe 의 모터에 적용됩니

포즈는 공동 계층을 기반으로 한 Keyframe 에 정렬됩니다. 즉, 포즈의 CFrame 은 부모가 포즈와 연결된 부품에 적용됩니다. 아래에서 볼 수 있듯이 구조의 포즈 위치에 대한 시각적 예시를 보십시오.

포즈 CFrame

Roblox 애니메이션 시스템은 모터의 상대 변환을 조작하여 해당 모터에 적용되는 Pose.CFrame 을 조정하여 해당 모터에 적용되는 Motor6D 를 변경합니다. 원

코드 샘플

This sample includes a function that will generate a 'blank' keyframe containing blank poses for all of the model's connected parts in the correct hierarchical order.

Keyframe Generate Poses

local function generateKeyframe(model)
if not model.PrimaryPart then
warn("No primary part set")
return
end
local rootPart = model.PrimaryPart:GetRootPart()
if not rootPart then
warn("Root part not found")
return
end
local partsAdded = {}
partsAdded[rootPart] = true
local function addPoses(part, parentPose)
-- get all of the joints attached to the part
for _, joint in pairs(part:GetJoints()) do
-- we're only interested in Motor6Ds
if joint:IsA("Motor6D") then
-- find the connected part
local connectedPart = nil
if joint.Part0 == part then
connectedPart = joint.Part1
elseif joint.Part1 == part then
connectedPart = joint.Part0
end
if connectedPart then
-- make sure we haven't already added this part
if not partsAdded[connectedPart] then
partsAdded[connectedPart] = true
-- create a pose
local pose = Instance.new("Pose")
pose.Name = connectedPart.Name
parentPose:AddSubPose(pose)
-- recurse
addPoses(connectedPart, pose)
end
end
end
end
end
local keyframe = Instance.new("Keyframe")
-- populate the keyframe
local rootPose = Instance.new("Pose")
rootPose.Name = rootPart.Name
addPoses(rootPart, rootPose)
keyframe:AddPose(rootPose)
return keyframe
end
local character = script.Parent
local keyframe = generateKeyframe(character)
print(keyframe)

This code sample includes a function to reset the CFrame of the Poses in a Keyframe.

Keyframe Reset Poses

local function resetPoses(parent)
-- both functions are equivalent to GetChildren
local poses = parent:IsA("Keyframe") and parent:GetPoses() or parent:IsA("Pose") and parent:GetSubPoses()
for _, pose in pairs(poses) do
if pose:IsA("Pose") then
pose.CFrame = CFrame.new()
-- recurse
resetPoses(pose)
end
end
end

요약

속성

속성PoseBase에서 상속되었습니다

메서드

속성

CFrame

병렬 읽기

CFrame은 Class.Motor6D와 일치하는 Motor6D 에 적용됩니다. 이 Pose 가 변경되면 원래 1> Class.Motor6D.C01>

Pose 개체는 공동 계층을 기반으로 Keyframe 개체에 정렬됩니다. 이는 부모와 관련된 부품에 적용된 Pose.CFrame 이 부모와 관련된 부품의 부모에 적용된 것을 의미합니다.

메서드

AddSubPose

void

새 포즈의 Pose 에 부모로 지정하여 추가합니다. 이 함수는 새 포즈의 Pose 에 지정하는 것과 동일합니다.

참고, 이 함수는 Pose가 아닌 인스턴스에 포즈 매개 변수로 지정된 경우에도 오류가 발생하지 않고 부모가 되어 성공적으로 상속됩니다.

매개 변수

pose: Instance

추가될 Pose입니다.


반환

void

코드 샘플

This sample demonstrates quickly the Keyframe.AddPose, Keyframe.RemovePose and Pose.AddSubPose and Pose.RemoveSubPose functions. Note these are functionally equivalent to parenting and un-parenting the poses.

Keyframe Add/Remove Pose

local keyframe = Instance.new("Keyframe")
keyframe.Parent = workspace
local pose = Instance.new("Pose")
pose.EasingStyle = Enum.PoseEasingStyle.Cubic
pose.EasingDirection = Enum.PoseEasingDirection.Out
local pose2 = Instance.new("Pose")
pose2.EasingStyle = Enum.PoseEasingStyle.Cubic
pose2.EasingDirection = Enum.PoseEasingDirection.Out
keyframe:AddPose(pose) -- pose.Parent = keyframe
task.wait(2)
keyframe:RemovePose(pose) -- pose.Parent = nil
task.wait(2)
keyframe:AddPose(pose) -- pose.Parent = keyframe
task.wait(2)
pose:AddSubPose(pose2) -- pose2.Parent = pose
task.wait(2)
pose:RemoveSubPose(pose2) -- pose2.Parent = nil

GetSubPoses

Instances

Class.Pose 에 추가된 모든 하위 Class.Pose|Poses 을 포함하는 배열을 반환합니다. 이것은 함수적으로 Class.Instance:GetChildren() 함수를 사용하는 것과 동일합니다.

참고: 이 함수는 Pose의 모든 자식을 반환하지만, 현재 Pose가 없거나 Instances가 있는 경우에는 반환하지 않습니다.


반환

Instances

하위 Poses 배열.

코드 샘플

This code sample includes a function to reset the CFrame of the Poses in a Keyframe.

Keyframe Reset Poses

local function resetPoses(parent)
-- both functions are equivalent to GetChildren
local poses = parent:IsA("Keyframe") and parent:GetPoses() or parent:IsA("Pose") and parent:GetSubPoses()
for _, pose in pairs(poses) do
if pose:IsA("Pose") then
pose.CFrame = CFrame.new()
-- recurse
resetPoses(pose)
end
end
end

RemoveSubPose

void

Class.Pose 를 제거하고 부모로 nil로 Pose 를 지정하면 새 포즈의 Instance.Parent 를 일치시킵니다. 이것은 새 포즈의 1>Class.Instance.Parent1> 를 일치시키는 것과 기능적으로 동일합니다.

참고: Instance 이외의 다른 Pose 은 이 함수에 의해 Pose 매개 변수로 사용되지 않습니다. 이 함수는 오류를 제공하지 않습니다.

매개 변수

pose: Instance

제거할 Pose입니다.


반환

void

코드 샘플

This sample demonstrates quickly the Keyframe.AddPose, Keyframe.RemovePose and Pose.AddSubPose and Pose.RemoveSubPose functions. Note these are functionally equivalent to parenting and un-parenting the poses.

Keyframe Add/Remove Pose

local keyframe = Instance.new("Keyframe")
keyframe.Parent = workspace
local pose = Instance.new("Pose")
pose.EasingStyle = Enum.PoseEasingStyle.Cubic
pose.EasingDirection = Enum.PoseEasingDirection.Out
local pose2 = Instance.new("Pose")
pose2.EasingStyle = Enum.PoseEasingStyle.Cubic
pose2.EasingDirection = Enum.PoseEasingDirection.Out
keyframe:AddPose(pose) -- pose.Parent = keyframe
task.wait(2)
keyframe:RemovePose(pose) -- pose.Parent = nil
task.wait(2)
keyframe:AddPose(pose) -- pose.Parent = keyframe
task.wait(2)
pose:AddSubPose(pose2) -- pose2.Parent = pose
task.wait(2)
pose:RemoveSubPose(pose2) -- pose2.Parent = nil

이벤트