Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Character Plugin
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LuFG VR VIS
VR-Group
Unreal-Development
Plugins
Character Plugin
Commits
dace0402
Commit
dace0402
authored
2 years ago
by
Patrick Nossol
Committed by
Flybel
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
theoretical compiling correction for 5.1
parent
281bd7d4
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Source/CharacterPlugin/Private/Helper/VHFaceAnimation.cpp
+35
-16
35 additions, 16 deletions
Source/CharacterPlugin/Private/Helper/VHFaceAnimation.cpp
with
35 additions
and
16 deletions
Source/CharacterPlugin/Private/Helper/VHFaceAnimation.cpp
+
35
−
16
View file @
dace0402
...
@@ -372,11 +372,18 @@ UAnimSequence* UVHFaceAnimation::SaveAsAnimSequence(FString AnimName)
...
@@ -372,11 +372,18 @@ UAnimSequence* UVHFaceAnimation::SaveAsAnimSequence(FString AnimName)
AnimationSequence
=
NewObject
<
UAnimSequence
>
(
AnimationSequence
=
NewObject
<
UAnimSequence
>
(
Package
,
UAnimSequence
::
StaticClass
(),
*
AnimNameOnly
,
Package
,
UAnimSequence
::
StaticClass
(),
*
AnimNameOnly
,
RF_Public
|
RF_Standalone
);
RF_Public
|
RF_Standalone
);
IAnimationDataController
&
Controller
=
AnimationSequence
->
GetController
();
if
(
AnimationSequence
)
if
(
AnimationSequence
)
{
{
AnimationSequence
->
SetSkeleton
(
AnimInstance
->
GetSkelMeshComponent
()
->
SkeletalMesh
->
GetSkeleton
());
AnimationSequence
->
SetSkeleton
(
AnimInstance
->
GetSkelMeshComponent
()
->
SkeletalMesh
->
GetSkeleton
());
AnimationSequence
->
SetRawNumberOfFrame
(
AnimationData
.
TimeSteps
.
Num
());
AnimationSequence
->
SetSequenceLength
(
AnimationData
.
TimeSteps
.
Last
().
Timestamp
);
AnimationSequence
->
SequenceLength
=
AnimationData
.
TimeSteps
.
Last
().
Timestamp
;
Controller
.
SetPlayLength
(
AnimationData
.
TimeSteps
.
Last
().
Timestamp
);
//rate = nr frames / length
Controller
.
SetFrameRate
(
FFrameRate
(
AnimationData
.
TimeSteps
.
Num
(),
AnimationData
.
TimeSteps
.
Last
().
Timestamp
));
USkeleton
*
Skeleton
=
AnimationSequence
->
GetSkeleton
();
USkeleton
*
Skeleton
=
AnimationSequence
->
GetSkeleton
();
FFloatCurve
*
curve
;
FFloatCurve
*
curve
;
...
@@ -422,28 +429,40 @@ UAnimSequence* UVHFaceAnimation::SaveAsAnimSequence(FString AnimName)
...
@@ -422,28 +429,40 @@ UAnimSequence* UVHFaceAnimation::SaveAsAnimSequence(FString AnimName)
}
}
// Add bone curves
// Add bone curves
FRawAnimSequenceTrack
HeadRawTrack
;
TArray
<
FQuat4f
>
HeadRawTrack
;
FRawAnimSequenceTrack
REyeRawTrack
;
TArray
<
FQuat4f
>
REyeRawTrack
;
FRawAnimSequenceTrack
LEyeRawTrack
;
TArray
<
FQuat4f
>
LEyeRawTrack
;
FRawAnimSequenceTrack
JawRawTrack
;
TArray
<
FQuat4f
>
JawRawTrack
;
for
(
int
FrameNr
=
0
;
FrameNr
<
AnimationData
.
TimeSteps
.
Num
();
FrameNr
++
)
{
for
(
int
FrameNr
=
0
;
FrameNr
<
AnimationData
.
TimeSteps
.
Num
();
FrameNr
++
)
{
FFrameData
&
Timestep
=
AnimationData
.
TimeSteps
[
FrameNr
];
FFrameData
&
Timestep
=
AnimationData
.
TimeSteps
[
FrameNr
];
HeadRawTrack
.
RotKeys
.
Add
(
Timestep
.
HeadRotation
.
Quaternion
());
HeadRawTrack
.
Add
(
FQuat4f
(
Timestep
.
HeadRotation
.
Quaternion
())
)
;
REyeRawTrack
.
RotKeys
.
Add
(
Timestep
.
RightEyeRotation
.
Quaternion
());
REyeRawTrack
.
Add
(
FQuat4f
(
Timestep
.
RightEyeRotation
.
Quaternion
())
)
;
LEyeRawTrack
.
RotKeys
.
Add
(
Timestep
.
LeftEyeRotation
.
Quaternion
());
LEyeRawTrack
.
Add
(
FQuat4f
(
Timestep
.
LeftEyeRotation
.
Quaternion
())
)
;
JawRawTrack
.
RotKeys
.
Add
(
Timestep
.
JawRotation
.
Quaternion
());
JawRawTrack
.
Add
(
FQuat4f
(
Timestep
.
JawRotation
.
Quaternion
())
)
;
}
}
AVirtualHuman
*
owner
=
Cast
<
AVirtualHuman
>
(
GetOwner
());
AVirtualHuman
*
owner
=
Cast
<
AVirtualHuman
>
(
GetOwner
());
const
BoneNames
&
bones
=
owner
->
GetBoneNames
();
const
BoneNames
&
bones
=
owner
->
GetBoneNames
();
if
(
bUseHeadRotation
)
AnimationSequence
->
AddNewRawTrack
(
bones
.
head
,
&
HeadRawTrack
);
if
(
bUseEyeRotations
)
AnimationSequence
->
AddNewRawTrack
(
bones
.
eye_r
,
&
REyeRawTrack
);
if
(
bUseHeadRotation
)
{
if
(
bUseEyeRotations
)
AnimationSequence
->
AddNewRawTrack
(
bones
.
eye_l
,
&
LEyeRawTrack
);
Controller
.
AddBoneTrack
(
bones
.
head
);
AnimationSequence
->
AddNewRawTrack
(
bones
.
jaw
,
&
JawRawTrack
);
Controller
.
SetBoneTrackKeys
(
bones
.
head
,
{},
HeadRawTrack
,
{});
}
if
(
bUseEyeRotations
)
{
Controller
.
AddBoneTrack
(
bones
.
eye_r
);
Controller
.
SetBoneTrackKeys
(
bones
.
eye_r
,
{},
REyeRawTrack
,
{});
Controller
.
AddBoneTrack
(
bones
.
eye_l
);
Controller
.
SetBoneTrackKeys
(
bones
.
eye_l
,
{},
LEyeRawTrack
,
{});
}
Controller
.
AddBoneTrack
(
bones
.
jaw
);
Controller
.
SetBoneTrackKeys
(
bones
.
jaw
,
{},
JawRawTrack
,
{});
//the metahuman jaw bone only lowers the chin and not the mouth and teeth
//the metahuman jaw bone only lowers the chin and not the mouth and teeth
if
(
owner
->
GetBodyType
()
==
EBodyType
::
MetaHuman
)
{
if
(
owner
->
GetBodyType
()
==
EBodyType
::
MetaHuman
)
{
AnimationSequence
->
AddNewRawTrack
(
bones
.
teeth_lower
,
&
JawRawTrack
);
Controller
.
AddBoneTrack
(
bones
.
teeth_lower
);
AnimationSequence
->
AddNewRawTrack
(
bones
.
mouth_lower
,
&
JawRawTrack
);
Controller
.
SetBoneTrackKeys
(
bones
.
teeth_lower
,
{},
JawRawTrack
,
{});
Controller
.
AddBoneTrack
(
bones
.
mouth_lower
);
Controller
.
SetBoneTrackKeys
(
bones
.
mouth_lower
,
{},
JawRawTrack
,
{});
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment