3#include <EditorFramework/Assets/AssetDocumentInfo.h>
4#include <EditorFramework/Assets/Declarations.h>
5#include <EditorFramework/EditorFrameworkDLL.h>
6#include <EditorFramework/IPC/IPCObjectMirrorEditor.h>
7#include <ToolsFoundation/Document/Document.h>
8#include <ToolsFoundation/Object/DocumentObjectManager.h>
17enum class plAssetDocEngineConnection : plUInt8
32 SimulationSpeed = PL_BIT(3),
34 Visualizers = PL_BIT(5),
55 bool IsThumbnailUpToDate(plUInt64 uiExpectedHash, plUInt16 uiVersion)
const {
return (m_uiHash == uiExpectedHash && m_uiVersion == uiVersion); }
69 plUInt64 m_uiHash = 0;
70 plUInt16 m_uiVersion = 0;
71 plUInt16 m_uiReserved = 0;
104 plUInt16 GetAssetTypeVersion()
const;
146 void SyncObjectsToEngine()
const;
151 void SendDocumentOpenMessage(
bool bOpen);
165 plUInt64 GetDocumentHash()
const;
168 void GetChildHash(
const plDocumentObject* pObject, plUInt64& inout_uiHash)
const;
178 virtual plTaskGroupID InternalSaveDocument(AfterSaveCallback callback)
override;
183 virtual void InitializeAfterLoading(
bool bFirstTimeCreation)
override;
184 virtual void InitializeAfterLoadingAndSaving()
override;
237 return RemoteCreateThumbnail(thumbnailInfo, {&defVal, 1});
241 plStatus SaveThumbnail(
const plImage& img,
const ThumbnailInfo& thumbnailInfo)
const;
244 plStatus SaveThumbnail(
const QImage& img,
const ThumbnailInfo& thumbnailInfo)
const;
247 void AppendThumbnailInfo(
plStringView sThumbnailFile,
const ThumbnailInfo& thumbnailInfo)
const;
258 virtual void SetCommonAssetUiState(plCommonAssetUiState::Enum state,
double value);
261 virtual double GetCommonAssetUiState(plCommonAssetUiState::Enum state)
const;
267 plUInt32 m_uiCommonAssetStateFlags = 0;
287 plAssetDocEngineConnection m_EngineConnectionType = plAssetDocEngineConnection::None;
This class encapsulates an array and it's size. It is recommended to use this class instead of plain ...
Definition ArrayPtr.h:37
The thumbnail info containing the hash of the file is appended to assets. The serialized size of this...
Definition AssetDocument.h:49
void SetFileHashAndVersion(plUInt64 uiHash, plUInt16 v)
Sets the asset file hash.
Definition AssetDocument.h:58
bool IsThumbnailUpToDate(plUInt64 uiExpectedHash, plUInt16 uiVersion) const
Checks whether the stored file contains the same hash.
Definition AssetDocument.h:55
constexpr plUInt32 GetSerializedSize() const
Returns the serialized size of the thumbnail info. Used to seek to the end of the file and find the t...
Definition AssetDocument.h:66
Definition AssetDocument.h:42
EngineStatus
Definition AssetDocument.h:111
virtual void InternalGetMetaDataHash(const plDocumentObject *pObject, plUInt64 &inout_uiHash) const
Computes the hash for transform relevant meta data of the given document object and combines it with ...
Definition AssetDocument.h:171
virtual plVariant GetCreateEngineMetaData() const
Passed into plEngineProcessDocumentContext::Initialize on the engine process side....
Definition AssetDocument.h:122
virtual plTransformStatus InternalTransformAsset(plStreamWriter &stream, plStringView sOutputTag, const plPlatformProfile *pAssetProfile, const plAssetFileHeader &AssetHeader, plBitflags< plTransformFlags > transformFlags)=0
Override this and write the transformed file for the given szOutputTag into the given stream.
plEditorEngineConnection * GetEditorEngineConnection() const
Returns the plEditorEngineConnection for this document.
Definition AssetDocument.h:131
EngineStatus GetEngineStatus() const
Returns the current state of the engine process side of this document.
Definition AssetDocument.h:119
plEvent< const plCommonAssetUiState & > m_CommonAssetUiChangeEvent
Used to broadcast state change events for common asset states.
Definition AssetDocument.h:264
Definition AssetDocumentInfo.h:7
Definition AssetDocumentManager.h:13
virtual void InternalAfterSaveDocument()
A hook to execute additional code after SUCCESSFULLY saving a document. E.g. manual asset transform c...
Definition Document.h:259
Definition Declarations.h:72
Definition DocumentObjectBase.h:11
Represents to content of a document. Every document has exactly one root object under which all objec...
Definition DocumentObjectManager.h:116
Definition EngineProcessConnection.h:108
Base class for all messages that are tied to some document.
Definition EngineProcessMessages.h:151
Definition SyncObject.h:11
Definition HashTable.h:333
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
A class containing image data and associated meta data.
Definition Image.h:103
This class holds information about reflected types. Each instance represents one type that is known t...
Definition RTTI.h:30
Interface for binary in (read) streams.
Definition Stream.h:22
Interface for binary out (write) streams.
Definition Stream.h:107
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
A Unique ptr manages an object and destroys that object when it goes out of scope....
Definition UniquePtr.h:10
This data type is the abstraction for 128-bit Uuid (also known as GUID) instances.
Definition Uuid.h:11
plVariant is a class that can store different types of variables, which is useful in situations where...
Definition Variant.h:44
Definition Declarations.h:89
The plBitflags class allows you to work with type-safe bitflags.
Definition Bitflags.h:82
Frequently needed asset document states, to prevent code duplication.
Definition AssetDocument.h:26
Definition EngineProcessConnection.h:63
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