Open 3D Engine AzToolsFramework API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AzToolsFramework::Prefab::InstanceToTemplatePropagator Class Reference

Inherits AzToolsFramework::Prefab::InstanceToTemplateInterface.

Public Member Functions

 AZ_RTTI (InstanceToTemplatePropagator, "{526F7B55-84F9-4EA9-8180-19C5DBCD0103}", InstanceToTemplateInterface)
 
 AZ_CLASS_ALLOCATOR (InstanceToTemplatePropagator, AZ::SystemAllocator)
 
void RegisterInstanceToTemplateInterface ()
 
void UnregisterInstanceToTemplateInterface ()
 
bool GenerateEntityDomBySerializing (PrefabDom &entityDom, const AZ::Entity &entity) override
 
bool GenerateInstanceDomBySerializing (PrefabDom &instanceDom, const Instance &instance) override
 
bool GeneratePatch (PrefabDom &generatedPatch, const PrefabDomValue &initialState, const PrefabDomValue &modifiedState) override
 Generates a patch using serialization system and places the result in generatedPatch.
 
bool GeneratePatchForLink (PrefabDom &generatedPatch, const PrefabDom &initialState, const PrefabDom &modifiedState, LinkId linkId) override
 Generates a patch to be associated with a link with the given LinkId and places the result in generatedPatch.
 
bool PatchEntityInTemplate (PrefabDom &providedPatch, AZ::EntityId entityId) override
 Updates the affected template for a given entityId using the providedPatch.
 
AZStd::string GenerateEntityAliasPath (AZ::EntityId entityId) override
 
AZ::Dom::Path GenerateEntityPathFromFocusedPrefab (AZ::EntityId entityId) override
 
void PrependEntityAliasPathToPatchPaths (PrefabDom &patches, AZ::EntityId entityId, const AZStd::string &pathPrefix="") override
 
void PrependPathToPatchPaths (PrefabDom &patches, const AZStd::string &pathToPrepend) override
 
InstanceOptionalReference GetTopMostInstanceInHierarchy (AZ::EntityId entityId) override
 
bool PatchTemplate (PrefabDomValue &providedPatch, TemplateId templateId, InstanceOptionalConstReference instanceToExclude=AZStd::nullopt) override
 
void ApplyPatchesToInstance (const AZ::EntityId &entityId, PrefabDom &patches, const Instance &instanceToAddPatches) override
 

Member Function Documentation

◆ ApplyPatchesToInstance()

void AzToolsFramework::Prefab::InstanceToTemplatePropagator::ApplyPatchesToInstance ( const AZ::EntityId &  entityId,
PrefabDom &  patches,
const Instance instanceToAddPatches 
)
overridevirtual

◆ GenerateEntityAliasPath()

AZStd::string AzToolsFramework::Prefab::InstanceToTemplatePropagator::GenerateEntityAliasPath ( AZ::EntityId  entityId)
overridevirtual

Generates a string matching the path to the entity alias corresponding to the entity id.

Parameters
entityIdThe entity id to use for generating alias path
Returns
The string matching the path to the entity alias

Implements AzToolsFramework::Prefab::InstanceToTemplateInterface.

◆ GenerateEntityDomBySerializing()

bool AzToolsFramework::Prefab::InstanceToTemplatePropagator::GenerateEntityDomBySerializing ( PrefabDom &  entityDom,
const AZ::Entity &  entity 
)
overridevirtual

Generates an entity DOM for the entity in its current state by serializing the entity object.

Parameters
[out]entityDomThe output entity DOM that will be modified.
entityThe given entity object.
Returns
True if the entity DOM is generated successfully and false otherwise.

Implements AzToolsFramework::Prefab::InstanceToTemplateInterface.

◆ GenerateEntityPathFromFocusedPrefab()

AZ::Dom::Path AzToolsFramework::Prefab::InstanceToTemplatePropagator::GenerateEntityPathFromFocusedPrefab ( AZ::EntityId  entityId)
overridevirtual

Generates a path to the entity matching the id from the focused prefab.

Parameters
entityIdThe entity id to fetch the path for.
Returns
The path to the entity with the given id.

