7
7
using CustomizePlus . Core . Data ;
8
8
using CustomizePlus . Core . Extensions ;
9
9
using CustomizePlus . Game . Services ;
10
- using CustomizePlus . GameData . Data ;
10
+ using CustomizePlus . Game . Services . GPose ;
11
11
using CustomizePlus . GameData . Extensions ;
12
- using CustomizePlus . GameData . Services ;
13
12
using CustomizePlus . Profiles ;
14
13
using CustomizePlus . Profiles . Data ;
15
14
using CustomizePlus . Profiles . Events ;
16
15
using CustomizePlus . Templates . Events ;
17
16
using Dalamud . Plugin . Services ;
18
- using Lumina . Excel . Sheets ;
19
17
using OtterGui . Classes ;
20
18
using OtterGui . Log ;
21
19
using Penumbra . GameData . Actors ;
@@ -36,6 +34,7 @@ public unsafe sealed class ArmatureManager : IDisposable
36
34
private readonly FrameworkManager _framework ;
37
35
private readonly ObjectManager _objectManager ;
38
36
private readonly ActorManager _actorManager ;
37
+ private readonly GPoseService _gposeService ;
39
38
private readonly ArmatureChanged _event ;
40
39
41
40
/// <summary>
@@ -56,6 +55,7 @@ public ArmatureManager(
56
55
FrameworkManager framework ,
57
56
ObjectManager objectManager ,
58
57
ActorManager actorManager ,
58
+ GPoseService gposeService ,
59
59
ArmatureChanged @event )
60
60
{
61
61
_profileManager = profileManager ;
@@ -67,6 +67,7 @@ public ArmatureManager(
67
67
_framework = framework ;
68
68
_objectManager = objectManager ;
69
69
_actorManager = actorManager ;
70
+ _gposeService = gposeService ;
70
71
_event = @event ;
71
72
72
73
_templateChangedEvent . Subscribe ( OnTemplateChange , TemplateChanged . Priority . ArmatureManager ) ;
@@ -221,9 +222,16 @@ private unsafe void ApplyArmatureTransforms()
221
222
ApplyPiecewiseTransformation ( armature , actor , armature . ActorIdentifier ) ;
222
223
223
224
if ( ! _objectMovementFlagsArr [ actor . AsObject ->ObjectIndex ] )
224
- ApplyRootTranslation ( armature , actor ) ;
225
+ {
226
+ //todo: ApplyRootTranslation causes character flashing in gpose
227
+ //research if this can be fixed without breaking this functionality
228
+ if ( _gposeService . IsInGPose )
229
+ continue ;
225
230
226
- _objectMovementFlagsArr [ actor . AsObject ->ObjectIndex ] = false ;
231
+ ApplyRootTranslation ( armature , actor ) ;
232
+ }
233
+ else
234
+ _objectMovementFlagsArr [ actor . AsObject ->ObjectIndex ] = false ;
227
235
}
228
236
}
229
237
}
@@ -337,8 +345,10 @@ private void ApplyRootTranslation(Armature arm, Actor actor, bool reset = false)
337
345
var cBase = actor . Model . AsCharacterBase ;
338
346
if ( cBase != null )
339
347
{
348
+ //warn: hotpath for characters with n_root edits. IsApproximately might have some performance hit.
340
349
var rootBoneTransform = arm . GetAppliedBoneTransform ( "n_root" ) ;
341
- if ( rootBoneTransform == null )
350
+ if ( rootBoneTransform == null ||
351
+ rootBoneTransform . Translation . IsApproximately ( Vector3 . Zero , 0.00001f ) )
342
352
return ;
343
353
344
354
if ( reset )
0 commit comments