3#include <Core/Configuration/PlatformProfile.h>
4#include <EditorFramework/Assets/AssetDocumentInfo.h>
5#include <EditorFramework/Assets/AssetDocumentManager.h>
6#include <EditorFramework/Assets/Declarations.h>
7#include <EditorFramework/EditorFrameworkDLL.h>
8#include <Foundation/Algorithm/HashHelperString.h>
9#include <Foundation/Application/Config/FileSystemConfig.h>
10#include <Foundation/Configuration/Singleton.h>
11#include <Foundation/Containers/HashTable.h>
12#include <Foundation/IO/DirectoryWatcher.h>
13#include <Foundation/Logging/LogEntry.h>
14#include <Foundation/Profiling/Profiling.h>
15#include <Foundation/Threading/AtomicInteger.h>
16#include <Foundation/Threading/DelegateTask.h>
17#include <Foundation/Threading/LockedObject.h>
18#include <Foundation/Threading/Mutex.h>
19#include <Foundation/Threading/TaskSystem.h>
20#include <Foundation/Time/Timestamp.h>
21#include <ToolsFoundation/Document/DocumentManager.h>
22#include <ToolsFoundation/FileSystem/DataDirPath.h>
23#include <ToolsFoundation/FileSystem/Declarations.h>
30class plDirectoryWatcher;
34class plFileSystemWatcher;
36struct plFileChangedEvent;
37class plFileSystemModel;
41# define CURATOR_PROFILE(szName) PL_PROFILE_SCOPE(szName)
44# define CURATOR_PROFILE(Name)
54 CURATOR_PROFILE(
"plCuratorMutex");
68 enum TransformState : plUInt8
76 MissingTransformDependency,
77 MissingThumbnailDependency,
82 plUInt8 m_LastStateUpdate = 0;
83 plAssetExistanceState::Enum m_ExistanceState = plAssetExistanceState::FileAdded;
84 TransformState m_TransformState = TransformState::Unknown;
85 plUInt64 m_AssetHash = 0;
86 plUInt64 m_ThumbHash = 0;
111 plAssetExistanceState::Enum m_ExistanceState = plAssetExistanceState::FileAdded;
114 bool m_bMainAsset =
true;
130 ActivePlatformChanged,
152 void WaitForInitialize();
155 void MainThreadTick(
bool bTopLevel);
171 plUInt32 GetActiveAssetProfileIndex()
const;
174 plUInt32 FindAssetProfileByName(
const char* szPlatform);
176 plUInt32 GetNumAssetProfiles()
const;
196 void SetActiveAssetProfileByIndex(plUInt32 uiIndex,
bool bForceReevaluation =
false);
201 void SaveRuntimeProfiles();
204 void ClearAssetProfiles();
205 void SetupDefaultAssetProfiles();
207 void ComputeAllDocumentManagerAssetProfileHashes();
217 void StoreFullTransformDate();
221 void ResaveAllAssets();
227 void TransformAssetsForSceneExport(
const plPlatformProfile* pAssetProfile =
nullptr);
258 plUInt64 GetAssetDependencyHash(
plUuid assetGuid);
261 plUInt64 GetAssetReferenceHash(
plUuid assetGuid);
306 void NotifyOfAssetChange(
const plUuid& assetGuid);
307 void UpdateAssetLastAccessTime(
const plUuid& assetGuid);
310 void CheckFileSystem();
312 void NeedsReloadResources(
const plUuid& assetGuid);
314 void InvalidateAssetsWithTransformState(plAssetInfo::TransformState state);
323 void GenerateTransitiveHull(
const plStringView sAssetOrPath,
plSet<plString>& inout_deps,
bool bIncludeTransformDeps =
false,
bool bIncludeThumbnailDeps =
false,
bool bIncludePackageDeps =
false)
const;
326 void GenerateInverseTransitiveHull(
const plAssetInfo* pAssetInfo,
plSet<plUuid>& inout_inverseDeps,
bool bIncludeTransformDeps =
false,
bool bIncludeThumbnailDeps =
false)
const;
351 void OnFileChangedEvent(
const plFileChangedEvent& e);
355 void ProcessAllCoreAssets();
361 void RestartUpdateTask();
362 void ShutdownUpdateTask();
366 void RunNextUpdateTask();
372 plAssetInfo::TransformState HashAsset(
374 bool AddAssetHash(
plString& sPath,
bool bIsReference, plUInt64& out_AssetHash, plUInt64& out_ThumbHash,
bool bForce);
385 void RemoveAssetTransformState(
const plUuid& assetGuid);
386 void InvalidateAssetTransformState(
const plUuid& assetGuid);
388 plAssetInfo::TransformState UpdateAssetTransformState(
plUuid assetGuid, plUInt64& out_AssetHash, plUInt64& out_ThumbHash,
bool bForce);
389 void UpdateAssetTransformState(
const plUuid& assetGuid, plAssetInfo::TransformState state);
391 void SetAssetExistanceState(
plAssetInfo& assetInfo, plAssetExistanceState::Enum state);
396 void SetAllAssetStatusUnknown();
423 plUInt32 m_uiActiveAssetProfile = 0;
452 bool m_bRunUpdateTask =
false;
466 virtual void Execute()
override;
Definition FileSystemConfig.h:8
This class encapsulates an array and it's size. It is recommended to use this class instead of plain ...
Definition ArrayPtr.h:37
Definition AssetCurator.h:139
Definition AssetDocumentManager.h:13
OutputReliability
Definition AssetDocumentManager.h:84
Background asset processing is handled by this class. Creates EditorProcessor processes.
Definition AssetProcessor.h:104
Log for all background processing results.
Definition AssetProcessor.h:21
Keeps track of all asset tables and their state as well as reloading modified resources.
Definition AssetTableWriter.h:44
Custom mutex that allows to profile the time in the curator lock.
Definition AssetCurator.h:50
A reference to a file or folder inside a data directory.
Definition DataDirPath.h:18
The plDateTime class can be used to convert plTimestamp into a human readable form.
Definition Timestamp.h:103
Definition DynamicArray.h:81
Definition HashTable.h:333
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
Provides access to an object while managing a lock (e.g. a mutex) that ensures that during its lifeti...
Definition LockedObject.h:7
Provides a simple mechanism for mutual exclusion to prevent multiple threads from accessing a shared ...
Definition Mutex.h:13
void Unlock()
Releases a lock that has been previously acquired.
Definition Mutex_posix.h:34
void Lock()
Acquires an exclusive lock for this mutex object.
Definition Mutex_posix.h:18
Definition AssetProcessor.h:54
A Shared ptr manages a shared object and destroys that object when no one references it anymore....
Definition SharedPtr.h:10
plStringBuilder is a class that is meant for creating and modifying strings.
Definition StringBuilder.h:35
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
Given out by plTaskSystem::CreateTaskGroup to identify a task group.
Definition TaskSystemDeclarations.h:103
Base class for custom tasks.
Definition Task.h:10
A Unique ptr manages an object and destroys that object when it goes out of scope....
Definition UniquePtr.h:10
Definition AssetCurator.h:458
virtual void Execute() override
Override this to implement the task's supposed functionality.
Definition AssetUpdates.cpp:693
This data type is the abstraction for 128-bit Uuid (also known as GUID) instances.
Definition Uuid.h:11
Definition AssetCurator.h:122
Definition Declarations.h:89
Definition AssetCurator.h:62
plSet< plUuid > m_SubAssets
Main asset uses the same GUID as this (see m_Info), but is NOT stored in m_SubAssets.
Definition AssetCurator.h:99
The plBitflags class allows you to work with type-safe bitflags.
Definition Bitflags.h:82
Holds the stats for a file.
Definition OSFile.h:34
Information about a single file on disk. The file might be a document or any other file found in the ...
Definition Declarations.h:20
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54
An plResult with an additional message for the reason of failure.
Definition Status.h:12
Definition Declarations.h:82
Information about an asset or sub-asset.
Definition AssetCurator.h:107
The time class encapsulates a double value storing the time in seconds.
Definition Time.h:12