Implements AzToolsFramework::Prefab::InstanceToTemplateInterface.

◆ GenerateInstanceDomBySerializing()

bool AzToolsFramework::Prefab::InstanceToTemplatePropagator::GenerateInstanceDomBySerializing ( PrefabDom &  instanceDom,
const Instance instance 
)
overridevirtual

Generates an instance DOM for the instance in its current state by serializing the instance object.

Parameters
[out]instanceDomThe output instance DOM that will be modified.
instanceThe given instance object.
Returns
True if the instance DOM is generated successfully and false otherwise.

Implements AzToolsFramework::Prefab::InstanceToTemplateInterface.

◆ GeneratePatch()

bool AzToolsFramework::Prefab::InstanceToTemplatePropagator::GeneratePatch ( PrefabDom &  generatedPatch,
const PrefabDomValue &  initialState,
const PrefabDomValue &  modifiedState 
)
overridevirtual

Generates a patch using serialization system and places the result in generatedPatch.

Implements AzToolsFramework::Prefab::InstanceToTemplateInterface.

◆ GeneratePatchForLink()

bool AzToolsFramework::Prefab::InstanceToTemplatePropagator::GeneratePatchForLink ( PrefabDom &  generatedPatch,
const PrefabDom &  initialState,
const PrefabDom &  modifiedState,
LinkId  linkId 
)
overridevirtual

Generates a patch to be associated with a link with the given LinkId and places the result in generatedPatch.

Implements AzToolsFramework::Prefab::InstanceToTemplateInterface.

◆ GetTopMostInstanceInHierarchy()

InstanceOptionalReference AzToolsFramework::Prefab::InstanceToTemplatePropagator::GetTopMostInstanceInHierarchy ( AZ::EntityId  entityId)
overridevirtual

◆ PatchEntityInTemplate()

bool AzToolsFramework::Prefab::InstanceToTemplatePropagator::PatchEntityInTemplate ( PrefabDom &  providedPatch,
AZ::EntityId  entityId 
)
overridevirtual

Updates the affected template for a given entityId using the providedPatch.

Implements AzToolsFramework::Prefab::InstanceToTemplateInterface.

◆ PatchTemplate()

bool AzToolsFramework::Prefab::InstanceToTemplatePropagator::PatchTemplate ( PrefabDomValue &  providedPatch,
TemplateId  templateId,
InstanceOptionalConstReference  instanceToExclude = AZStd::nullopt 
)
overridevirtual

Updates the template links (updating instances) for the given template and triggers propagation on its instances.

Parameters
providedPatchThe patch to apply to the template.
templateIdThe id of the template to update.
instanceToExcludeAn optional reference to an instance of the template being updated that should not be refreshes as part of propagation. Defaults to nullopt, which means that all instances will be refreshed.
Returns
True if the template was patched correctly, false if the operation failed.

Implements AzToolsFramework::Prefab::InstanceToTemplateInterface.

◆ PrependEntityAliasPathToPatchPaths()

void AzToolsFramework::Prefab::InstanceToTemplatePropagator::PrependEntityAliasPathToPatchPaths ( PrefabDom &  patches,
AZ::EntityId  entityId,
const AZStd::string &  pathPrefix = "" 
)
overridevirtual

Prepends an entity alias path to paths in the provided patch array.

Parameters
patchesThe patches that contains paths to prepend the given path to.
entityIdThe entity id to use for generating entity alias path.
pathPrefixThe prefix that will be added in front of the generated entity alias path from entity id.

Implements AzToolsFramework::Prefab::InstanceToTemplateInterface.

◆ PrependPathToPatchPaths()

void AzToolsFramework::Prefab::InstanceToTemplatePropagator::PrependPathToPatchPaths ( PrefabDom &  patches,
const AZStd::string &  pathToPrepend 
)
overridevirtual

Prepends a path to the paths in the provided patch array.

Parameters
patchesThe patches that contains paths to prepend the given path to.
pathToPrependThe given path to prepend.

Implements AzToolsFramework::Prefab::InstanceToTemplateInterface.


The documentation for this class was generated from the following file: