#include <PrefabPublicInterface.h>
Inherited by AzToolsFramework::Prefab::PrefabPublicHandler.
Public Member Functions | |
AZ_RTTI (PrefabPublicInterface, "{931AAE9D-C775-4818-9070-A2DA69489CBE}") | |
virtual CreatePrefabResult | CreatePrefabInDisk (const EntityIdList &entityIds, AZ::IO::PathView filePath)=0 |
virtual CreatePrefabResult | CreatePrefabAndSaveToDisk (const EntityIdList &entityIds, AZ::IO::PathView filePath)=0 |
virtual CreatePrefabResult | CreatePrefabInMemory (const EntityIdList &entityIds, AZ::IO::PathView filePath)=0 |
virtual InstantiatePrefabResult | InstantiatePrefab (AZStd::string_view filePath, AZ::EntityId parentId, const AZ::Transform &transform)=0 |
virtual InstantiatePrefabResult | InstantiatePrefab (AZStd::string_view filePath, AZ::EntityId parentId, const AZ::Vector3 &position)=0 |
virtual PrefabOperationResult | SavePrefab (AZ::IO::Path filePath)=0 |
virtual PrefabEntityResult | CreateEntity (AZ::EntityId parentId, const AZ::Vector3 &position)=0 |
virtual PrefabOperationResult | GenerateUndoNodesForEntityChangeAndUpdateCache (AZ::EntityId entityId, UndoSystem::URSequencePoint *parentUndoBatch)=0 |
virtual bool | IsOwnedByPrefabInstance (AZ::EntityId entityId) const =0 |
virtual bool | IsOwnedByProceduralPrefabInstance (AZ::EntityId entityId) const =0 |
virtual bool | IsInstanceContainerEntity (AZ::EntityId entityId) const =0 |
virtual bool | IsLevelInstanceContainerEntity (AZ::EntityId entityId) const =0 |
virtual bool | EntitiesBelongToSameInstance (const EntityIdList &entityIds) const =0 |
virtual AZ::EntityId | GetInstanceContainerEntityId (AZ::EntityId entityId) const =0 |
virtual AZ::EntityId | GetLevelInstanceContainerEntityId () const =0 |
virtual AZ::IO::Path | GetOwningInstancePrefabPath (AZ::EntityId entityId) const =0 |
virtual PrefabRequestResult | HasUnsavedChanges (AZ::IO::Path prefabFilePath) const =0 |
virtual PrefabOperationResult | DeleteEntitiesAndAllDescendantsInInstance (const EntityIdList &entityIds)=0 |
virtual DuplicatePrefabResult | DuplicateEntitiesInInstance (const EntityIdList &entityIds)=0 |
virtual PrefabOperationResult | DetachPrefab (const AZ::EntityId &containerEntityId)=0 |
virtual PrefabOperationResult | DetachPrefabAndRemoveContainerEntity (const AZ::EntityId &containerEntityId)=0 |
PrefabPublicInterface Interface to expose Prefab functionality directly to UI and Scripting. Functions will correctly call the Undo/Redo system under the hood.
|
pure virtual |
Creates a new entity under the entity with id 'parentId' and propagates a change to the template of the owning instance of parentId.
parentId | The id of the parent entity to parent the newly added entity under. |
position | The transform position of the entity being added. |
Implemented in AzToolsFramework::Prefab::PrefabPublicHandler.
|
pure virtual |
Create a prefab out of the entities provided, at the path provided, and save it in disk immediately. Automatically detects descendants of entities, and discerns between entities and child instances. Note: It calls CreatePrefabInMemory internally and then saves the new template in disk.
entityIds | The entities that should form the new prefab (along with their descendants). |
filePath | The absolute path for the new prefab file. |
Implemented in AzToolsFramework::Prefab::PrefabPublicHandler.
|
pure virtual |
O3DE_DEPRECATION_NOTICE(GHI-12956) This function is marked for deprecation. Please use CreatePrefabAndSaveToDisk instead.
Implemented in AzToolsFramework::Prefab::PrefabPublicHandler.
|
pure virtual |
Create a prefab out of the entities provided, at the path provided, and keep it in memory. Automatically detects descendants of entities, and discerns between entities and child instances. Note: The newly created prefab template cannot be undo/redo. Undo will not remove the templace in system.
entityIds | The entities that should form the new prefab (along with their descendants). |
filePath | The absolute path for the new prefab file. |
Implemented in AzToolsFramework::Prefab::PrefabPublicHandler.
|
pure virtual |
Deletes all entities and their descendants from the owning instance. Bails if the entities don't all belong to the same instance.
entities | The entities to delete. Their descendants will be discovered by this function. |
Implemented in AzToolsFramework::Prefab::PrefabPublicHandler.
|
pure virtual |
If the entity id is a container entity id, detaches the prefab instance corresponding to it. This includes converting the container entity into a regular entity and putting it under the parent prefab, removing the link between this instance and the parent, removing links between this instance and its nested instances, and adding entities directly owned by this instance under the parent instance. Bails if the entity is not a container entity or belongs to the level prefab instance. Note that this function retains the container entities, unlike the below function DetachPrefabAndRemoveContainerEntity.
containerEntityId | The container entity id of the instance to detach. |
Implemented in AzToolsFramework::Prefab::PrefabPublicHandler.
|
pure virtual |
Does the same thing as DetachPrefab, but also removes the container entity representing the prefab instance. This re-parents anything that used to be a child of the container entity to the container entity's parent. This operation is essentially the reverse of what happens when you create a prefab (which creates a new container entity and re-parents the entities under it. Note that the previous API only had "DetachPrefab", which kept the container entities, and by way of introducing as little risk a possible in an API change, the old function retains its original behavior and name.
Implemented in AzToolsFramework::Prefab::PrefabPublicHandler.
|
pure virtual |
Duplicates all entities in the owning instance. Bails if the entities don't all belong to the same instance.
entities | The entities to duplicate. |
Implemented in AzToolsFramework::Prefab::PrefabPublicHandler.
|
pure virtual |
Detects if a list of entities are under the same instance. The instance of a container entity is special cased to be the parent instance of its instance.
entityIds | The list of entities to query. |
Implemented in AzToolsFramework::Prefab::PrefabPublicHandler.
|
pure virtual |
Store the changes between the current entity state and its last cached state into undo/redo commands. These changes are stored as patches to the owning prefab instance template, as appropriate. The function also triggers the redo() of the nodes it creates, triggering propagation on the next tick.
entityId | The entity to patch. |
parentUndoBatch | The undo batch the undo nodes should be parented to. |
Implemented in AzToolsFramework::Prefab::PrefabPublicHandler.
|
pure virtual |
Gets the entity id for the instance container of the owning instance.
entityId | The id of the entity to query. |
Implemented in AzToolsFramework::Prefab::PrefabPublicHandler.
|
pure virtual |
Gets the entity id for the instance container of the level instance.
Implemented in AzToolsFramework::Prefab::PrefabPublicHandler.
|
pure virtual |
Get the file path to the prefab file for the prefab instance owning the entity provided.
entityId | The id for the entity being queried. |
Implemented in AzToolsFramework::Prefab::PrefabPublicHandler.
|
pure virtual |
Gets whether the prefab has unsaved changes.
filePath | The path to the prefab to query. |
Implemented in AzToolsFramework::Prefab::PrefabPublicHandler.
|
pure virtual |
Instantiate a prefab from a prefab file.
filePath | The path to the prefab file to instantiate. |
parentId | The entity id the prefab should be a child of in the transform hierarchy. |
transform | The transform in world space the prefab should be instantiated in. |
Implemented in AzToolsFramework::Prefab::PrefabPublicHandler.
|
pure virtual |
Instantiate a prefab from a prefab file.
filePath | The path to the prefab file to instantiate. |
parentId | The entity id the prefab should be a child of in the transform hierarchy. |
position | The position in world space the prefab should be instantiated in. |
Implemented in AzToolsFramework::Prefab::PrefabPublicHandler.
|
pure virtual |
Detects if an entity is the container entity for its owning prefab instance.
entityId | The entity to query. |
Implemented in AzToolsFramework::Prefab::PrefabPublicHandler.
|
pure virtual |
Detects if an entity is the container entity for the level prefab instance.
entityId | The entity to query. |
Implemented in AzToolsFramework::Prefab::PrefabPublicHandler.
|
pure virtual |
Detects if an entity is owned by a prefab.
entityId | The entity to query. |
Implemented in AzToolsFramework::Prefab::PrefabPublicHandler.
|
pure virtual |
Detects if an entity is owned by a procedural prefab.
entityId | The entity to query. |
Implemented in AzToolsFramework::Prefab::PrefabPublicHandler.
|
pure virtual |
Saves changes to prefab to disk.
filePath | The path to the prefab to save. |
Implemented in AzToolsFramework::Prefab::PrefabPublicHandler.