728x90
참고 1 블렌드
http://udn.epicgames.com/Three/AnimationNodesKR.html#AnimNodeSlot
참고 2 루트모션
http://udn.epicgames.com/Three/RootMotionKR.html
중요한 것은 AnimTreeTemplate 에서 디폴트로 활성화 되어있을 bEarlyAnimEndNotify 가 true 로 체크되어있나
봐줘야 된다.. 블렌드는 애초에 Anim Start 라던가 End 라는게 없어서 저 옵션이 활성화 되어있으면 대충 다른 Anim
으로의 블랜딩이 시작될 때 End 가 떨어진다 (단발성 Anim 이라면 루트모션의 적용이 쉽지만..)
주석 붙은 부분만 유심히 보면 되고 그대로 가져가다고 컴파일 되진 않는다 ㅋ (주석은 UDN 사이트의 날것을 사용했다)
예제
위의 스샷 처럼 slot node 에 의존할 경우 기본 재생 애니가 있다면 결국 단발성 애니가 끝나고 wait 애니로 블랜드되면서 wait 의 RootBone 속성을 가져가니 End 부분에서 별도로 처리하는 부분은 주석을 처리해도 되는 것이다..
http://udn.epicgames.com/Three/AnimationNodesKR.html#AnimNodeSlot
참고 2 루트모션
http://udn.epicgames.com/Three/RootMotionKR.html
중요한 것은 AnimTreeTemplate 에서 디폴트로 활성화 되어있을 bEarlyAnimEndNotify 가 true 로 체크되어있나
봐줘야 된다.. 블렌드는 애초에 Anim Start 라던가 End 라는게 없어서 저 옵션이 활성화 되어있으면 대충 다른 Anim
으로의 블랜딩이 시작될 때 End 가 떨어진다 (단발성 Anim 이라면 루트모션의 적용이 쉽지만..)
주석 붙은 부분만 유심히 보면 되고 그대로 가져가다고 컴파일 되진 않는다 ㅋ (주석은 UDN 사이트의 날것을 사용했다)
예제
function float PlayAnimationBySlot(SkeletalMeshComponent SkelComp, Name SlotName,
Name AnimName, float fRate, float fInTime, float fOutTime, bool bLoop=false, bool bOverride=true)
{
local AnimNodeSlot AnimNodeSlot;
local AnimNodeSequence SeqNode;
local float fTime;
AnimNodeSlot = AnimNodeSlot(SkelComp.FindAnimNode(SlotName));
if(AnimNodeSlot != None)
{
AnimNodeSlot.SetActorAnimEndNotification(true);
fTime = AnimNodeSlot.PlayCustomAnim(AnimName, fRate, fInTime, fOutTime, bLoop, bOverride);
///// 예제 그대로 주석을 가져왔다 ㅋㅋ 어체 한번 괴팍하구먼
SeqNode = AnimNodeSlot.GetCustomAnimNodeSeq();
// 애니메이션 노드에 루트 모션 켜기
SeqNode.SetRootBoneAxisOption(RBA_Translate, RBA_Translate, RBA_Default);
// 애니메이션 노드더러 애니메이션 재생이 완료되면 알리라 이르라
SeqNode.bCauseActorAnimEnd = TRUE;
// 메시더러 액터 트렌슬레이션에 루트 모션을 사용하라 이르라
// RMM_Translate 애니에 따라 이동
// RMM_Velocity 가중치 적용 (velocity 값에 따라 제자리에서 동작하기도 함)
SkelComp.RootMotionMode = RMM_Translate;
// 메시더러 루트 모션이 언제 적용될지 알리라 이르라
// 그때 짐이 피직스 운동에서 애니메이션 운동으로 매끄럽게 전환해 줄 터이니
SkelComp.bRootMotionModeChangeNotify = TRUE;
/////
return fTime;
}
return 0.0f;
}
simulated event OnAnimEnd(AnimNodeSequence SeqNode, float PlayedTime, float ExcessTime)
{
// 루트 모션을 버리면 메시는 제자리에 고정될 테니
// 다른 애니메이션을 적절히 블렌딩해 줘야 할 듯
// SeqNode.SetRootBoneAxisOption(RBA_Default, RBA_Default, RBA_Default);
// 메시더러 루트 모션을 그만 놓아주라 이르라
Mesh.RootMotionMode = RMM_Ignore;
}
simulated event RootMotionModeChanged(SkeletalMeshComponent SkelComp)
{
/**
* 루트 모션의 효력은 다음 프레임부터 나타날 터이니
* 폰 운동을 죽이고 루트 모션을 들라 하라
*/
if(SkelComp.RootMotionMode == RMM_Translate)
{
Velocity = vect(0.f, 0.f, 0.f);
Acceleration = vect(0.f, 0.f, 0.f);
}
// 노티파이 끄고
SkelComp.bRootMotionModeChangeNotify = false;
}
위의 스샷 처럼 slot node 에 의존할 경우 기본 재생 애니가 있다면 결국 단발성 애니가 끝나고 wait 애니로 블랜드되면서 wait 의 RootBone 속성을 가져가니 End 부분에서 별도로 처리하는 부분은 주석을 처리해도 되는 것이다..
728x90
'프로그래밍 > Unreal Engine' 카테고리의 다른 글
| UDK > 내 게임 만들기 (4) (0) | 2012.02.08 |
|---|---|
| UDK > 내 게임 만들기 (3) (0) | 2012.02.08 |
| UDK > RigidBody (0) | 2012.01.30 |
| UDK > 언리얼 마스터링 > 함수 (0) | 2012.01.27 |
| UDK > 머테리얼 마스크 (0) | 2012.01.19 |
댓글