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
28a90bb7
Commit
28a90bb7
authored
3 months ago
by
Konstantin Kühlem
Browse files
Options
Downloads
Patches
Plain Diff
fix: Set anim tick behavior for all VH related meshes automatically to avoid de-sync on NDisplay
parent
c4b72bd7
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/VirtualHuman.cpp
+19
-3
19 additions, 3 deletions
Source/CharacterPlugin/Private/VirtualHuman.cpp
with
19 additions
and
3 deletions
Source/CharacterPlugin/Private/VirtualHuman.cpp
+
19
−
3
View file @
28a90bb7
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
#include
"VirtualHumanAIController.h"
#include
"VirtualHumanAIController.h"
#include
"Engine/Engine.h"
#include
"Engine/Engine.h"
#include
"CharacterPluginLogging.h"
#include
"CharacterPluginLogging.h"
#include
"HairStrandsInterface.h"
AVirtualHuman
::
AVirtualHuman
()
AVirtualHuman
::
AVirtualHuman
()
{
{
...
@@ -36,6 +37,19 @@ void AVirtualHuman::BeginPlay()
...
@@ -36,6 +37,19 @@ void AVirtualHuman::BeginPlay()
// constantly seed the random stream so we don't have cluster syncing problems
// constantly seed the random stream so we don't have cluster syncing problems
// but seed it with the name of the VH, so random behavior is different for every VH
// but seed it with the name of the VH, so random behavior is different for every VH
IdleRandomStream
=
FRandomStream
(
TextKeyUtil
::
HashString
(
GetName
()));
IdleRandomStream
=
FRandomStream
(
TextKeyUtil
::
HashString
(
GetName
()));
// Ensure all mesh components tick no matter if they are rendered
// THis fixes de-synced animations on different cluster nodes
if
(
FModuleManager
::
Get
().
IsModuleLoaded
(
"DisplayCluster"
)
&&
IDisplayCluster
::
Get
().
GetOperationMode
()
==
EDisplayClusterOperationMode
::
Cluster
)
{
TArray
<
USkeletalMeshComponent
*>
Meshes
;
GetComponents
(
Meshes
,
true
);
for
(
USkeletalMeshComponent
*
M
:
Meshes
)
{
M
->
VisibilityBasedAnimTickOption
=
EVisibilityBasedAnimTickOption
::
AlwaysTickPoseAndRefreshBones
;
}
}
}
}
// Called every frame
// Called every frame
...
@@ -332,7 +346,9 @@ void AVirtualHuman::PlayRandomIdleAnimation()
...
@@ -332,7 +346,9 @@ void AVirtualHuman::PlayRandomIdleAnimation()
IdleAnim
,
"CustomIdleSlot"
,
BlendTime
,
BlendTime
);
IdleAnim
,
"CustomIdleSlot"
,
BlendTime
,
BlendTime
);
// start timer for next random pick (make it a bit shorter to allow for blending, but only by a defined minimal amount for the animations)
// start timer for next random pick (make it a bit shorter to allow for blending, but only by a defined minimal amount for the animations)
GetWorld
()
->
GetTimerManager
().
SetTimer
(
NextIdleTimerHandle
,
this
,
&
AVirtualHuman
::
PlayRandomIdleAnimation
,
GetWorld
()
->
GetTimerManager
().
SetTimer
(
NextIdleTimerHandle
,
this
,
&
AVirtualHuman
::
PlayRandomIdleAnimation
,
DynamicMontage
->
GetPlayLength
()
-
fmin
(
2.0
*
BlendTime
,
(
DynamicMontage
->
GetPlayLength
())
*
MinBlendTime
),
false
);
DynamicMontage
->
GetPlayLength
()
-
fmin
(
2.0
*
BlendTime
,
(
DynamicMontage
->
GetPlayLength
())
*
MinBlendTime
),
false
);
}
}
else
else
{
{
...
...
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