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

Inherits AZ::EBusTraits.

Public Member Functions

virtual AzFramework::SliceInstantiationTicket InstantiateEditorSlice (const AZ::Data::Asset< AZ::Data::AssetData > &sliceAsset, const AZ::Transform &worldTransform)=0
 
virtual AZ::SliceComponent::SliceInstanceAddress CloneEditorSliceInstance (AZ::SliceComponent::SliceInstanceAddress sourceInstance, AZ::SliceComponent::EntityIdToEntityIdMap &sourceToCloneEntityIdMap)=0
 
virtual AZ::SliceComponent::SliceInstanceAddress CloneSubSliceInstance (const AZ::SliceComponent::SliceInstanceAddress &sourceSliceInstanceAddress, const AZStd::vector< AZ::SliceComponent::SliceInstanceAddress > &sourceSubSliceInstanceAncestry, const AZ::SliceComponent::SliceInstanceAddress &sourceSubSliceInstanceAddress, AZ::SliceComponent::EntityIdToEntityIdMap *out_sourceToCloneEntityIdMap)=0
 
virtual AZ::SliceComponent::SliceInstanceAddress PromoteEditorEntitiesIntoSlice (const AZ::Data::Asset< AZ::SliceAsset > &sliceAsset, const AZ::SliceComponent::EntityIdToEntityIdMap &liveToAssetMap)=0
 
virtual void DetachSliceEntities (const EntityIdList &entities)=0
 
virtual void DetachSliceInstances (const AZ::SliceComponent::SliceInstanceAddressSet &instances)=0
 
virtual void DetachSubsliceInstances (const AZ::SliceComponent::SliceInstanceEntityIdRemapList &subsliceRootList)=0
 
virtual void RestoreSliceEntity (AZ::Entity *entity, const AZ::SliceComponent::EntityRestoreInfo &info, SliceEntityRestoreType restoreType)=0
 
virtual void ResetEntitiesToSliceDefaults (EntityIdList entities)=0
 Resets any slice data overrides for the specified entities.
 
virtual AZ::SliceComponent * GetEditorRootSlice ()=0
 Retrieves the root slice for the editor entity ownership service.
 

Static Public Attributes

static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single
 

Member Function Documentation

◆ CloneEditorSliceInstance()

virtual AZ::SliceComponent::SliceInstanceAddress AzToolsFramework::SliceEditorEntityOwnershipServiceRequests::CloneEditorSliceInstance ( AZ::SliceComponent::SliceInstanceAddress  sourceInstance,
AZ::SliceComponent::EntityIdToEntityIdMap &  sourceToCloneEntityIdMap 
)
pure virtual

Clones an existing slice instance in the editor context. New instance is immediately returned. This function doesn't automatically add the new slice instance to any entity context, callers are responsible for that.

Parameters
sourceInstanceThe source instance to be cloned
sourceToCloneEntityIdMapThe map between source entity ids and clone entity ids
Returns
The Address of new slice instance. A null address will be returned if the source instance address is invalid.

◆ CloneSubSliceInstance()

virtual AZ::SliceComponent::SliceInstanceAddress AzToolsFramework::SliceEditorEntityOwnershipServiceRequests::CloneSubSliceInstance ( const AZ::SliceComponent::SliceInstanceAddress &  sourceSliceInstanceAddress,
const AZStd::vector< AZ::SliceComponent::SliceInstanceAddress > &  sourceSubSliceInstanceAncestry,
const AZ::SliceComponent::SliceInstanceAddress &  sourceSubSliceInstanceAddress,
AZ::SliceComponent::EntityIdToEntityIdMap *  out_sourceToCloneEntityIdMap 
)
pure virtual

Clone an slice-instance that comes from a sub-slice, and add the clone to the root slice.

Parameters
sourceSliceInstanceAddressThe address of the slice instance that contains the sub-slice instance.
sourceSubSliceInstanceAncestryThe ancestry in order from sourceSubSlice to sourceSlice
sourceSubSliceInstanceAddressThe address of the sub-slice instance to be cloned.
out_sourceToCloneEntityIdMapIf valid address provided, the internal source to clone entity ID map will be returned
Returns
The Address of new slice instance. A null address will be returned if the source instance address is invalid.

◆ DetachSliceEntities()

virtual void AzToolsFramework::SliceEditorEntityOwnershipServiceRequests::DetachSliceEntities ( const EntityIdList &  entities)
pure virtual

Detaches entities from their current slice instance and adds them to root slice as loose entities.

Parameters
entitiesEntities to detach.

◆ DetachSliceInstances()

virtual void AzToolsFramework::SliceEditorEntityOwnershipServiceRequests::DetachSliceInstances ( const AZ::SliceComponent::SliceInstanceAddressSet &  instances)
pure virtual

Detaches all entities from input instances and adds them to the root slice as loose entities.

Parameters
instancesSliceInstances to detach

◆ DetachSubsliceInstances()

virtual void AzToolsFramework::SliceEditorEntityOwnershipServiceRequests::DetachSubsliceInstances ( const AZ::SliceComponent::SliceInstanceEntityIdRemapList &  subsliceRootList)
pure virtual

Detaches the supplied subslices from their owning slice instance.

Parameters
subsliceRootListMapping of subslice instance address to entityIdMapping

◆ PromoteEditorEntitiesIntoSlice()

virtual AZ::SliceComponent::SliceInstanceAddress AzToolsFramework::SliceEditorEntityOwnershipServiceRequests::PromoteEditorEntitiesIntoSlice ( const AZ::Data::Asset< AZ::SliceAsset > &  sliceAsset,
const AZ::SliceComponent::EntityIdToEntityIdMap &  liveToAssetMap 
)
pure virtual

Moves existing entities in the EditorEntityOwnershipService into a new SliceInstance based off of the provided SliceAsset.

Parameters
sliceAssetAsset of the slice that the entities will be promoted into.
liveToAssetMapA mapping of the EntityIDs found in the provided SliceAsset and existing "live" EntityIDs found in the EditorEntityOwnershipService.
Returns
Can return an empty invalid SliceInstanceAddress if an error occurs during the process.

◆ RestoreSliceEntity()

virtual void AzToolsFramework::SliceEditorEntityOwnershipServiceRequests::RestoreSliceEntity ( AZ::Entity *  entity,
const AZ::SliceComponent::EntityRestoreInfo &  info,
SliceEntityRestoreType  restoreType 
)
pure virtual

Restores an entity back to a slice instance for undo/redo only. A valid EntityRestoreInfo must be provided, and is only extracted directly via SliceReference::GetEntityRestoreInfo().

Parameters
entityThe entity to restore to the slice
infoThe EntityRestoreInfo reference to be used to restore the entity
restoreTypeThe SliceEntityRestoreType

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