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::InstanceToTemplateInterface Class Referenceabstract

Inherited by AzToolsFramework::Prefab::InstanceToTemplatePropagator [private].

Public Member Functions

 AZ_RTTI (InstanceToTemplateInterface, "{9EF54D0F-0951-40B6-91AB-2EB55A322692}")
 
virtual bool GenerateEntityDomBySerializing (PrefabDom &entityDom, const AZ::Entity &entity)=0
 
virtual bool GenerateInstanceDomBySerializing (PrefabDom &instanceDom, const Instance &instance)=0
 
virtual bool GeneratePatch (PrefabDom &generatedPatch, const PrefabDomValue &initialState, const PrefabDomValue &modifiedState)=0
 Generates a patch using serialization system and places the result in generatedPatch.
 
virtual bool GeneratePatchForLink (PrefabDom &generatedPatch, const PrefabDom &initialState, const PrefabDom &modifiedState, const LinkId linkId)=0
 Generates a patch to be associated with a link with the given LinkId and places the result in generatedPatch.
 
virtual bool PatchEntityInTemplate (PrefabDom &providedPatch, AZ::EntityId entityId)=0
 Updates the affected template for a given entityId using the providedPatch.
 
virtual AZStd::string GenerateEntityAliasPath (AZ::EntityId entityId)=0
 
virtual AZ::Dom::Path GenerateEntityPathFromFocusedPrefab (AZ::EntityId entityId)=0
 
virtual void PrependEntityAliasPathToPatchPaths (PrefabDom &patches, AZ::EntityId entityId, const AZStd::string &pathPrefix="")=0
 
virtual void PrependPathToPatchPaths (PrefabDom &patches, const AZStd::string &pathToPrepend)=0
 
virtual bool PatchTemplate (PrefabDomValue &providedPatch, TemplateId templateId, InstanceOptionalConstReference instanceToExclude=AZStd::nullopt)=0
 
virtual void ApplyPatchesToInstance (const AZ::EntityId &entityId, PrefabDom &patches, const Instance &instanceToAddPatches)=0
 
virtual InstanceOptionalReference GetTopMostInstanceInHierarchy (AZ::EntityId entityId)=0
 

Member Function Documentation

◆ GenerateEntityAliasPath()

virtual AZStd::string AzToolsFramework::Prefab::InstanceToTemplateInterface::GenerateEntityAliasPath ( AZ::EntityId  entityId)
pure virtual

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

Implemented in AzToolsFramework::Prefab::InstanceToTemplatePropagator.

◆ GenerateEntityDomBySerializing()

virtual bool AzToolsFramework::Prefab::InstanceToTemplateInterface::GenerateEntityDomBySerializing ( PrefabDom &  entityDom,
const AZ::Entity &  entity 
)
pure virtual

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.

Implemented in AzToolsFramework::Prefab::InstanceToTemplatePropagator.

◆ GenerateEntityPathFromFocusedPrefab()

virtual AZ::Dom::Path AzToolsFramework::Prefab::InstanceToTemplateInterface::GenerateEntityPathFromFocusedPrefab ( AZ::EntityId  entityId)
pure virtual

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.

Implemented in AzToolsFramework::Prefab::InstanceToTemplatePropagator.

◆ GenerateInstanceDomBySerializing()

virtual bool AzToolsFramework::Prefab::InstanceToTemplateInterface::GenerateInstanceDomBySerializing ( PrefabDom &  instanceDom,
const Instance instance 
)
pure virtual

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.

Implemented in AzToolsFramework::Prefab::InstanceToTemplatePropagator.

◆ GeneratePatch()

virtual bool AzToolsFramework::Prefab::InstanceToTemplateInterface::GeneratePatch ( PrefabDom &  generatedPatch,
const PrefabDomValue &  initialState,
const PrefabDomValue &  modifiedState 
)
pure virtual

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

Implemented in AzToolsFramework::Prefab::InstanceToTemplatePropagator.

◆ GeneratePatchForLink()

virtual bool AzToolsFramework::Prefab::InstanceToTemplateInterface::GeneratePatchForLink ( PrefabDom &  generatedPatch,
const PrefabDom &  initialState,
const PrefabDom &  modifiedState,
const LinkId  linkId 
)
pure virtual

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

Implemented in AzToolsFramework::Prefab::InstanceToTemplatePropagator.

◆ PatchEntityInTemplate()

virtual bool AzToolsFramework::Prefab::InstanceToTemplateInterface::PatchEntityInTemplate ( PrefabDom &  providedPatch,
AZ::EntityId  entityId 
)
pure virtual

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

Implemented in AzToolsFramework::Prefab::InstanceToTemplatePropagator.

◆ PatchTemplate()

virtual bool AzToolsFramework::Prefab::InstanceToTemplateInterface::PatchTemplate ( PrefabDomValue &  providedPatch,
TemplateId  templateId,
InstanceOptionalConstReference  instanceToExclude = AZStd::nullopt 
)
pure virtual

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.

Implemented in AzToolsFramework::Prefab::InstanceToTemplatePropagator.

◆ PrependEntityAliasPathToPatchPaths()

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

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.

Implemented in AzToolsFramework::Prefab::InstanceToTemplatePropagator.

◆ PrependPathToPatchPaths()

virtual void AzToolsFramework::Prefab::InstanceToTemplateInterface::PrependPathToPatchPaths ( PrefabDom &  patches,
const AZStd::string &  pathToPrepend 
)
pure virtual

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.

Implemented in AzToolsFramework::Prefab::InstanceToTemplatePropagator.


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