UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AnimationCompressionDerivedData.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6
7#if WITH_EDITORONLY_DATA
8#include "DerivedDataRequestOwner.h"
11#include "Async/AsyncWork.h"
13#include "IO/IoHash.h"
14#endif // WITH_EDITORONLY_DATA
15
17
19class UAnimSequence;
20namespace UE::DerivedData
21{
23 struct FCacheKey;
24}
25
26namespace UE::Anim
27{
28#if ENABLE_COOK_STATS
29 namespace AnimSequenceCookStats
30 {
31 extern FCookStats::FDDCResourceUsageStats UsageStats;
32 }
33#endif
34
35#if WITH_EDITOR
36 class FAnimationSequenceAsyncCacheTask;
37
39 {
40 FAnimationSequenceAsyncCacheTask* Owner;
42 public:
44 FAnimationSequenceAsyncCacheTask* InOwner,
45 const FIoHash& InIoHash)
46 : Owner(InOwner)
48 {
49 }
50
51 FORCEINLINE TStatId GetStatId() const
52 {
54 }
55
56 void DoWork() const;
57 };
58
59 struct FAnimationSequenceAsyncBuildTask : public FAsyncTask<FAnimationSequenceAsyncBuildWorker>
60 {
62 FAnimationSequenceAsyncCacheTask* InOwner,
63 const FIoHash& InIoHash)
65 {
66 }
67 };
68
69 class FAnimationSequenceAsyncCacheTask
70 {
71 public:
72 FAnimationSequenceAsyncCacheTask(const FIoHash& InKeyHash,
77
79
80 void Cancel();
81 void Wait(bool bPerformWork = true);
82 bool WaitWithTimeout(float TimeLimitSeconds);
83 bool Poll() const;
85 bool WasCancelled() const { return CompressibleAnimPtr->IsCancelled() || Owner.IsCanceled(); }
86 FCompressedAnimSequence* GetTargetCompressedData() const { return CompressedData; }
87 const ITargetPlatform* GetTargetPlatform() const { return TargetPlatform; }
88 private:
89 void BeginCache(const FIoHash& KeyHash);
90 void EndCache(DerivedData::FCacheGetValueResponse&& Response);
91 bool BuildData() const;
92 void LaunchCompressionTask(const FSharedString& Name, const DerivedData::FCacheKey& Key);
94
95 private:
97 DerivedData::FRequestOwner Owner;
98
101 FCompressedAnimSequence* CompressedData;
104 const ITargetPlatform* TargetPlatform;
106 int64 RequiredMemory;
107 };
108#endif
109}
#define FORCEINLINE
Definition AndroidPlatform.h:140
FPlatformTypes::int64 int64
A 64-bit signed integer.
Definition Platform.h:1127
#define RETURN_QUICK_DECLARE_CYCLE_STAT(StatId, GroupId)
Definition Stats.h:655
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
auto Response
Definition ExternalRpcRegistry.cpp:598
EQueuedWorkPriority
Definition QueuedThreadPool.h:14
Definition AsyncWork.h:585
Definition AsyncWork.h:663
Definition QueuedThreadPool.h:105
Definition RefCounting.h:454
Definition UniquePtr.h:107
Definition AnimSequence.h:203
Definition AnimationAsset.h:42
Definition DerivedData.cpp:40
UE_AUTORTFM_NOAUTORTFM FWaitState Wait(const void *Address, bool(*CanWait)(void *), void *CanWaitContext, void(*BeforeWait)(void *), void *BeforeWaitContext)
Definition ParkingLot.cpp:504
Definition AnimCompressionTypes.h:775
Definition IoHash.h:33
Definition LightweightStats.h:416
Definition WeakObjectPtrTemplates.h:25