Merge pull request #3272 from aws-lumberyard-dev/PIX

Profiler spring cleaning
This commit is contained in:
Jeremy Ong
2021-08-19 08:48:23 -06:00
committed by GitHub
319 changed files with 1550 additions and 3404 deletions
@@ -95,7 +95,7 @@ namespace AzToolsFramework
template<typename IdContainerType>
void DeleteEntities(const IdContainerType& entityIds)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (entityIds.empty())
{
@@ -141,7 +141,7 @@ namespace AzToolsFramework
}
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "Internal::DeleteEntities:UndoCaptureAndPurgeEntities");
AZ_PROFILE_SCOPE(AzToolsFramework, "Internal::DeleteEntities:UndoCaptureAndPurgeEntities");
for (const auto& entityId : entityIds)
{
AZ::Entity* entity = NULL;
@@ -160,7 +160,7 @@ namespace AzToolsFramework
selCommand->SetParent(currentUndoBatch);
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "Internal::DeleteEntities:RunRedo");
AZ_PROFILE_SCOPE(AzToolsFramework, "Internal::DeleteEntities:RunRedo");
selCommand->RunRedo();
}
}
@@ -458,7 +458,7 @@ namespace AzToolsFramework
bool ToolsApplication::RemoveEntity(AZ::Entity* entity)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
auto undoCacheInterface = AZ::Interface<UndoSystem::UndoCacheInterface>::Get();
if (undoCacheInterface)
@@ -472,7 +472,7 @@ namespace AzToolsFramework
EBUS_EVENT(ToolsApplicationEvents::Bus, EntityDeregistered, entity->GetId());
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "ToolsApplication::RemoveEntity:CallApplicationRemoveEntity");
AZ_PROFILE_SCOPE(AzToolsFramework, "ToolsApplication::RemoveEntity:CallApplicationRemoveEntity");
if (AzFramework::Application::RemoveEntity(entity))
{
return true;
@@ -545,7 +545,7 @@ namespace AzToolsFramework
void ToolsApplication::MarkEntitySelected(AZ::EntityId entityId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ_Assert(entityId.IsValid(), "Invalid entity Id being marked as selected.");
EntityIdList::iterator foundIter = AZStd::find(m_selectedEntities.begin(), m_selectedEntities.end(), entityId);
@@ -563,7 +563,7 @@ namespace AzToolsFramework
void ToolsApplication::MarkEntitiesSelected(const EntityIdList& entitiesToSelect)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
EntityIdList entitiesSelected;
entitiesSelected.reserve(entitiesToSelect.size());
@@ -587,11 +587,11 @@ namespace AzToolsFramework
void ToolsApplication::MarkEntityDeselected(AZ::EntityId entityId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
auto foundIter = AZStd::find(m_selectedEntities.begin(), m_selectedEntities.end(), entityId);
if (foundIter != m_selectedEntities.end())
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "ToolsApplication::MarkEntityDeselected:Deselect");
AZ_PROFILE_SCOPE(AzToolsFramework, "ToolsApplication::MarkEntityDeselected:Deselect");
ToolsApplicationEvents::Bus::Broadcast(&ToolsApplicationEvents::BeforeEntitySelectionChanged);
m_selectedEntities.erase(foundIter);
@@ -603,7 +603,7 @@ namespace AzToolsFramework
void ToolsApplication::MarkEntitiesDeselected(const EntityIdList& entitiesToDeselect)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
ToolsApplicationEvents::Bus::Broadcast(&ToolsApplicationEvents::BeforeEntitySelectionChanged);
@@ -633,14 +633,14 @@ namespace AzToolsFramework
void ToolsApplication::SetEntityHighlighted(AZ::EntityId entityId, bool highlighted)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
auto foundIter = AZStd::find(m_highlightedEntities.begin(), m_highlightedEntities.end(), entityId);
if (foundIter != m_highlightedEntities.end())
{
if (!highlighted)
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "ToolsApplication::SetEntityHighlighted:RemoveHighlight");
AZ_PROFILE_SCOPE(AzToolsFramework, "ToolsApplication::SetEntityHighlighted:RemoveHighlight");
ToolsApplicationEvents::Bus::Broadcast(&ToolsApplicationEvents::BeforeEntityHighlightingChanged);
m_highlightedEntities.erase(foundIter);
ToolsApplicationEvents::Bus::Broadcast(&ToolsApplicationEvents::AfterEntityHighlightingChanged);
@@ -648,7 +648,7 @@ namespace AzToolsFramework
}
else if (highlighted)
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "ToolsApplication::SetEntityHighlighted:AddHighlight");
AZ_PROFILE_SCOPE(AzToolsFramework, "ToolsApplication::SetEntityHighlighted:AddHighlight");
ToolsApplicationEvents::Bus::Broadcast(&ToolsApplicationEvents::BeforeEntityHighlightingChanged);
m_highlightedEntities.push_back(entityId);
ToolsApplicationEvents::Bus::Broadcast(&ToolsApplicationEvents::AfterEntityHighlightingChanged);
@@ -657,7 +657,7 @@ namespace AzToolsFramework
void ToolsApplication::SetSelectedEntities(const EntityIdList& selectedEntities)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// We're setting the selection set as a batch from an external caller.
// * Filter out any unselectable entities
@@ -1535,7 +1535,7 @@ namespace AzToolsFramework
void ToolsApplication::CreateUndosForDirtyEntities()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ_Assert(!m_isDuringUndoRedo, "Cannot add dirty entities during undo/redo.");
if (m_dirtyEntities.empty())
@@ -54,7 +54,7 @@ namespace AzToolsFramework
void EntityStateCommand::Capture(AZ::Entity* pSourceEntity, bool captureUndo)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
m_entityID = pSourceEntity->GetId();
EBUS_EVENT_ID_RESULT(m_entityContextId, m_entityID, AzFramework::EntityIdContextQueryBus, GetOwningContextId);
@@ -114,7 +114,7 @@ namespace AzToolsFramework
void EntityStateCommand::RestoreEntity(const AZ::u8* buffer, AZStd::size_t bufferSizeBytes, const AZ::SliceComponent::EntityRestoreInfo& sliceRestoreInfo) const
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ_Assert(buffer, "No data to undo!");
AZ_Assert(bufferSizeBytes, "Undo data is empty.");
@@ -259,7 +259,7 @@ namespace AzToolsFramework
void EntityDeleteCommand::Redo()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
EBUS_EVENT(AZ::ComponentApplicationBus, DeleteEntity, m_entityID);
PreemptiveUndoCache::Get()->PurgeCache(m_entityID);
}
@@ -277,7 +277,7 @@ namespace AzToolsFramework
void EntityCreateCommand::Undo()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
EBUS_EVENT(AZ::ComponentApplicationBus, DeleteEntity, m_entityID);
PreemptiveUndoCache::Get()->PurgeCache(m_entityID);
}
@@ -86,7 +86,7 @@ namespace AzToolsFramework
void PreemptiveUndoCache::UpdateCache(const AZ::EntityId& entityId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// capture it
@@ -312,7 +312,7 @@ namespace AzToolsFramework
EntityList& resultEntities,
EntityIdToEntityIdMap& sourceToCloneEntityIdMap)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
resultEntities.clear();
@@ -365,7 +365,7 @@ namespace AzToolsFramework
const EntityList& entitiesInLayers,
AZ::SliceComponent::SliceReferenceToInstancePtrs& instancesInLayers)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (m_isLegacySliceService)
{
@@ -390,7 +390,7 @@ namespace AzToolsFramework
//=========================================================================
bool EditorEntityContextComponent::SaveToStreamForGame(AZ::IO::GenericStream& stream, AZ::DataStream::StreamType streamType)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (m_isLegacySliceService)
{
SliceEditorEntityOwnershipService* editorEntityOwnershipService =
@@ -409,7 +409,7 @@ namespace AzToolsFramework
//=========================================================================
bool EditorEntityContextComponent::LoadFromStream(AZ::IO::GenericStream& stream)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ_Assert(stream.IsOpen(), "Invalid source stream.");
AZ_Assert(m_entityOwnershipService->IsInitialized(), "The context has not been initialized.");
@@ -427,7 +427,7 @@ namespace AzToolsFramework
bool EditorEntityContextComponent::LoadFromStreamWithLayers(AZ::IO::GenericStream& stream, QString levelPakFile)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ_Assert(stream.IsOpen(), "Invalid source stream.");
AZ_Assert(m_entityOwnershipService->IsInitialized(), "The context has not been initialized.");
@@ -477,7 +477,7 @@ namespace AzToolsFramework
//=========================================================================
void EditorEntityContextComponent::StartPlayInEditor()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
EditorEntityContextNotificationBus::Broadcast(&EditorEntityContextNotification::OnStartPlayInEditorBegin);
@@ -513,7 +513,7 @@ namespace AzToolsFramework
//=========================================================================
void EditorEntityContextComponent::StopPlayInEditor()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
m_isRunningGame = false;
@@ -696,13 +696,13 @@ namespace AzToolsFramework
//=========================================================================
void EditorEntityContextComponent::SetupEditorEntities(const EntityList& entities)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ::Data::AssetManager::Instance().SuspendAssetRelease();
// All editor entities are automatically activated.
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EditorEntityContextComponent::SetupEditorEntities:ScrubEntities");
AZ_PROFILE_SCOPE(AzToolsFramework, "EditorEntityContextComponent::SetupEditorEntities:ScrubEntities");
// Scrub entities before initialization.
// Anything could go wrong with entities loaded from disk.
@@ -712,7 +712,7 @@ namespace AzToolsFramework
}
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EditorEntityContextComponent::SetupEditorEntities:InitEntities");
AZ_PROFILE_SCOPE(AzToolsFramework, "EditorEntityContextComponent::SetupEditorEntities:InitEntities");
for (AZ::Entity* entity : entities)
{
if (entity->GetState() == AZ::Entity::State::Constructed)
@@ -723,7 +723,7 @@ namespace AzToolsFramework
}
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EditorEntityContextComponent::SetupEditorEntities:CreateEditorRepresentations");
AZ_PROFILE_SCOPE(AzToolsFramework, "EditorEntityContextComponent::SetupEditorEntities:CreateEditorRepresentations");
for (AZ::Entity* entity : entities)
{
EditorRequests::Bus::Broadcast(&EditorRequests::CreateEditorRepresentation, entity);
@@ -731,7 +731,7 @@ namespace AzToolsFramework
}
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EditorEntityContextComponent::SetupEditorEntities:ActivateEntities");
AZ_PROFILE_SCOPE(AzToolsFramework, "EditorEntityContextComponent::SetupEditorEntities:ActivateEntities");
for (AZ::Entity* entity : entities)
{
if (entity->GetState() == AZ::Entity::State::Init)
@@ -323,7 +323,7 @@ namespace AzToolsFramework
void AddEntityIdToSortInfo(const AZ::EntityId parentId, const AZ::EntityId childId, bool forceAddToBack)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ::EntityId sortEntityId = GetEntityIdForSortInfo(parentId);
bool success = false;
@@ -336,7 +336,7 @@ namespace AzToolsFramework
void AddEntityIdToSortInfo(const AZ::EntityId parentId, const AZ::EntityId childId, const AZ::EntityId beforeEntity)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ::EntityId sortEntityId = GetEntityIdForSortInfo(parentId);
bool success = false;
@@ -349,7 +349,7 @@ namespace AzToolsFramework
bool RecoverEntitySortInfo(const AZ::EntityId parentId, const AZ::EntityId childId, AZ::u64 sortIndex)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
EntityOrderArray entityOrderArray;
EditorEntitySortRequestBus::EventResult(entityOrderArray, GetEntityIdForSortInfo(parentId), &EditorEntitySortRequestBus::Events::GetChildEntityOrderArray);
@@ -372,7 +372,7 @@ namespace AzToolsFramework
void RemoveEntityIdFromSortInfo(const AZ::EntityId parentId, const AZ::EntityId childId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ::EntityId sortEntityId = GetEntityIdForSortInfo(parentId);
bool success = false;
@@ -385,7 +385,7 @@ namespace AzToolsFramework
bool SetEntityChildOrder(const AZ::EntityId parentId, const EntityIdList& children)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
auto sortEntityId = GetEntityIdForSortInfo(parentId);
bool success = false;
@@ -399,7 +399,7 @@ namespace AzToolsFramework
EntityIdList GetEntityChildOrder(const AZ::EntityId parentId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
EntityIdList children;
EditorEntityInfoRequestBus::EventResult(children, parentId, &EditorEntityInfoRequestBus::Events::GetChildren);
@@ -441,7 +441,7 @@ namespace AzToolsFramework
//sort vector of entities by how they're arranged
void SortEntitiesByLocationInHierarchy(EntityIdList& entityIds)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
//cache locations for faster sort
AZStd::unordered_map<AZ::EntityId, AZStd::list<AZ::u64>> locations;
for (auto entityId : entityIds)
@@ -575,7 +575,7 @@ namespace AzToolsFramework
bool IsSelected(const AZ::EntityId entityId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
bool selected = false;
EditorEntityInfoRequestBus::EventResult(
@@ -585,7 +585,7 @@ namespace AzToolsFramework
bool IsSelectableInViewport(const AZ::EntityId entityId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
bool visible = false;
EditorEntityInfoRequestBus::EventResult(
@@ -602,7 +602,7 @@ namespace AzToolsFramework
const AZ::EntityId entityId, const bool locked,
const AZ::EntityId toggledEntityId, const bool toggledEntityWasLayer)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (!entityId.IsValid())
{
@@ -661,7 +661,7 @@ namespace AzToolsFramework
// note: must be called on layer entity
static void UnlockLayer(const AZ::EntityId entityId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
EditorLockComponentRequestBus::Event(
entityId, &EditorLockComponentRequestBus::Events::SetLocked, false);
@@ -698,7 +698,7 @@ namespace AzToolsFramework
void SetEntityLockState(const AZ::EntityId entityId, const bool locked)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// when an entity is unlocked, if it was in a locked layer(s), unlock those layers
if (!locked)
@@ -736,7 +736,7 @@ namespace AzToolsFramework
void ToggleEntityLockState(const AZ::EntityId entityId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (entityId.IsValid())
{
@@ -772,7 +772,7 @@ namespace AzToolsFramework
static void SetEntityVisibilityInternal(const AZ::EntityId entityId, const bool visibility)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
bool layerEntity = false;
Layers::EditorLayerComponentRequestBus::EventResult(
@@ -795,7 +795,7 @@ namespace AzToolsFramework
// note: must be called on layer entity
static void ShowLayer(const AZ::EntityId entityId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
SetEntityVisibilityInternal(entityId, true);
@@ -830,7 +830,7 @@ namespace AzToolsFramework
const AZ::EntityId entityId, const bool visible,
const AZ::EntityId toggledEntityId, const bool toggledEntityWasLayer)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (!entityId.IsValid())
{
@@ -879,7 +879,7 @@ namespace AzToolsFramework
void SetEntityVisibility(const AZ::EntityId entityId, const bool visible)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// when an entity is set to visible, if it was in an invisible layer(s), make that layer visible
if (visible)
@@ -917,7 +917,7 @@ namespace AzToolsFramework
void ToggleEntityVisibility(const AZ::EntityId entityId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (entityId.IsValid())
{
@@ -969,7 +969,7 @@ namespace AzToolsFramework
bool IsEntitySetToBeVisible(const AZ::EntityId entityId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// Visibility state is tracked in 5 places, see OutlinerListModel::dataForLock for info on 3 of these ways.
// Visibility's fourth state over lock is the EditorVisibilityRequestBus has two sets of
@@ -1007,7 +1007,7 @@ namespace AzToolsFramework
AZ::Vector3 GetWorldTranslation(const AZ::EntityId entityId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ::Vector3 worldTranslation = AZ::Vector3::CreateZero();
AZ::TransformBus::EventResult(
@@ -1018,7 +1018,7 @@ namespace AzToolsFramework
AZ::Vector3 GetLocalTranslation(const AZ::EntityId entityId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ::Vector3 localTranslation = AZ::Vector3::CreateZero();
AZ::TransformBus::EventResult(
@@ -38,7 +38,7 @@ namespace
bool HasDifferences(T* sourceElem, T* compareElem, bool isRoot,
AZ::SerializeContext* serializeContext)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (!sourceElem || !compareElem)
{
@@ -146,7 +146,7 @@ namespace AzToolsFramework
void EditorEntityModel::Reset()
{
m_preparingForContextReset = false;
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
//disconnect all entity ids
EditorEntitySortNotificationBus::MultiHandler::BusDisconnect();
@@ -209,7 +209,7 @@ namespace AzToolsFramework
sortedEntitiesToAdd.reserve(unsortedEntitiesToAdd.size());
{ // Sort pending entities
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EditorEntityModel::AddEntityBatch:Sort");
AZ_PROFILE_SCOPE(AzToolsFramework, "EditorEntityModel::AddEntityBatch:Sort");
// Gather basic sorting data for each pending entity and
// create map from parent ID to child entries.
@@ -307,7 +307,7 @@ namespace AzToolsFramework
}
{ // Add sorted entities
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EditorEntityModel::AddEntityBatch:Add");
AZ_PROFILE_SCOPE(AzToolsFramework, "EditorEntityModel::AddEntityBatch:Add");
for (AZ::EntityId entityId : sortedEntitiesToAdd)
{
AddEntity(entityId);
@@ -325,7 +325,7 @@ namespace AzToolsFramework
void EditorEntityModel::AddEntity(AZ::EntityId entityId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
auto& entityInfo = GetInfo(entityId);
//initialize and connect this entry to the entity id
@@ -374,7 +374,7 @@ namespace AzToolsFramework
// Skip doing slow, unecessary work for this bulk operations.
return;
}
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
auto& entityInfo = GetInfo(entityId);
if (!entityInfo.IsConnected())
{
@@ -404,7 +404,7 @@ namespace AzToolsFramework
void EditorEntityModel::AddChildToParent(AZ::EntityId parentId, AZ::EntityId childId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ_Assert(childId != parentId, "AddChildToParent called with same child and parent");
if (childId == parentId || !childId.IsValid())
{
@@ -479,7 +479,7 @@ namespace AzToolsFramework
void EditorEntityModel::RemoveChildFromParent(AZ::EntityId parentId, AZ::EntityId childId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ_Assert(childId != parentId, "RemoveChildFromparent called with same child and parent");
AZ_Assert(childId.IsValid(), "RemoveChildFromparent called with an invalid child entity id");
if (childId == parentId || !childId.IsValid())
@@ -544,7 +544,7 @@ namespace AzToolsFramework
void EditorEntityModel::ReparentChild(AZ::EntityId entityId, AZ::EntityId newParentId, AZ::EntityId oldParentId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ_Assert(oldParentId != entityId, "ReparentChild gave us an oldParentId that is the same as the entityId. An entity cannot be a parent of itself, ignoring old parent");
AZ_Assert(newParentId != entityId, "ReparentChild gave us an newParentId that is the same as the entityId. An entity cannot be a parent of itself, ignoring old parent");
if (oldParentId != entityId && newParentId != entityId)
@@ -573,7 +573,7 @@ namespace AzToolsFramework
void EditorEntityModel::EntityRegistered(AZ::EntityId entityId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
//when an editor entity is created and registered, add it to a pending list.
//once all entities in the pending list are activated, add them to model.
bool isEditorEntity = false;
@@ -591,7 +591,7 @@ namespace AzToolsFramework
void EditorEntityModel::EntityDeregistered(AZ::EntityId entityId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
//when an editor entity is de-registered, stop tracking it
if (m_entityInfoTable.find(entityId) != m_entityInfoTable.end())
{
@@ -628,7 +628,7 @@ namespace AzToolsFramework
void EditorEntityModel::EntityParentChanged(AZ::EntityId entityId, AZ::EntityId newParentId, AZ::EntityId oldParentId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (GetInfo(entityId).IsConnected())
{
ReparentChild(entityId, newParentId, oldParentId);
@@ -647,7 +647,7 @@ namespace AzToolsFramework
void EditorEntityModel::ChildEntityOrderArrayUpdated()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
//when notified that a parent has reordered its children, they must be updated
if (m_enableChildReorderHandler)
{
@@ -671,14 +671,14 @@ namespace AzToolsFramework
void EditorEntityModel::OnEditorEntitiesPromotedToSlicedEntities(const AzToolsFramework::EntityIdList& promotedEntities)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
OnEditorEntitiesSliceOwnershipChanged(promotedEntities);
}
void EditorEntityModel::OnEditorEntitiesSliceOwnershipChanged(const AzToolsFramework::EntityIdList& entityIdList)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// Need to update slice info from top of hierarchy down
// as parent entity slice status will be querried and needs to be correct
@@ -712,7 +712,7 @@ namespace AzToolsFramework
void EditorEntityModel::OnEntityStreamLoadSuccess()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
//block internal reorder event handling to avoid recursion since we're manually updating everything
m_enableChildReorderHandler = false;
@@ -722,7 +722,7 @@ namespace AzToolsFramework
//refresh all order info while blocking related events (keeps UI observers from updating until refresh is complete)
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EditorEntityModel::OnEntityStreamLoadSuccess:UpdateChildOrderInfo");
AZ_PROFILE_SCOPE(AzToolsFramework, "EditorEntityModel::OnEntityStreamLoadSuccess:UpdateChildOrderInfo");
for (auto& entityInfoPair : m_entityInfoTable)
{
if (entityInfoPair.second.IsConnected())
@@ -733,7 +733,7 @@ namespace AzToolsFramework
}
}
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EditorEntityModel::OnEntityStreamLoadSuccess:UpdateOrderInfo");
AZ_PROFILE_SCOPE(AzToolsFramework, "EditorEntityModel::OnEntityStreamLoadSuccess:UpdateOrderInfo");
for (auto& entityInfoPair : m_entityInfoTable)
{
if (entityInfoPair.second.IsConnected())
@@ -778,7 +778,7 @@ namespace AzToolsFramework
void EditorEntityModel::OnEntityTransformChanged(const AzToolsFramework::EntityIdList& entityIds)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
for (const AZ::EntityId& entityId : entityIds)
{
@@ -846,7 +846,7 @@ namespace AzToolsFramework
void EditorEntityModel::UpdateSliceInfoHierarchy(AZ::EntityId entityId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
auto& entityInfo = GetInfo(entityId);
entityInfo.UpdateOrderInfo(false);
entityInfo.UpdateSliceInfo();
@@ -896,7 +896,7 @@ namespace AzToolsFramework
void EditorEntityModel::EditorEntityModelEntry::Connect()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
Disconnect();
EntityInfoRequestConnect();
@@ -946,7 +946,7 @@ namespace AzToolsFramework
void EditorEntityModel::EditorEntityModelEntry::UpdateSliceInfo()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
//reset slice info
m_sliceFlags = (m_sliceFlags & SliceFlag_OverridesMask); // only hold on to the override flags
@@ -1037,7 +1037,7 @@ namespace AzToolsFramework
void EditorEntityModel::EditorEntityModelEntry::UpdateOrderInfo(bool notify)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ::u64 oldIndex = m_indexForSorting;
AZ::u64 newIndex = 0;
@@ -1061,7 +1061,7 @@ namespace AzToolsFramework
void EditorEntityModel::EditorEntityModelEntry::UpdateChildOrderInfo(bool forceAddToBack)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
//add order info if missing
for (auto childId : m_children)
{
@@ -1475,7 +1475,7 @@ namespace AzToolsFramework
void EditorEntityModel::EditorEntityModelEntry::OnEntityLockFlagChanged(bool locked)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (m_locked != locked)
{
@@ -1493,7 +1493,7 @@ namespace AzToolsFramework
void EditorEntityModel::EditorEntityModelEntry::OnEntityVisibilityFlagChanged(bool visibility)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (m_visible != visibility)
{
@@ -1511,7 +1511,7 @@ namespace AzToolsFramework
void EditorEntityModel::EditorEntityModelEntry::OnSelected()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (!m_selected)
{
m_selected = true;
@@ -1522,7 +1522,7 @@ namespace AzToolsFramework
void EditorEntityModel::EditorEntityModelEntry::OnDeselected()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (m_selected)
{
m_selected = false;
@@ -1533,7 +1533,7 @@ namespace AzToolsFramework
void EditorEntityModel::EditorEntityModelEntry::OnEntityNameChanged(const AZStd::string& name)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (m_name != name)
{
m_name = name;
@@ -1554,7 +1554,7 @@ namespace AzToolsFramework
{
if (CanProcessOverrides())
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
using TransformComponent = AzToolsFramework::Components::TransformComponent;
@@ -1569,7 +1569,7 @@ namespace AzToolsFramework
{
if (CanProcessOverrides())
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
using EditorInspectorComponent = AzToolsFramework::Components::EditorInspectorComponent;
@@ -1584,7 +1584,7 @@ namespace AzToolsFramework
{
if (CanProcessOverrides())
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ::Component* liveComponent = m_entity->FindComponent(componentId);
AZ::Component* sourceComponent = m_sourceClone->FindComponent(componentId);
@@ -1804,7 +1804,7 @@ namespace AzToolsFramework
return;
}
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ::u8 lastFlags = m_sliceFlags;
@@ -1884,7 +1884,7 @@ namespace AzToolsFramework
void EditorEntityModel::EditorEntityModelEntry::ModifyParentsOverriddenChildren(AZ::EntityId childEntityId, AZ::u8 lastFlags, bool childHasOverrides)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (((lastFlags & SliceFlag_EntityHasOverrides) == 0) != ((m_sliceFlags & SliceFlag_EntityHasOverrides) == 0))
{
@@ -1916,7 +1916,7 @@ namespace AzToolsFramework
void EditorEntityModel::EditorEntityModelEntry::UpdateCyclicDependencyInfo()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// Only check cyclic dependency if the current entity is a slice root
if (!IsSliceRoot())
@@ -130,7 +130,7 @@ namespace AzToolsFramework
bool EditorEntitySortComponent::SetChildEntityOrderArray(const EntityOrderArray& entityOrderArray)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (m_childEntityOrderArray != entityOrderArray)
{
m_childEntityOrderArray = entityOrderArray;
@@ -143,7 +143,7 @@ namespace AzToolsFramework
bool EditorEntitySortComponent::AddChildEntityInternal(const AZ::EntityId& entityId, bool addToBack, EntityOrderArray::iterator insertPosition)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
auto entityItr = m_childEntityOrderCache.find(entityId);
if (entityItr == m_childEntityOrderCache.end())
{
@@ -197,7 +197,7 @@ namespace AzToolsFramework
bool EditorEntitySortComponent::RemoveChildEntity(const AZ::EntityId& entityId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
auto entityItr = m_childEntityOrderCache.find(entityId);
if (entityItr != m_childEntityOrderCache.end())
{
@@ -222,7 +222,7 @@ namespace AzToolsFramework
void EditorEntitySortComponent::OnEntityStreamLoadSuccess()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
m_childEntityOrderCache.clear();
if (!m_childEntityOrderArray.empty())
@@ -320,7 +320,7 @@ namespace AzToolsFramework
void EditorEntitySortComponent::RebuildEntityOrderCache()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
m_childEntityOrderCache.clear();
for (auto entityId : m_childEntityOrderArray)
{
@@ -77,7 +77,7 @@ namespace AzToolsFramework
AzFramework::SliceInstantiationTicket SliceEditorEntityOwnershipService::InstantiateEditorSlice(
const AZ::Data::Asset<AZ::Data::AssetData>& sliceAsset, const AZ::Transform& worldTransform)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (sliceAsset.GetId().IsValid())
{
@@ -97,7 +97,7 @@ namespace AzToolsFramework
void SliceEditorEntityOwnershipService::OnSlicePreInstantiate(const AZ::Data::AssetId& sliceAssetId, const AZ::SliceComponent::SliceInstanceAddress& sliceAddress)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
const AzFramework::SliceInstantiationTicket ticket = *AzFramework::SliceInstantiationResultBus::GetCurrentBusId();
// Start an undo that will wrap the entire slice instantiation event (unable to do this at a higher level since this is queued up by AzFramework and there's no undo concept at that level)
@@ -134,7 +134,7 @@ namespace AzToolsFramework
void SliceEditorEntityOwnershipService::OnSliceInstantiated(const AZ::Data::AssetId& sliceAssetId, const AZ::SliceComponent::SliceInstanceAddress& sliceAddress)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
const AzFramework::SliceInstantiationTicket ticket = *AzFramework::SliceInstantiationResultBus::GetCurrentBusId();
@@ -149,7 +149,7 @@ namespace AzToolsFramework
// Close out the next ticket corresponding to this asset.
for (auto instantiatingIter = m_instantiatingSlices.begin(); instantiatingIter != m_instantiatingSlices.end(); ++instantiatingIter)
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EditorEntityContextComponent::OnSliceInstantiated:CloseTicket");
AZ_PROFILE_SCOPE(AzToolsFramework, "EditorEntityContextComponent::OnSliceInstantiated:CloseTicket");
if (instantiatingIter->first.GetId() == sliceAssetId)
{
const AZ::SliceComponent::EntityList& entities = sliceAddressCopy.GetInstance()->GetInstantiated()->m_entities;
@@ -165,7 +165,7 @@ namespace AzToolsFramework
// Create a slice instantiation undo command.
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EditorEntityContextComponent::OnSliceInstantiated:CloseTicket:CreateInstantiateUndo");
AZ_PROFILE_SCOPE(AzToolsFramework, "EditorEntityContextComponent::OnSliceInstantiated:CloseTicket:CreateInstantiateUndo");
ScopedUndoBatch undoBatch("Instantiate Slice");
for (AZ::Entity* entity : entities)
{
@@ -192,7 +192,7 @@ namespace AzToolsFramework
void SliceEditorEntityOwnershipService::OnSliceInstantiationFailed(const AZ::Data::AssetId& sliceAssetId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
const AzFramework::SliceInstantiationTicket ticket = *AzFramework::SliceInstantiationResultBus::GetCurrentBusId();
@@ -214,7 +214,7 @@ namespace AzToolsFramework
AZ::SliceComponent::SliceInstanceAddress SliceEditorEntityOwnershipService::CloneEditorSliceInstance(
AZ::SliceComponent::SliceInstanceAddress sourceInstance, AZ::SliceComponent::EntityIdToEntityIdMap& sourceToCloneEntityIdMap)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (sourceInstance.IsValid())
{
@@ -330,7 +330,7 @@ namespace AzToolsFramework
void SliceEditorEntityOwnershipService::DetachSliceInstances(const AZ::SliceComponent::SliceInstanceAddressSet& instances)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
const char* undoMsg = instances.size() == 1 ? "Detach Instance from Slice" : "Detach Instances from Slice";
@@ -359,7 +359,7 @@ namespace AzToolsFramework
void SliceEditorEntityOwnershipService::DetachSubsliceInstances(const AZ::SliceComponent::SliceInstanceEntityIdRemapList& subsliceRootList)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (subsliceRootList.empty())
{
@@ -379,7 +379,7 @@ namespace AzToolsFramework
void SliceEditorEntityOwnershipService::DetachFromSlice(const AzToolsFramework::EntityIdList& entities, const char* undoMessage)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (entities.empty())
{
@@ -424,7 +424,7 @@ namespace AzToolsFramework
void SliceEditorEntityOwnershipService::OnAssetReady(AZ::Data::Asset<AZ::Data::AssetData> asset)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ::Data::AssetBus::MultiHandler::BusDisconnect(asset.GetId());
@@ -511,7 +511,7 @@ namespace AzToolsFramework
//=========================================================================
void SliceEditorEntityOwnershipService::OnAssetReloaded(AZ::Data::Asset<AZ::Data::AssetData> asset)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
EntityIdList selectedEntities;
ToolsApplicationRequests::Bus::BroadcastResult(selectedEntities, &ToolsApplicationRequests::GetSelectedEntities);
@@ -524,7 +524,7 @@ namespace AzToolsFramework
void SliceEditorEntityOwnershipService::ResetEntitiesToSliceDefaults(EntityIdList entities)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
ScopedUndoBatch undoBatch("Resetting entities to slice defaults.");
PreemptiveUndoCache* preemptiveUndoCache = nullptr;
@@ -646,7 +646,7 @@ namespace AzToolsFramework
bool SliceEditorEntityOwnershipService::SaveToStreamForEditor(AZ::IO::GenericStream& stream, const EntityList& entitiesInLayers,
AZ::SliceComponent::SliceReferenceToInstancePtrs& instancesInLayers)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ_Assert(stream.IsOpen(), "Invalid target stream.");
AzFramework::RootSliceAsset rootSliceAsset = GetRootAsset();
@@ -685,7 +685,7 @@ namespace AzToolsFramework
bool SliceEditorEntityOwnershipService::SaveToStreamForGame(AZ::IO::GenericStream& stream, AZ::DataStream::StreamType streamType)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ::SliceComponent::EntityList sourceEntities;
GetRootSlice()->GetEntities(sourceEntities);
@@ -929,7 +929,7 @@ namespace AzToolsFramework
bool SliceEditorEntityOwnershipService::LoadFromStreamWithLayers(AZ::IO::GenericStream& stream, QString levelPakFile)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ::ObjectStream::FilterDescriptor filterDesc = AZ::ObjectStream::FilterDescriptor(&AZ::Data::AssetFilterSourceSlicesOnly);
@@ -33,7 +33,7 @@ namespace AzToolsFramework
bool BaseManipulator::OnLeftMouseDown(const ViewportInteraction::MouseInteraction& interaction, const float rayIntersectionDistance)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (m_onLeftMouseDownImpl)
{
@@ -59,7 +59,7 @@ namespace AzToolsFramework
bool BaseManipulator::OnRightMouseDown(const ViewportInteraction::MouseInteraction& interaction, const float rayIntersectionDistance)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (m_onRightMouseDownImpl)
{
@@ -87,7 +87,7 @@ namespace AzToolsFramework
// attached as no active manipulator will have been set in ManipulatorManager.
void BaseManipulator::OnLeftMouseUp(const ViewportInteraction::MouseInteraction& interaction)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
SetBoundsDirty();
@@ -98,7 +98,7 @@ namespace AzToolsFramework
void BaseManipulator::OnRightMouseUp(const ViewportInteraction::MouseInteraction& interaction)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
SetBoundsDirty();
@@ -109,7 +109,7 @@ namespace AzToolsFramework
bool BaseManipulator::OnMouseOver(const ManipulatorId manipulatorId, const ViewportInteraction::MouseInteraction& interaction)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
UpdateMouseOver(manipulatorId);
OnMouseOverImpl(manipulatorId, interaction);
@@ -125,7 +125,7 @@ namespace AzToolsFramework
void BaseManipulator::OnMouseMove(const ViewportInteraction::MouseInteraction& interaction)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (!m_performingAction)
{
@@ -142,7 +142,7 @@ namespace AzToolsFramework
void BaseManipulator::SetBoundsDirty()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
SetBoundsDirtyImpl();
}
@@ -190,7 +190,7 @@ namespace AzToolsFramework
void BaseManipulator::EndAction()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (!m_performingAction)
{
@@ -235,7 +235,7 @@ namespace AzToolsFramework
void BaseManipulator::NotifyEntityComponentPropertyChanged()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
for (const AZ::EntityComponentIdPair& entityComponentIdPair : m_entityComponentIdPairs)
{
@@ -268,7 +268,7 @@ namespace AzToolsFramework
AZStd::unordered_set<AZ::EntityComponentIdPair>::iterator BaseManipulator::RemoveEntityId(const AZ::EntityId entityId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
auto afterErased = m_entityComponentIdPairs.end();
@@ -297,7 +297,7 @@ namespace AzToolsFramework
AZStd::unordered_set<AZ::EntityComponentIdPair>::iterator BaseManipulator::RemoveEntityComponentIdPair(
const AZ::EntityComponentIdPair& entityComponentIdPair)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
const auto entityIdIt = m_entityComponentIdPairs.find(entityComponentIdPair);
@@ -147,7 +147,7 @@ namespace AzToolsFramework
const AZ::Vector3& localManipulatorStartPosition,
const AZ::Vector3& localManipulatorOffset)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// bind FixedVerticesRequestBus for improved performance
typename AZ::FixedVerticesRequestBus<Vertex>::BusPtr fixedVertices;
@@ -180,7 +180,7 @@ namespace AzToolsFramework
template<typename Vertex>
void InitializeVertexLookup(IndexedTranslationManipulator<Vertex>& translationManipulator, const AZ::EntityId entityId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// bind FixedVerticesRequestBus for improved performance
typename AZ::FixedVerticesRequestBus<Vertex>::BusPtr fixedVertices;
@@ -210,7 +210,7 @@ namespace AzToolsFramework
const Vertex& vertex,
size_t vertexIndex)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// if we have a vertex (translation) manipulator active, ensure
// it gets removed when clicking on another selection manipulator
@@ -342,7 +342,7 @@ namespace AzToolsFramework
const EditorBoxSelect& editorBoxSelect,
const AZStd::vector<AZStd::shared_ptr<SelectionManipulator>>& selectionManipulators)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// refresh selection manipulators and box select data when modifiers change
// (switching from additive to subtractive)
@@ -481,7 +481,7 @@ namespace AzToolsFramework
const TranslationManipulators::Dimensions dimensions,
const TranslationManipulatorConfiguratorFn translationManipulatorConfigurator)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
m_dimensions = dimensions;
m_manipulatorManagerId = managerId;
@@ -705,7 +705,7 @@ namespace AzToolsFramework
template<typename Vertex>
void EditorVertexSelectionBase<Vertex>::ClearSelected()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// if translation manipulator is active, remove it when receiving this event and enable
// the hover manipulator bounds again so points can be inserted again
@@ -736,7 +736,7 @@ namespace AzToolsFramework
void EditorVertexSelectionBase<Vertex>::DisplayEntityViewport(
const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
m_editorBoxSelect.DisplayScene(viewportInfo, debugDisplay);
@@ -747,7 +747,7 @@ namespace AzToolsFramework
void EditorVertexSelectionBase<Vertex>::DisplayViewport2d(
const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
m_editorBoxSelect.Display2d(viewportInfo, debugDisplay);
}
@@ -756,7 +756,7 @@ namespace AzToolsFramework
template<typename V, typename AZStd::enable_if<AZStd::is_same<V, AZ::Vector3>::value>::type*>
void EditorVertexSelectionBase<Vertex>::UpdateManipulatorSpace(const AzFramework::ViewportInfo& viewportInfo)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// check if 'shift' is being held to move to parent space
bool worldSpace = false;
@@ -803,7 +803,7 @@ namespace AzToolsFramework
template<typename Vertex>
void EditorVertexSelectionVariable<Vertex>::DestroySelected()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
const AZ::EntityId entityId = EditorVertexSelectionBase<Vertex>::GetEntityId();
@@ -855,7 +855,7 @@ namespace AzToolsFramework
template<typename Vertex>
void EditorVertexSelectionBase<Vertex>::SetSelectedPosition(const AZ::Vector3& localPosition)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (m_translationManipulator)
{
@@ -884,7 +884,7 @@ namespace AzToolsFramework
template<typename Vertex>
void EditorVertexSelectionBase<Vertex>::RefreshTranslationManipulator()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// bind FixedVerticesRequestBus for improved performance
typename AZ::FixedVerticesRequestBus<Vertex>::BusPtr fixedVertices;
@@ -915,7 +915,7 @@ namespace AzToolsFramework
template<typename Vertex>
void EditorVertexSelectionBase<Vertex>::RefreshLocal()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// we do not want to refresh our local state while a batch movement is in progress,
// even if we have been signalled to do so by a callback
@@ -955,7 +955,7 @@ namespace AzToolsFramework
template<typename Vertex>
void EditorVertexSelectionBase<Vertex>::RefreshSpace(const AZ::Transform& worldFromLocal, const AZ::Vector3& nonUniformScale)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
for (auto& manipulator : m_selectionManipulators)
{
@@ -982,7 +982,7 @@ namespace AzToolsFramework
template<typename Vertex>
void EditorVertexSelectionBase<Vertex>::SetBoundsDirty()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
for (auto& manipulator : m_selectionManipulators)
{
@@ -1008,7 +1008,7 @@ namespace AzToolsFramework
const AZ::EntityComponentIdPair& entityComponentIdPair,
const ManipulatorManagerId managerId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
Vertex vertex;
bool found = false;
@@ -1078,7 +1078,7 @@ namespace AzToolsFramework
const ManipulatorManagerId managerId,
const size_t vertexIndex)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// setup selection manipulator
const AZStd::shared_ptr<ManipulatorViewSphere> selectionView = AzToolsFramework::CreateManipulatorViewSphere(
@@ -1115,7 +1115,7 @@ namespace AzToolsFramework
const ManipulatorManagerId managerId,
const size_t vertexIndex)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// setup selection manipulator
const AZStd::shared_ptr<ManipulatorViewSphere> manipulatorView = AzToolsFramework::CreateManipulatorViewSphere(
@@ -1223,7 +1223,7 @@ namespace AzToolsFramework
Vertex EditorVertexSelectionVariable<Vertex>::InsertSelectedInPlace(
AZStd::vector<typename IndexedTranslationManipulator<Vertex>::VertexLookup>& manipulators)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// utility to calculate the center point of the selected vertices after duplication
MidpointCalculator midpointCalculator;
@@ -1267,7 +1267,7 @@ namespace AzToolsFramework
template<typename Vertex>
void EditorVertexSelectionVariable<Vertex>::DuplicateSelected()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
ScopedUndoBatch duplicateUndo("Duplicate Vertices");
ScopedUndoBatch::MarkEntityDirty(EditorVertexSelectionBase<Vertex>::GetEntityId());
@@ -1346,7 +1346,7 @@ namespace AzToolsFramework
template<typename Vertex>
void InsertVertexAfter(const AZ::EntityComponentIdPair& entityComponentIdPair, const size_t vertexIndex, const Vertex& localPosition)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
size_t size = 0;
AZ::VariableVerticesRequestBus<Vertex>::EventResult(
@@ -74,7 +74,7 @@ namespace AzToolsFramework
Picking::RegisteredBoundId ManipulatorManager::UpdateBound(
const ManipulatorId manipulatorId, const Picking::RegisteredBoundId boundId, const Picking::BoundRequestShapeBase& boundShapeData)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (manipulatorId == InvalidManipulatorId)
{
@@ -124,7 +124,7 @@ namespace AzToolsFramework
void ManipulatorManager::RefreshMouseOverState(const ViewportInteraction::MousePick& mousePick)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (!Interacting())
{
@@ -142,7 +142,7 @@ namespace AzToolsFramework
const AzFramework::CameraState& cameraState,
const ViewportInteraction::MouseInteraction& mouseInteraction)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
for (const auto& pair : m_manipulatorIdToPtrMap)
{
@@ -155,7 +155,7 @@ namespace AzToolsFramework
AZStd::shared_ptr<BaseManipulator> ManipulatorManager::PerformRaycast(
const AZ::Vector3& rayOrigin, const AZ::Vector3& rayDirection, float& rayIntersectionDistance)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
Picking::RaySelectInfo raySelection;
raySelection.m_origin = rayOrigin;
@@ -255,7 +255,7 @@ namespace AzToolsFramework
ManipulatorManager::ConsumeMouseMoveResult ManipulatorManager::ConsumeViewportMouseMove(
const ViewportInteraction::MouseInteraction& interaction)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (m_activeManipulator)
{
@@ -279,7 +279,7 @@ namespace AzToolsFramework
void ManipulatorManager::OnEntityInfoUpdatedVisibility(const AZ::EntityId entityId, const bool visible)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
for (auto& pair : m_manipulatorIdToPtrMap)
{
@@ -996,12 +996,12 @@ namespace AzToolsFramework
// the full nested hierarchy with what is returned from RetrieveAndSortPrefabEntitiesAndInstances
AzToolsFramework::EntityIdSet duplicationSet = AzToolsFramework::GetCulledEntityHierarchy(entityIdsNoLevelInstance);
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
ScopedUndoBatch undoBatch("Duplicate Entities");
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "DuplicateEntitiesInInstance::UndoCaptureAndDuplicateEntities");
AZ_PROFILE_SCOPE(AzToolsFramework, "DuplicateEntitiesInInstance::UndoCaptureAndDuplicateEntities");
AZStd::vector<AZ::Entity*> entities;
AZStd::vector<Instance*> instances;
@@ -1123,7 +1123,7 @@ namespace AzToolsFramework
// Retrieve entityList from entityIds
EntityList inputEntityList = EntityIdListToEntityList(entityIdsNoLevelInstance);
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
ScopedUndoBatch undoBatch("Delete Selected");
@@ -1145,7 +1145,7 @@ namespace AzToolsFramework
}
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "Internal::DeleteEntities:UndoCaptureAndPurgeEntities");
AZ_PROFILE_SCOPE(AzToolsFramework, "Internal::DeleteEntities:UndoCaptureAndPurgeEntities");
Prefab::PrefabDom instanceDomBefore;
m_instanceToTemplateInterface->GenerateDomForInstance(instanceDomBefore, commonOwningInstance->get());
@@ -1205,7 +1205,7 @@ namespace AzToolsFramework
selCommand->SetParent(undoBatch.GetUndoBatch());
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "Internal::DeleteEntities:RunRedo");
AZ_PROFILE_SCOPE(AzToolsFramework, "Internal::DeleteEntities:RunRedo");
selCommand->RunRedo();
}
@@ -1230,10 +1230,10 @@ namespace AzToolsFramework
return AZ::Failure(AZStd::string("Input entity should be its owning Instance's container entity."));
}
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "Internal::DetachPrefab:UndoCapture");
AZ_PROFILE_SCOPE(AzToolsFramework, "Internal::DetachPrefab:UndoCapture");
ScopedUndoBatch undoBatch("Detach Prefab");
@@ -1294,7 +1294,7 @@ namespace AzToolsFramework
command->Capture(instanceDomBefore, instanceDomAfter, parentTemplateId);
command->SetParent(undoBatch.GetUndoBatch());
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "Internal::DetachPrefab:RunRedo");
AZ_PROFILE_SCOPE(AzToolsFramework, "Internal::DetachPrefab:RunRedo");
command->RunRedo();
}
@@ -12,6 +12,7 @@
#include <AzCore/Component/Entity.h>
#include <AzCore/Component/TransformBus.h>
#include <AzCore/Console/ILogger.h>
#include <AzCore/Debug/Profiler.h>
#include <AzCore/Interface/Interface.h>
#include <AzFramework/API/ApplicationAPI.h>
@@ -111,7 +112,7 @@ namespace AzToolsFramework
void PrefabUndoCache::UpdateCache(const AZ::EntityId& entityId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ::Entity* entity = nullptr;
AZ::ComponentApplicationBus::BroadcastResult(entity, &AZ::ComponentApplicationRequests::FindEntity, entityId);
@@ -274,7 +274,7 @@ namespace AzToolsFramework
*/
SliceCompilationResult CompileEditorSlice(const AZ::Data::Asset<AZ::SliceAsset>& sourceSliceAsset, const AZ::PlatformTagSet& platformTags, AZ::SerializeContext& serializeContext, const EditorOnlyEntityHandlers& editorOnlyEntityHandlers)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (!sourceSliceAsset)
{
return AZ::Failure(AZStd::string("Source slice is invalid."));
@@ -657,7 +657,7 @@ namespace AzToolsFramework
// tolerate ALL possible input errors (looping parents, invalid IDs, etc).
void SortTransformParentsBeforeChildren(AZStd::vector<AZ::Entity*>& entities)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// IDs of those present in 'entities'. Does not include parent ID if parent not found in 'entities'
AZStd::unordered_set<AZ::EntityId> existingEntityIds;
@@ -63,7 +63,7 @@ namespace AzToolsFramework
void Capture(const SliceTransaction::SliceAssetPtr& before, const SliceTransaction::SliceAssetPtr& after, const char* sliceAssetPath)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
m_sliceAssetPath = sliceAssetPath;
m_isNewAsset = !before.GetId().IsValid();
@@ -74,7 +74,7 @@ namespace AzToolsFramework
if (!m_isNewAsset)
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDiskCommand::Capture:SaveBefore");
AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDiskCommand::Capture:SaveBefore");
AZ::SliceAsset* sliceBefore = before.Get();
AZ::Entity* sliceEntityBefore = sliceBefore->GetEntity();
AZ::IO::ByteContainerStream<ByteBuffer> beforeStream(&m_sliceAssetBeforeBuffer);
@@ -82,7 +82,7 @@ namespace AzToolsFramework
}
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDiskCommand::Capture:SaveAfter");
AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDiskCommand::Capture:SaveAfter");
AZ::SliceAsset* sliceAfter = after.Get();
AZ::Entity* sliceEntityAfter = sliceAfter->GetEntity();
AZ::IO::ByteContainerStream<ByteBuffer> afterStream(&m_sliceAssetAfterBuffer);
@@ -105,13 +105,13 @@ namespace AzToolsFramework
void Redo() override
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
m_redoResult = Internal::SaveSliceToDisk(m_sliceAssetPath.c_str(), m_sliceAssetAfterBuffer);
}
void Undo() override
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (m_isNewAsset)
{
// New asset means we didn't have an existing asset, so we should instead remove the newly created asset as our undo
@@ -149,7 +149,7 @@ namespace AzToolsFramework
AZ::SerializeContext* serializeContext,
AZ::u32 sliceCreationFlags)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (!serializeContext)
{
@@ -179,7 +179,7 @@ namespace AzToolsFramework
SliceTransaction::TransactionPtr SliceTransaction::BeginSliceOverwrite(const SliceAssetPtr& asset, const AZ::SliceComponent& overwriteComponent, AZ::SerializeContext* serializeContext)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (!serializeContext)
{
@@ -212,7 +212,7 @@ namespace AzToolsFramework
AZ::SerializeContext* serializeContext,
AZ::u32 /*slicePushFlags*/)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (!serializeContext)
{
@@ -515,7 +515,7 @@ namespace AzToolsFramework
SliceTransaction::PostSaveCallback postSaveCallback,
AZ::u32 sliceCommitFlags)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// Clone asset for final modifications and save.
// This also releases borrowed entities and slice instances.
@@ -702,7 +702,7 @@ namespace AzToolsFramework
SliceTransaction::PostSaveCallback postSaveCallback,
AZ::u32 sliceCommitFlags)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZStd::string sliceAssetPath;
AZ::Data::AssetCatalogRequestBus::BroadcastResult(sliceAssetPath, &AZ::Data::AssetCatalogRequests::GetAssetPathById, targetAssetId);
@@ -762,7 +762,7 @@ namespace AzToolsFramework
//=========================================================================
SliceTransaction::SliceAssetPtr SliceTransaction::CloneAssetForSave()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// Move included slice instances to the target asset temporarily so that they are included in the clone
for (auto& addedSliceInstanceIt : m_addedSliceInstances)
@@ -868,7 +868,7 @@ namespace AzToolsFramework
//=========================================================================
SliceTransaction::Result SliceTransaction::PreSave(const char* fullPath, SliceAssetPtr& asset, PreSaveCallback preSaveCallback, AZ::u32 /*sliceCommitFlags*/)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// Remap live Ids back to those of the asset.
AZ::EntityUtils::SerializableEntityContainer assetEntities;
@@ -904,7 +904,7 @@ namespace AzToolsFramework
//=========================================================================
AZ::EntityId SliceTransaction::FindTargetAncestorAndUpdateInstanceIdMap(AZ::EntityId entityId, AZ::SliceComponent::EntityIdToEntityIdMap& liveToAssetIdMap, const AZ::SliceComponent::SliceInstanceAddress* ignoreSliceInstance) const
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ::SliceComponent* slice = m_targetAsset.Get()->GetComponent();
@@ -1036,7 +1036,7 @@ namespace AzToolsFramework
//=========================================================================
SliceTransaction::Result SaveSliceToDisk(const char* targetPath, AZStd::vector<AZ::u8>& sliceAssetEntityMemoryBuffer, AZ::SerializeContext* serializeContext)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ::IO::FileIOBase* fileIO = AZ::IO::FileIOBase::GetInstance();
AZ_Assert(fileIO, "File IO is not initialized.");
@@ -1058,7 +1058,7 @@ namespace AzToolsFramework
// Write the in-memory copy to file
bool savedToFile;
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDisk:SaveToFileStream");
AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDisk:SaveToFileStream");
memoryStream.Seek(0, AZ::IO::GenericStream::ST_SEEK_BEGIN);
savedToFile = fileStream.Write(memoryStream.GetLength(), memoryStream.GetData()->data()) != 0;
}
@@ -1066,14 +1066,14 @@ namespace AzToolsFramework
if (savedToFile)
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDisk:TempToTargetFileReplacement");
AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDisk:TempToTargetFileReplacement");
// Copy scratch file to target location.
const bool targetFileExists = fileIO->Exists(targetPath);
bool removedTargetFile;
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDisk:TempToTargetFileReplacement:RemoveTarget");
AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDisk:TempToTargetFileReplacement:RemoveTarget");
removedTargetFile = fileIO->Remove(targetPath);
}
@@ -1083,7 +1083,7 @@ namespace AzToolsFramework
}
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDisk:TempToTargetFileReplacement:RenameTempFile");
AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDisk:TempToTargetFileReplacement:RenameTempFile");
AZ::IO::Result renameResult = fileIO->Rename(tempFilePath.c_str(), targetPath);
if (!renameResult)
{
@@ -1093,7 +1093,7 @@ namespace AzToolsFramework
// Bump the slice asset up in the asset processor's queue.
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDisk:TempToTargetFileReplacement:GetAssetStatus");
AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::Internal::SaveSliceToDisk:TempToTargetFileReplacement:GetAssetStatus");
EBUS_EVENT(AzFramework::AssetSystemRequestBus, EscalateAssetBySearchTerm, targetPath);
}
return AZ::Success();
@@ -405,7 +405,7 @@ namespace AzToolsFramework
bool QueryAndPruneMissingExternalReferences(AzToolsFramework::EntityIdSet& entities, AzToolsFramework::EntityIdSet& selectedAndReferencedEntities,
bool& useReferencedEntities, bool defaultMoveExternalRefs = false)
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::MakeNewSlice:HandleNotIncludedReferences");
AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::MakeNewSlice:HandleNotIncludedReferences");
useReferencedEntities = false;
AZStd::string includedEntities;
@@ -440,7 +440,7 @@ namespace AzToolsFramework
{
if (!defaultMoveExternalRefs)
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::MakeNewSlice:HandleNotIncludedReferences:UserDialog");
AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::MakeNewSlice:HandleNotIncludedReferences:UserDialog");
const AZStd::string message = AZStd::string::format(
"Entity references may not be valid if the entity IDs change or if the entities do not exist when the slice is instantiated.\r\n\r\nSelected Entities\n%s\nReferenced Entities\n%s\n",
@@ -510,7 +510,7 @@ namespace AzToolsFramework
while (true)
{
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::MakeNewSlice:SaveAsDialog");
AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::MakeNewSlice:SaveAsDialog");
saveAs = QFileDialog::getSaveFileName(nullptr, QString("Save As..."), saveAsInitialSuggestedFullPath.c_str(), QString("Slices (*.slice)"));
}
@@ -608,7 +608,7 @@ namespace AzToolsFramework
bool silenceWarningPopups,
AZ::SerializeContext* serializeContext)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (entities.empty())
{
@@ -702,7 +702,7 @@ namespace AzToolsFramework
{
if (inheritSlices)
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::MakeNewSlice:CloneExistingSliceEntities");
AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::MakeNewSlice:CloneExistingSliceEntities");
const AZ::EntityId dummyParentId;
@@ -801,14 +801,14 @@ namespace AzToolsFramework
// Setup and execute transaction for the new slice.
//
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::MakeNewSlice:SetupAndExecuteTransaction");
AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::MakeNewSlice:SetupAndExecuteTransaction");
// PreSaveCallback for slice creation: Before saving slice, we ensure it has a single root by optionally auto-creating one for the user
SliceTransaction::PreSaveCallback preSaveCallback =
[&sliceName, &sliceRootEntityPosition, &sliceRootEntityRotation, &activeWindow, &defaultGenerateSharedRoot]
(SliceTransaction::TransactionPtr transaction, const char* fullPath, SliceTransaction::SliceAssetPtr& asset) -> SliceTransaction::Result
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::MakeNewSlice:PreSaveCallback");
AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::MakeNewSlice:PreSaveCallback");
AZ::SliceComponent::EntityIdToEntityIdMap assetToLiveEntityIDMap;
const AZ::SliceComponent::EntityIdToEntityIdMap& liveToAssetEntityIDMap = transaction->GetLiveToAssetEntityIdMap();
@@ -855,7 +855,7 @@ namespace AzToolsFramework
// Add entities
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::MakeNewSlice:SetupAndExecuteTransaction:AddEntities");
AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::MakeNewSlice:SetupAndExecuteTransaction:AddEntities");
for (const AZ::EntityId& entityId : entitiesToIncludeInAsset)
{
SliceTransaction::Result addResult = transaction->AddEntity(entityId, !inheritSlices ? SliceTransaction::SliceAddEntityFlags::DiscardSliceAncestry : 0);
@@ -914,7 +914,7 @@ namespace AzToolsFramework
void GatherAllReferencedEntities(AzToolsFramework::EntityIdSet& entitiesWithReferences,
AZ::SerializeContext& serializeContext)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZStd::vector<AZ::EntityId> floodQueue;
floodQueue.reserve(entitiesWithReferences.size());
@@ -1038,7 +1038,7 @@ namespace AzToolsFramework
const AZ::SliceComponent::SliceInstance& instance,
AZ::SerializeContext& serializeContext)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ_Assert(instance.GetEntityIdMap().find(sourceEntity.GetId()) != instance.GetEntityIdMap().end(), "Provided source entity is not a member of the provided slice instance.");
@@ -1494,7 +1494,7 @@ namespace AzToolsFramework
//=========================================================================
SliceTransaction::Result SlicePreSaveCallbackForWorldEntities(SliceTransaction::TransactionPtr transaction, const char* fullPath, SliceTransaction::SliceAssetPtr& asset)
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::SlicePreSaveCallbackForWorldEntities");
AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::SlicePreSaveCallbackForWorldEntities");
// Apply standard root transform rules. Zero out root entity translation, ensure single root, ensure slice root has no parent in slice.
SliceTransaction::Result worldTransformRulesResult = VerifyAndApplySliceWorldTransformRules(asset);
@@ -1536,7 +1536,7 @@ namespace AzToolsFramework
void SlicePostSaveCallbackForNewSlice(SliceTransaction::TransactionPtr transaction, const char* fullPath, const SliceTransaction::SliceAssetPtr& transactionAsset)
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::SlicePostSaveCallbackForNewSlice");
AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::SlicePostSaveCallbackForNewSlice");
const char* undoMessage = "Create Slice Asset";
ScopedUndoBatch undoBatch(undoMessage);
@@ -1568,7 +1568,7 @@ namespace AzToolsFramework
bool CheckSliceAdditionCyclicDependencySafe(const AZ::SliceComponent::SliceInstanceAddress& instanceToAdd,
const AZ::SliceComponent::SliceInstanceAddress& targetInstanceToAddTo)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ_Assert(instanceToAdd.IsValid(), "Invalid instanceToAdd passed to CheckSliceADditionCyclicDependencySafe.");
@@ -1706,7 +1706,7 @@ namespace AzToolsFramework
void PopulateSliceSubMenus(QMenu& outerMenu, const AzToolsFramework::EntityIdList& inputEntities, SliceSelectedCallback sliceSelectedCallback, SliceSelectedCallback sliceRelationshipViewCallback)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// The find slice menu only works with a single entity selected.
if (inputEntities.size() != 1)
{
@@ -2244,7 +2244,7 @@ namespace AzToolsFramework
//=========================================================================
bool DoEntitiesHaveOverrides(const AzToolsFramework::EntityIdList& inputEntities)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ::SerializeContext* serializeContext = nullptr;
AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationBus::Events::GetSerializeContext);
@@ -2287,7 +2287,7 @@ namespace AzToolsFramework
//=========================================================================
bool IsReparentNonTrivial(const AZ::EntityId& entityId, const AZ::EntityId& newParentId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ::EntityId oldParentId;
AZ::TransformBus::EventResult(oldParentId, entityId, &AZ::TransformBus::Events::GetParentId);
@@ -2358,7 +2358,7 @@ namespace AzToolsFramework
void ReparentNonTrivialSliceInstanceHierarchy(const AZ::EntityId& entityId, const AZ::EntityId& newParentId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ::SliceComponent::SliceInstanceEntityIdRemapList subslicesToDetach;
AzToolsFramework::EntityIdList entitiesToDetach;
@@ -2892,7 +2892,7 @@ namespace AzToolsFramework
//=========================================================================
void GenerateSuggestedSliceFilenameFromEntities(const AzToolsFramework::EntityIdList& entities, AZStd::string& outName)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// Determine suggested save name for slice based on entity names
// For example, with entities Entity0, Entity1, and Entity2, we would end up with
@@ -2962,7 +2962,7 @@ namespace AzToolsFramework
//=========================================================================
void GenerateSuggestedSlicePath(const AZStd::string& sliceName, const AZStd::string& targetDirectory, AZStd::string& suggestedFullPath)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// Generate full suggested path from sliceName - if given NewSlice as sliceName,
// NewSlice_001.slice would be tried, and if that already existed we would suggest
@@ -3079,7 +3079,7 @@ namespace AzToolsFramework
QWidget* activeWindow,
bool defaultGenerateSharedRoot)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ::SerializeContext* serializeContext = nullptr;
AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationBus::Events::GetSerializeContext);
@@ -3105,7 +3105,7 @@ namespace AzToolsFramework
{
int response;
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "SliceUtilities::CheckAndAddSliceRoot:SingleRootUserQuery");
AZ_PROFILE_SCOPE(AzToolsFramework, "SliceUtilities::CheckAndAddSliceRoot:SingleRootUserQuery");
response = QMessageBox::warning(activeWindow,
QStringLiteral("Cannot Create Slice"),
QString("The slice cannot be created because no single transform root is defined. "
@@ -345,7 +345,7 @@ namespace AzToolsFramework
EntityList& entityList,
AZ::SliceComponent::SliceReferenceToInstancePtrs& layerInstances)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
EditorLayer layer;
LayerResult layerPrepareResult = PrepareLayerForSaving(layer, entityList, layerInstances);
if (!layerPrepareResult.IsSuccess())
@@ -373,7 +373,7 @@ namespace AzToolsFramework
AZ::SliceComponent::SliceAssetToSliceInstancePtrs& sliceInstances,
AZStd::unordered_map<AZ::EntityId, AZ::Entity*>& uniqueEntities)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// If this layer is being loaded, it won't have a level save dependency yet, so clear that flag.
m_mustSaveLevelWhenLayerSaves = false;
QString fullPathName = levelPakFile;
@@ -518,7 +518,7 @@ namespace AzToolsFramework
EntityList& entityList,
AZ::SliceComponent::SliceReferenceToInstancePtrs& layerInstances)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// Move the editable data into the data serialized to the layer, and not the layer component.
layer.m_layerProperties = m_editableLayerProperties;
layer.m_layerEntityId = GetEntityId();
@@ -640,7 +640,7 @@ namespace AzToolsFramework
const EditorLayer& layer,
AZ::IO::ByteContainerStream<AZStd::vector<char> >& entitySaveStream)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
m_otherLayersToSave.clear();
m_mustSaveLevelWhenLayerSaves = false;
@@ -662,7 +662,7 @@ namespace AzToolsFramework
QString levelAbsoluteFolder,
const AZ::IO::ByteContainerStream<AZStd::vector<char> >& entitySaveStream)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZStd::string layerBaseFileName(m_layerFileName);
// Write to a temp file first.
@@ -68,7 +68,7 @@ namespace AzToolsFramework
AZStd::function<void()> accentRefreshCallback =
[this]()
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EditorSelectionAccentSystemComponent::QueueAccentRefresh:AccentRefreshCallback");
AZ_PROFILE_SCOPE(AzToolsFramework, "EditorSelectionAccentSystemComponent::QueueAccentRefresh:AccentRefreshCallback");
InvalidateAccents();
RecalculateAndApplyAccents();
m_isAccentRefreshQueued = false;
@@ -79,14 +79,14 @@ namespace AzToolsFramework
void EditorSelectionAccentSystemComponent::ForceSelectionAccentRefresh()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
InvalidateAccents();
RecalculateAndApplyAccents();
}
void EditorSelectionAccentSystemComponent::InvalidateAccents()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
for (const AZ::EntityId& accentedEntity : m_currentlyAccentedEntities)
{
AzToolsFramework::ComponentEntityEditorRequestBus::Event(accentedEntity, &AzToolsFramework::ComponentEntityEditorRequests::SetSandboxObjectAccent, ComponentEntityAccentType::None);
@@ -96,7 +96,7 @@ namespace AzToolsFramework
void EditorSelectionAccentSystemComponent::RecalculateAndApplyAccents()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AzToolsFramework::EntityIdList selectedEntities;
AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult(selectedEntities, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities);
AzToolsFramework::EntityIdSet selectedEntitiesSet;
@@ -121,7 +121,7 @@ namespace AzToolsFramework
ComponentDataTable &componentDataTable,
ComponentIconTable &componentIconTable)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
serializeContext->EnumerateDerived<AZ::Component>(
[&](const AZ::SerializeContext::ClassData* componentClass, const AZ::Uuid& knownType) -> bool
{
@@ -179,7 +179,7 @@ namespace AzToolsFramework
const AZStd::vector<AZ::ComponentServiceType>& incompatibleServiceFilter
)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
bool containsEditable = false;
@@ -130,7 +130,7 @@ namespace AzToolsFramework
void ComponentPaletteWidget::UpdateContent()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
m_componentModel->clear();
bool applyRegExFilter = !m_searchRegExp.isEmpty();
@@ -321,7 +321,7 @@ namespace AzToolsFramework
void ComponentPaletteWidget::UpdateSearch()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
m_searchRegExp = QRegExp(m_searchText->text(), Qt::CaseInsensitive, QRegExp::RegExp);
m_searchText->setFocus();
UpdateContent();
@@ -936,7 +936,7 @@ namespace AzToolsFramework
bool EntityOutlinerListModel::CanReparentEntities(const AZ::EntityId& newParentId, const EntityIdList &selectedEntityIds) const
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (selectedEntityIds.empty())
{
return false;
@@ -1025,7 +1025,7 @@ namespace AzToolsFramework
bool EntityOutlinerListModel::ReparentEntities(const AZ::EntityId& newParentId, const EntityIdList &selectedEntityIds, const AZ::EntityId& beforeEntityId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (!CanReparentEntities(newParentId, selectedEntityIds))
{
return false;
@@ -1105,7 +1105,7 @@ namespace AzToolsFramework
QMimeData* EntityOutlinerListModel::mimeData(const QModelIndexList& indexes) const
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ::TypeId uuid1 = AZ::AzTypeInfo<AZ::Entity>::Uuid();
AZ::TypeId uuid2 = AZ::AzTypeInfo<EditorEntityIdContainer>::Uuid();
@@ -1195,7 +1195,7 @@ namespace AzToolsFramework
void EntityOutlinerListModel::ProcessEntityUpdates()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor);
AZ_PROFILE_FUNCTION(Editor);
m_entityChangeQueued = false;
if (m_layoutResetQueued)
{
@@ -1203,7 +1203,7 @@ namespace AzToolsFramework
}
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Editor, "EntityOutlinerListModel::ProcessEntityUpdates:ExpandQueue");
AZ_PROFILE_SCOPE(Editor, "EntityOutlinerListModel::ProcessEntityUpdates:ExpandQueue");
for (auto entityId : m_entityExpandQueue)
{
emit ExpandEntity(entityId, IsExpanded(entityId));
@@ -1212,7 +1212,7 @@ namespace AzToolsFramework
}
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Editor, "EntityOutlinerListModel::ProcessEntityUpdates:SelectQueue");
AZ_PROFILE_SCOPE(Editor, "EntityOutlinerListModel::ProcessEntityUpdates:SelectQueue");
for (auto entityId : m_entitySelectQueue)
{
emit SelectEntity(entityId, IsSelected(entityId));
@@ -1222,7 +1222,7 @@ namespace AzToolsFramework
if (!m_entityChangeQueue.empty())
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Editor, "EntityOutlinerListModel::ProcessEntityUpdates:ChangeQueue");
AZ_PROFILE_SCOPE(Editor, "EntityOutlinerListModel::ProcessEntityUpdates:ChangeQueue");
// its faster to just do a bulk data change than to carefully pick out indices
// so we'll just merge all ranges into a single range rather than try to make gaps
@@ -1255,7 +1255,7 @@ namespace AzToolsFramework
}
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Editor, "EntityOutlinerListModel::ProcessEntityUpdates:LayoutChanged");
AZ_PROFILE_SCOPE(Editor, "EntityOutlinerListModel::ProcessEntityUpdates:LayoutChanged");
if (m_entityLayoutQueued)
{
emit layoutAboutToBeChanged();
@@ -1265,7 +1265,7 @@ namespace AzToolsFramework
}
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::Editor, "EntityOutlinerListModel::ProcessEntityUpdates:InvalidateFilter");
AZ_PROFILE_SCOPE(Editor, "EntityOutlinerListModel::ProcessEntityUpdates:InvalidateFilter");
if (m_isFilterDirty)
{
InvalidateFilter();
@@ -1288,7 +1288,7 @@ namespace AzToolsFramework
void EntityOutlinerListModel::ProcessEntityInfoResetEnd()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
m_layoutResetQueued = false;
m_entityChangeQueued = false;
m_entityChangeQueue.clear();
@@ -1309,7 +1309,7 @@ namespace AzToolsFramework
void EntityOutlinerListModel::OnEntityInfoUpdatedAddChildEnd(AZ::EntityId parentId, AZ::EntityId childId)
{
(void)parentId;
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
endInsertRows();
//expand ancestors if a new descendant is already selected
@@ -1347,7 +1347,7 @@ namespace AzToolsFramework
void EntityOutlinerListModel::OnEntityInfoUpdatedRemoveChildEnd(AZ::EntityId parentId, AZ::EntityId childId)
{
(void)childId;
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
endResetModel();
@@ -1366,7 +1366,7 @@ namespace AzToolsFramework
void EntityOutlinerListModel::OnEntityInfoUpdatedOrderEnd(AZ::EntityId parentId, AZ::EntityId childId, AZ::u64 index)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor);
AZ_PROFILE_FUNCTION(Editor);
(void)index;
m_entityLayoutQueued = true;
QueueEntityUpdate(parentId);
@@ -1425,7 +1425,7 @@ namespace AzToolsFramework
QModelIndex EntityOutlinerListModel::GetIndexFromEntity(const AZ::EntityId& entityId, int column) const
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (entityId.IsValid())
{
@@ -1587,7 +1587,7 @@ namespace AzToolsFramework
void EntityOutlinerListModel::ExpandAncestors(const AZ::EntityId& entityId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
//typically to reveal selected entities, expand all parent entities
if (entityId.IsValid())
{
@@ -1792,7 +1792,7 @@ namespace AzToolsFramework
bool EntityOutlinerListModel::AreAllDescendantsSameLockState(const AZ::EntityId& entityId) const
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
//TODO result can be cached in mutable map and cleared when any descendant changes to avoid recursion in deep hierarchies
bool isLocked = false;
EditorEntityInfoRequestBus::EventResult(isLocked, entityId, &EditorEntityInfoRequestBus::Events::IsJustThisEntityLocked);
@@ -1813,7 +1813,7 @@ namespace AzToolsFramework
bool EntityOutlinerListModel::AreAllDescendantsSameVisibleState(const AZ::EntityId& entityId) const
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
//TODO result can be cached in mutable map and cleared when any descendant changes to avoid recursion in deep hierarchies
bool isVisible = IsEntitySetToBeVisible(entityId);
@@ -98,7 +98,7 @@ namespace
void SortEntityChildren(AZ::EntityId entityId, const EntityIdCompareFunc& comparer, AzToolsFramework::EntityOrderArray* newEntityOrder = nullptr)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AzToolsFramework::EntityOrderArray entityOrderArray = AzToolsFramework::GetEntityChildOrder(entityId);
AZStd::sort(entityOrderArray.begin(), entityOrderArray.end(), comparer);
@@ -112,7 +112,7 @@ namespace
void SortEntityChildrenRecursively(AZ::EntityId entityId, const EntityIdCompareFunc& comparer)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AzToolsFramework::EntityOrderArray entityOrderArray;
SortEntityChildren(entityId, comparer, &entityOrderArray);
@@ -325,7 +325,7 @@ namespace AzToolsFramework
return;
}
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
EntityIdList newlySelected;
ExtractEntityIdsFromSelection(selected, newlySelected);
@@ -472,7 +472,7 @@ namespace AzToolsFramework
{
if (m_selectionChangeQueued)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
m_selectionChangeInProgress = true;
@@ -480,7 +480,7 @@ namespace AzToolsFramework
{
// Calling Deselect for a large number of items is very slow,
// use a single ClearAndSelect call instead.
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EntityOutlinerWidget::ModelEntitySelectionChanged:ClearAndSelect");
AZ_PROFILE_SCOPE(AzToolsFramework, "EntityOutlinerWidget::ModelEntitySelectionChanged:ClearAndSelect");
EntityIdList selectedEntities;
ToolsApplicationRequests::Bus::BroadcastResult(selectedEntities, &ToolsApplicationRequests::Bus::Events::GetSelectedEntities);
@@ -491,12 +491,12 @@ namespace AzToolsFramework
else
{
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EntityOutlinerWidget::ModelEntitySelectionChanged:Deselect");
AZ_PROFILE_SCOPE(AzToolsFramework, "EntityOutlinerWidget::ModelEntitySelectionChanged:Deselect");
m_gui->m_objectTree->selectionModel()->select(
BuildSelectionFromEntities(m_entitiesToDeselect), QItemSelectionModel::Deselect);
}
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EntityOutlinerWidget::ModelEntitySelectionChanged:Select");
AZ_PROFILE_SCOPE(AzToolsFramework, "EntityOutlinerWidget::ModelEntitySelectionChanged:Select");
m_gui->m_objectTree->selectionModel()->select(
BuildSelectionFromEntities(m_entitiesToSelect), QItemSelectionModel::Select);
}
@@ -519,7 +519,7 @@ namespace AzToolsFramework
template <class EntityIdCollection>
QItemSelection EntityOutlinerWidget::BuildSelectionFromEntities(const EntityIdCollection& entityIds)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
QItemSelection selection;
for (const auto& entityId : entityIds)
@@ -539,7 +539,7 @@ namespace AzToolsFramework
void EntityOutlinerWidget::OnOpenTreeContextMenu(const QPoint& pos)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor);
AZ_PROFILE_FUNCTION(Editor);
bool isDocumentOpen = false;
EBUS_EVENT_RESULT(isDocumentOpen, EditorRequests::Bus, IsLevelDocumentOpen);
@@ -1057,7 +1057,7 @@ namespace AzToolsFramework
void EntityOutlinerWidget::OnSearchTextChanged(const QString& activeTextFilter)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZStd::string filterString = activeTextFilter.toUtf8().data();
m_listModel->SearchStringChanged(filterString);
@@ -1168,7 +1168,7 @@ namespace AzToolsFramework
void EntityOutlinerWidget::SortContent()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
m_sortContentQueued = false;
@@ -1204,7 +1204,7 @@ namespace AzToolsFramework
if (sortMode != EntityOutliner::DisplaySortMode::Manually)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
auto comparer = AZStd::bind(&CompareEntitiesForSorting, AZStd::placeholders::_1, AZStd::placeholders::_2, sortMode);
SortEntityChildrenRecursively(AZ::EntityId(), comparer);
}
@@ -434,7 +434,7 @@ namespace AzToolsFramework
void PrefabIntegrationManager::GenerateSuggestedFilenameFromEntities(const EntityIdList& entityIds, AZStd::string& outName)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZStd::string suggestedName;
@@ -515,7 +515,7 @@ namespace AzToolsFramework
while (true)
{
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
saveAs = QFileDialog::getSaveFileName(nullptr, QString("Save As..."), saveAsInitialSuggestedFullPath.c_str(), QString("Prefabs (*.prefab)"));
}
@@ -851,7 +851,7 @@ namespace AzToolsFramework
void PrefabIntegrationManager::GatherAllReferencedEntities(EntityIdSet& entitiesWithReferences, AZ::SerializeContext& serializeContext)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZStd::vector<AZ::EntityId> floodQueue;
floodQueue.reserve(entitiesWithReferences.size());
@@ -943,7 +943,7 @@ namespace AzToolsFramework
bool PrefabIntegrationManager::QueryAndPruneMissingExternalReferences(EntityIdSet& entities, EntityIdSet& selectedAndReferencedEntities,
bool& useReferencedEntities, bool defaultMoveExternalRefs)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
useReferencedEntities = false;
AZStd::string includedEntities;
@@ -978,7 +978,7 @@ namespace AzToolsFramework
{
if (!defaultMoveExternalRefs)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
const AZStd::string message = AZStd::string::format(
"Entity references may not be valid if the entity IDs change or if the entities do not exist when the prefab is instantiated.\r\n\r\nSelected Entities\n%s\nReferenced Entities\n%s\n",
@@ -527,7 +527,7 @@ namespace AzToolsFramework
void ComponentEditor::SetComponentOverridden(const bool overridden)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
const auto entityId = m_components[0]->GetEntityId();
AZ::SliceComponent::SliceInstanceAddress sliceInstanceAddress;
@@ -699,7 +699,7 @@ namespace AzToolsFramework
void EntityPropertyEditor::BeforeEntitySelectionChanged()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (IsLockedToSpecificEntities())
{
return;
@@ -723,7 +723,7 @@ namespace AzToolsFramework
const AzToolsFramework::EntityIdList& newlySelectedEntities,
const AzToolsFramework::EntityIdList& newlyDeselectedEntities)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (IsLockedToSpecificEntities())
{
// ensure we refresh all entity property editors when
@@ -951,7 +951,7 @@ namespace AzToolsFramework
EntityPropertyEditor::SelectionEntityTypeInfo EntityPropertyEditor::GetSelectionEntityTypeInfo(const EntityIdList& selection) const
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
SelectionEntityTypeInfo result = SelectionEntityTypeInfo::None;
InspectorLayout layout = GetCurrentInspectorLayout();
@@ -1069,7 +1069,7 @@ namespace AzToolsFramework
void EntityPropertyEditor::UpdateContents()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
setUpdatesEnabled(false);
m_isBuildingProperties = true;
@@ -1921,7 +1921,7 @@ namespace AzToolsFramework
void EntityPropertyEditor::QueuePropertyRefresh()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (!m_isAlreadyQueuedRefresh)
{
m_isAlreadyQueuedRefresh = true;
@@ -3234,7 +3234,7 @@ namespace AzToolsFramework
void EntityPropertyEditor::UpdateActions()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (m_disabled)
{
@@ -3282,7 +3282,7 @@ namespace AzToolsFramework
// Even though this causes two loops on the selected entity list, calling GetSelectionEntityTypeInfo avoids duplicating code.
SelectionEntityTypeInfo selectionTypeInfo;
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "EntityPropertyEditor::UpdateActions GetSelectionEntityTypeInfo");
AZ_PROFILE_SCOPE(AzToolsFramework, "EntityPropertyEditor::UpdateActions GetSelectionEntityTypeInfo");
selectionTypeInfo = GetSelectionEntityTypeInfo(m_selectedEntityIds);
}
m_actionToAddComponents->setEnabled(CanAddComponentsToSelection(selectionTypeInfo));
@@ -3907,7 +3907,7 @@ namespace AzToolsFramework
void EntityPropertyEditor::ClearComponentEditorDragging()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
for (auto componentEditor : m_componentEditors)
{
componentEditor->SetDragged(false);
@@ -3918,7 +3918,7 @@ namespace AzToolsFramework
void EntityPropertyEditor::ClearComponentEditorSelection()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
for (auto componentEditor : m_componentEditors)
{
componentEditor->SetSelected(false);
@@ -4043,7 +4043,7 @@ namespace AzToolsFramework
void EntityPropertyEditor::UpdateSelectionCache()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
m_selectedComponentEditors.clear();
m_selectedComponentEditors.reserve(m_componentEditors.size());
for (auto componentEditor : m_componentEditors)
@@ -4070,7 +4070,7 @@ namespace AzToolsFramework
void EntityPropertyEditor::SaveComponentEditorState()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// SaveComponentEditorState can be called when adding or removing a
// component, the components list stored by the component editor
@@ -5584,14 +5584,14 @@ namespace AzToolsFramework
void EntityPropertyEditor::ConnectToEntityBuses(const AZ::EntityId& entityId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AzToolsFramework::EditorInspectorComponentNotificationBus::MultiHandler::BusConnect(entityId);
AzToolsFramework::PropertyEditorEntityChangeNotificationBus::MultiHandler::BusConnect(entityId);
}
void EntityPropertyEditor::DisconnectFromEntityBuses(const AZ::EntityId& entityId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AzToolsFramework::EditorInspectorComponentNotificationBus::MultiHandler::BusDisconnect(entityId);
AzToolsFramework::PropertyEditorEntityChangeNotificationBus::MultiHandler::BusDisconnect(entityId);
}
@@ -603,7 +603,7 @@ namespace AzToolsFramework
//-----------------------------------------------------------------------------
void InstanceDataHierarchy::Build(AZ::SerializeContext* sc, unsigned int accessFlags, DynamicEditDataProvider dynamicEditDataProvider, ComponentEditor* editorParent)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ_Assert(sc, "sc can't be NULL!");
AZ_Assert(m_rootInstances.size() > 0, "No root instances have been added to this hierarchy!");
@@ -761,7 +761,7 @@ namespace AzToolsFramework
//-----------------------------------------------------------------------------
void InstanceDataHierarchy::FixupEditData(InstanceDataNode* node, int siblingIdx)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
bool mergeElementEditData = node->m_classElement && node->m_classElement->m_editData && node->GetElementEditMetadata() != node->m_classElement->m_editData;
bool mergeContainerEditData = node->m_parent && node->m_parent->m_classData->m_container && node->m_parent->GetElementEditMetadata() && (node->m_classElement->m_flags & AZ::SerializeContext::ClassElement::FLG_POINTER) == 0;
@@ -915,7 +915,7 @@ namespace AzToolsFramework
//-----------------------------------------------------------------------------
bool InstanceDataHierarchy::BeginNode(void* ptr, const AZ::SerializeContext::ClassData* classData, const AZ::SerializeContext::ClassElement* classElement, DynamicEditDataProvider dynamicEditDataProvider)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
const AZ::Edit::ElementData* elementEditData = nullptr;
@@ -1140,7 +1140,7 @@ namespace AzToolsFramework
//-----------------------------------------------------------------------------
bool InstanceDataHierarchy::EndNode()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ_Assert(m_curParentNode, "EndEnum called without a matching BeginNode call!");
@@ -1177,7 +1177,7 @@ namespace AzToolsFramework
//-----------------------------------------------------------------------------
bool InstanceDataHierarchy::RefreshComparisonData(unsigned int accessFlags, DynamicEditDataProvider dynamicEditDataProvider)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (!m_root || m_comparisonInstances.empty())
{
@@ -1438,7 +1438,7 @@ namespace AzToolsFramework
RemovedNodeCB removedNodeCallback,
ChangedNodeCB changedNodeCallback)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
targetNode->m_comparisonNode = sourceNode;
@@ -1582,7 +1582,7 @@ namespace AzToolsFramework
ContainerChildNodeBeingCreatedCB containerChildNodeBeingCreatedCB,
const InstanceDataNode::Address& filterElementAddress)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (!context)
{
@@ -161,7 +161,7 @@ namespace AzToolsFramework
virtual void ReadValuesIntoGUI_Internal(QWidget* widget, InstanceDataNode* node) override
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
for (size_t i = 0; i < node->GetNumInstances(); ++i)
{
@@ -15,6 +15,7 @@
// A user is expected to derive from PropertyHandler<PropertyType, WidgetType>
// and implement that interface, then register it with the property manager.
#include <AzCore/Debug/Profiler.h>
#include <AzCore/RTTI/AttributeReader.h>
#include <AzCore/Serialization/EditContext.h>
#include <AzToolsFramework/UI/PropertyEditor/InstanceDataHierarchy.h>
@@ -257,7 +258,7 @@ namespace AzToolsFramework
virtual void ReadValuesIntoGUI_Internal(QWidget* widget, InstanceDataNode* node) override
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
WidgetType* wid = static_cast<WidgetType*>(widget);
@@ -98,7 +98,7 @@ namespace AzToolsFramework
//-----------------------------------------------------------------------------
NodeDisplayVisibility CalculateNodeDisplayVisibility(const InstanceDataNode& node, bool isSlicePushUI)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
NodeDisplayVisibility visibility = NodeDisplayVisibility::NotVisible;
@@ -458,7 +458,7 @@ namespace AzToolsFramework
void PropertyRowWidget::OnValuesUpdated()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (m_sourceNode)
{
@@ -1038,12 +1038,12 @@ namespace AzToolsFramework
void ReflectedPropertyEditor::InvalidateValues()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
m_releasePrompt = true;
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "ReflectedPropertyEditor::InvalidateValues:InstancesRefreshDataCompare");
AZ_PROFILE_SCOPE(AzToolsFramework, "ReflectedPropertyEditor::InvalidateValues:InstancesRefreshDataCompare");
for (InstanceDataHierarchy& instance : m_impl->m_instances)
{
const bool dataIdentical = instance.RefreshComparisonData(
@@ -1057,7 +1057,7 @@ namespace AzToolsFramework
}
{
AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "ReflectedPropertyEditor::InvalidateValues:RowWidgetGuiUpdate");
AZ_PROFILE_SCOPE(AzToolsFramework, "ReflectedPropertyEditor::InvalidateValues:RowWidgetGuiUpdate");
for (auto it = m_impl->m_userWidgetsToData.begin(); it != m_impl->m_userWidgetsToData.end(); ++it)
{
auto rowWidget = m_impl->m_widgets.find(it->second);
@@ -2294,7 +2294,7 @@ namespace AzToolsFramework
void ReflectedPropertyEditor::DoRefresh()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (m_impl->m_preventRefresh || (m_impl->m_queuedRefreshLevel == Refresh_None))
{
@@ -23,7 +23,7 @@ namespace AzToolsFramework
{
void EditorContextMenuUpdate(EditorContextMenu& contextMenu, const ViewportInteraction::MouseInteractionEvent& mouseInteraction)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// could potentially show the context menu
if (mouseInteraction.m_mouseInteraction.m_mouseButtons.Right() &&
@@ -22,7 +22,7 @@ namespace AzToolsFramework
void EditorBoxSelect::HandleMouseInteraction(
const ViewportInteraction::MouseInteractionEvent& mouseInteraction)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
m_cursorState.SetCurrentPosition(mouseInteraction.m_mouseInteraction.m_mousePick.m_screenCoordinates);
@@ -74,7 +74,7 @@ namespace AzToolsFramework
void EditorBoxSelect::Display2d(const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
m_cursorState.Update();
@@ -64,7 +64,7 @@ namespace AzToolsFramework
// note: this is mostly likely distance from the camera
static float GetIconScale(const float distSq)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
return s_iconMinScale +
(s_iconMaxScale - s_iconMinScale) *
@@ -74,7 +74,7 @@ namespace AzToolsFramework
static void DisplayComponents(
const AZ::EntityId entityId, const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
const AZ::Entity* entity = AZ::Interface<AZ::ComponentApplicationRequests>::Get()->FindEntity(entityId);
AzFramework::EntityDebugDisplayEventBus::Event(
@@ -114,7 +114,7 @@ namespace AzToolsFramework
AZ::EntityId EditorHelpers::HandleMouseInteraction(
const AzFramework::CameraState& cameraState, const ViewportInteraction::MouseInteractionEvent& mouseInteraction)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
const int viewportId = mouseInteraction.m_mouseInteraction.m_interactionId.m_viewportId;
@@ -185,7 +185,7 @@ namespace AzToolsFramework
AzFramework::DebugDisplayRequests& debugDisplay,
const AZStd::function<bool(AZ::EntityId)>& showIconCheck)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (HelpersVisible())
{
@@ -85,7 +85,7 @@ namespace AzToolsFramework
void EditorInteractionSystemComponent::DisplayViewport(
const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// calculate which entities are in the view and can be interacted with
// and cache that data to make iterating/looking it up much faster
@@ -37,7 +37,7 @@ namespace AzToolsFramework
static void HandleAccents(
const AZ::EntityId entityIdUnderCursor, AZ::EntityId& hoveredEntityId, const ViewportInteraction::MouseButtons mouseButtons)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
const bool invalidMouseButtonHeld = mouseButtons.Middle() || mouseButtons.Right();
@@ -50,7 +50,7 @@ namespace AzToolsFramework
AzFramework::ScreenPoint GetScreenPosition(const int viewportId, const AZ::Vector3& worldTranslation)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
auto screenPosition = AzFramework::ScreenPoint(0, 0);
ViewportInteraction::ViewportInteractionRequestBus::EventResult(
@@ -62,7 +62,7 @@ namespace AzToolsFramework
bool AabbIntersectMouseRay(const ViewportInteraction::MouseInteraction& mouseInteraction, const AZ::Aabb& aabb)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
const AZ::Vector3 rayScaledDir = mouseInteraction.m_mousePick.m_rayDirection * s_pickRayLength;
@@ -78,7 +78,7 @@ namespace AzToolsFramework
float& closestDistance,
const int viewportId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Entity);
AZ_PROFILE_FUNCTION(Entity);
bool entityPicked = false;
EditorComponentSelectionRequestsBus::EnumerateHandlersId(
@@ -276,7 +276,7 @@ namespace AzToolsFramework
static void DestroyManipulators(EntityIdManipulators& manipulators)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (manipulators.m_manipulators)
{
@@ -306,7 +306,7 @@ namespace AzToolsFramework
{
static_assert(AZStd::is_same<typename EntityIdContainer::value_type, AZ::EntityId>::value, "Container type is not an EntityId");
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
return AZStd::vector<AZ::EntityId>(entityIdContainer.begin(), entityIdContainer.end());
}
@@ -316,7 +316,7 @@ namespace AzToolsFramework
{
static_assert(AZStd::is_same<typename EntityIdMap::key_type, AZ::EntityId>::value, "Container key type is not an EntityId");
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZStd::vector<AZ::EntityId> entityIds;
entityIds.reserve(entityIdMap.size());
@@ -348,7 +348,7 @@ namespace AzToolsFramework
EntitySelectFuncType selectFunc2,
Compare outgoingCheck)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (boxSelect->contains(ViewportInteraction::QPointFromScreenPoint(screenPosition)))
{
@@ -385,7 +385,7 @@ namespace AzToolsFramework
const ViewportInteraction::KeyboardModifiers currentKeyboardModifiers,
const ViewportInteraction::KeyboardModifiers& previousKeyboardModifiers)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (boxSelect)
{
@@ -449,7 +449,7 @@ namespace AzToolsFramework
static void InitializeTranslationLookup(EntityIdManipulators& entityIdManipulators)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
for (auto& entityIdLookup : entityIdManipulators.m_lookups)
{
@@ -498,7 +498,7 @@ namespace AzToolsFramework
// return either center or entity pivot
static AZ::Vector3 CalculatePivotTranslation(const AZ::EntityId entityId, const EditorTransformComponentSelectionRequests::Pivot pivot)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ::Transform worldFromLocal = AZ::Transform::CreateIdentity();
AZ::TransformBus::EventResult(worldFromLocal, entityId, &AZ::TransformBus::Events::GetWorldTM);
@@ -539,7 +539,7 @@ namespace AzToolsFramework
{
PivotOrientationResult CalculatePivotOrientation(const AZ::EntityId entityId, const ReferenceFrame referenceFrame)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// initialize to world space, no parent
PivotOrientationResult result{ AZ::Quaternion::CreateIdentity(), AZ::EntityId() };
@@ -577,7 +577,7 @@ namespace AzToolsFramework
template<typename EntityIdMapIterator>
static ETCS::PivotOrientationResult CalculateParentSpace(EntityIdMapIterator begin, EntityIdMapIterator end)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// initialize to world with no parent
ETCS::PivotOrientationResult result{ AZ::Quaternion::CreateIdentity(), AZ::EntityId() };
@@ -629,7 +629,7 @@ namespace AzToolsFramework
{
static_assert(AZStd::is_same<typename EntityIdMap::key_type, AZ::EntityId>::value, "Container key type is not an EntityId");
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (!entityIdMap.empty())
{
@@ -656,7 +656,7 @@ namespace AzToolsFramework
{
static_assert(AZStd::is_same<typename EntityIdMap::key_type, AZ::EntityId>::value, "Container key type is not an EntityId");
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// simple case with one entity
if (entityIdMap.size() == 1)
@@ -689,7 +689,7 @@ namespace AzToolsFramework
AZStd::is_same<typename EntityIdMap::mapped_type, EntityIdManipulatorLookup>::value,
"Container value type is not an EntityIdManipulators::Lookup");
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// start - calculate orientation without considering current overrides/modifications
PivotOrientationResult pivot = CalculatePivotOrientationForEntityIds(entityIdMap, referenceFrame);
@@ -747,7 +747,7 @@ namespace AzToolsFramework
const OptionalFrame& pivotOverrideFrame,
const EditorTransformComponentSelectionRequests::Pivot pivot)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
return pivotOverrideFrame.m_translationOverride.value_or(CalculatePivotTranslationForEntityIds(entityIdMap, pivot));
}
@@ -756,7 +756,7 @@ namespace AzToolsFramework
static AZ::Quaternion RecalculateAverageManipulatorOrientation(
const EntityIdMap& entityIdMap, const OptionalFrame& pivotOverrideFrame, const ReferenceFrame referenceFrame)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
return ETCS::CalculateSelectionPivotOrientation(entityIdMap, pivotOverrideFrame, referenceFrame).m_worldOrientation;
}
@@ -768,7 +768,7 @@ namespace AzToolsFramework
const EditorTransformComponentSelectionRequests::Pivot pivot,
const ReferenceFrame referenceFrame)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// return final transform, if we have an override for translation use that, otherwise
// use centered translation of selection
@@ -825,7 +825,7 @@ namespace AzToolsFramework
bool& transformChangedInternally,
const AZStd::optional<ReferenceFrame> spaceLock)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
entityIdManipulators.m_manipulators->SetLocalPosition(action.LocalPosition());
@@ -914,7 +914,7 @@ namespace AzToolsFramework
const ViewportInteraction::MouseButtons mouseButtons,
const bool usingBoxSelect)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
const bool invalidMouseButtonHeld = mouseButtons.Middle() || mouseButtons.Right();
@@ -942,7 +942,7 @@ namespace AzToolsFramework
static AZ::Vector3 PickTerrainPosition(const ViewportInteraction::MouseInteraction& mouseInteraction)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
const int viewportId = mouseInteraction.m_interactionId.m_viewportId;
// get unsnapped terrain position (world space)
@@ -964,14 +964,14 @@ namespace AzToolsFramework
template<typename EntityIdContainer>
static bool IsEntitySelectedInternal(AZ::EntityId entityId, const EntityIdContainer& selectedEntityIds)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
const auto entityIdIt = selectedEntityIds.find(entityId);
return entityIdIt != selectedEntityIds.end();
}
static EntityIdTransformMap RecordTransformsBefore(const EntityIdList& entityIds)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// save initial transforms - this is necessary in cases where entities exist
// in a hierarchy. We want to make sure a parent transform does not affect
@@ -1202,7 +1202,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::BeginRecordManipulatorCommand()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// we must have an existing parent undo batch active when beginning to record
// a manipulator command
@@ -1219,7 +1219,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::EndRecordManipulatorCommand()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (m_manipulatorMoveCommand)
{
@@ -1245,7 +1245,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::CreateTranslationManipulators()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZStd::unique_ptr<TranslationManipulators> translationManipulators = AZStd::make_unique<TranslationManipulators>(
TranslationManipulators::Dimensions::Three, AZ::Transform::CreateIdentity(), AZ::Vector3::CreateOne());
@@ -1372,7 +1372,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::CreateRotationManipulators()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZStd::unique_ptr<RotationManipulators> rotationManipulators =
AZStd::make_unique<RotationManipulators>(AZ::Transform::CreateIdentity());
@@ -1542,7 +1542,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::CreateScaleManipulators()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZStd::unique_ptr<ScaleManipulators> scaleManipulators = AZStd::make_unique<ScaleManipulators>(AZ::Transform::CreateIdentity());
@@ -1680,7 +1680,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::DeselectEntities()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (!UndoRedoOperationInProgress())
{
@@ -1708,7 +1708,7 @@ namespace AzToolsFramework
bool EditorTransformComponentSelection::SelectDeselect(const AZ::EntityId entityIdUnderCursor)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (entityIdUnderCursor.IsValid())
{
@@ -1760,7 +1760,7 @@ namespace AzToolsFramework
bool EditorTransformComponentSelection::HandleMouseInteraction(const ViewportInteraction::MouseInteractionEvent& mouseInteraction)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
CheckDirtyEntityIds();
@@ -2024,7 +2024,7 @@ namespace AzToolsFramework
const QString& statusTip,
const T& callback)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
actions.emplace_back(AZStd::make_unique<QAction>(nullptr));
@@ -2080,11 +2080,11 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::RegisterActions()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
const auto lockUnlock = [this](const bool lock)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
ScopedUndoBatch undoBatch(s_lockSelectionUndoRedoDesc);
@@ -2122,7 +2122,7 @@ namespace AzToolsFramework
const auto showHide = [this](const bool show)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
ScopedUndoBatch undoBatch(s_hideSelectionUndoRedoDesc);
@@ -2163,7 +2163,7 @@ namespace AzToolsFramework
m_actions, { QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_L) }, UnlockAll, s_unlockAllTitle, s_unlockAllDesc,
[]()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
ScopedUndoBatch undoBatch(s_unlockAllUndoRedoDesc);
@@ -2180,7 +2180,7 @@ namespace AzToolsFramework
m_actions, { QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_H) }, ShowAll, s_showAllTitle, s_showAllDesc,
[]()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
ScopedUndoBatch undoBatch(s_showAllEntitiesUndoRedoDesc);
@@ -2197,7 +2197,7 @@ namespace AzToolsFramework
m_actions, { QKeySequence(Qt::CTRL + Qt::Key_A) }, SelectAll, s_selectAllTitle, s_selectAllDesc,
[this]()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
ScopedUndoBatch undoBatch(s_selectAllEntitiesUndoRedoDesc);
@@ -2237,7 +2237,7 @@ namespace AzToolsFramework
m_actions, { QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_I) }, InvertSelect, s_invertSelectionTitle, s_invertSelectionDesc,
[this]()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
ScopedUndoBatch undoBatch(s_invertSelectionUndoRedoDesc);
@@ -2284,7 +2284,7 @@ namespace AzToolsFramework
m_actions, { QKeySequence(Qt::CTRL + Qt::Key_D) }, DuplicateSelect, s_duplicateTitle, s_duplicateDesc,
[]()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// Clear Widget selection - Prevents issues caused by cloning entities while a property in the Reflected Property Editor
// is being edited.
@@ -2309,7 +2309,7 @@ namespace AzToolsFramework
m_actions, { QKeySequence(Qt::Key_Delete) }, DeleteSelect, s_deleteTitle, s_deleteDesc,
[this]()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
ScopedUndoBatch undoBatch(s_deleteUndoRedoDesc);
@@ -2419,7 +2419,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::UnregisterManipulator()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (m_entityIdManipulators.m_manipulators && m_entityIdManipulators.m_manipulators->Registered())
{
@@ -2429,7 +2429,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::RegisterManipulator()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (m_entityIdManipulators.m_manipulators && !m_entityIdManipulators.m_manipulators->Registered())
{
@@ -2439,7 +2439,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::CreateEntityIdManipulators()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (m_selectedEntityIds.empty())
{
@@ -2469,7 +2469,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::RegenerateManipulators()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// note: create/destroy pattern to be addressed
DestroyManipulators(m_entityIdManipulators);
@@ -2636,7 +2636,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::SnapSelectedEntitiesToWorldGrid(const float gridSize)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
const AZStd::array snapAxes = { AZ::Vector3::CreateAxisX(), AZ::Vector3::CreateAxisY(), AZ::Vector3::CreateAxisZ() };
@@ -2658,7 +2658,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::SetTransformMode(const Mode mode)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (mode == m_mode)
{
@@ -2725,7 +2725,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::AddEntityToSelection(const AZ::EntityId entityId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
m_selectedEntityIds.insert(entityId);
AZ::TransformNotificationBus::MultiHandler::BusConnect(entityId);
@@ -2733,7 +2733,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::RemoveEntityFromSelection(const AZ::EntityId entityId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
m_selectedEntityIds.erase(entityId);
AZ::TransformNotificationBus::MultiHandler::BusDisconnect(entityId);
@@ -2746,7 +2746,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::SetSelectedEntities(const EntityIdList& entityIds)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// we are responsible for updating the current selection
m_didSetSelectedEntities = true;
@@ -2755,7 +2755,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::RefreshManipulators(const RefreshType refreshType)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (m_entityIdManipulators.m_manipulators)
{
@@ -2793,7 +2793,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::OverrideManipulatorOrientation(const AZ::Quaternion& orientation)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
m_pivotOverrideFrame.m_orientationOverride = orientation;
@@ -2808,7 +2808,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::OverrideManipulatorTranslation(const AZ::Vector3& translation)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
m_pivotOverrideFrame.m_translationOverride = translation;
@@ -2821,7 +2821,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::ClearManipulatorTranslationOverride()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (m_entityIdManipulators.m_manipulators)
{
@@ -2847,7 +2847,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::ClearManipulatorOrientationOverride()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (m_entityIdManipulators.m_manipulators)
{
@@ -2875,7 +2875,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::ToggleCenterPivotSelection()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
m_pivotMode = TogglePivotMode(m_pivotMode);
RefreshManipulators(RefreshType::Translation);
}
@@ -2883,7 +2883,7 @@ namespace AzToolsFramework
template<typename EntityIdMap>
static bool ShouldUpdateEntityTransform(const AZ::EntityId entityId, const EntityIdMap& entityIdMap)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
static_assert(AZStd::is_same<typename EntityIdMap::key_type, AZ::EntityId>::value, "Container key type is not an EntityId");
@@ -2907,7 +2907,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::CopyTranslationToSelectedEntitiesGroup(const AZ::Vector3& translation)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (m_mode != Mode::Translation)
{
@@ -2963,7 +2963,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::CopyTranslationToSelectedEntitiesIndividual(const AZ::Vector3& translation)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (m_mode != Mode::Translation)
{
@@ -3008,7 +3008,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::CopyScaleToSelectedEntitiesIndividualWorld(float scale)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
ScopedUndoBatch undoBatch(s_dittoScaleIndividualWorldUndoRedoDesc);
@@ -3042,7 +3042,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::CopyScaleToSelectedEntitiesIndividualLocal(float scale)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
ScopedUndoBatch undoBatch(s_dittoScaleIndividualLocalUndoRedoDesc);
@@ -3061,7 +3061,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::CopyOrientationToSelectedEntitiesIndividual(const AZ::Quaternion& orientation)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (m_entityIdManipulators.m_manipulators)
{
@@ -3099,7 +3099,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::CopyOrientationToSelectedEntitiesGroup(const AZ::Quaternion& orientation)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (m_entityIdManipulators.m_manipulators)
{
@@ -3147,7 +3147,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::ResetOrientationForSelectedEntitiesLocal()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
ScopedUndoBatch undoBatch(s_resetOrientationToParentUndoRedoDesc);
for (const auto& entityIdLookup : m_entityIdManipulators.m_lookups)
@@ -3166,7 +3166,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::ResetTranslationForSelectedEntitiesLocal()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (m_entityIdManipulators.m_manipulators)
{
@@ -3236,7 +3236,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::AfterEntitySelectionChanged(
[[maybe_unused]] const EntityIdList& newlySelectedEntities, [[maybe_unused]] const EntityIdList& newlyDeselectedEntities)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// EditorTransformComponentSelection was not responsible for the change in selection
if (!m_didSetSelectedEntities)
@@ -3265,7 +3265,7 @@ namespace AzToolsFramework
const float axisLength,
const AzFramework::CameraState& cameraState)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
const int prevState = display.GetState();
@@ -3318,7 +3318,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::DisplayViewportSelection(
const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
CheckDirtyEntityIds();
@@ -3536,7 +3536,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::DisplayViewportSelection2d(
const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
DrawAxisGizmo(viewportInfo, debugDisplay);
@@ -3545,7 +3545,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::RefreshSelectedEntityIds()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// check what the 'authoritative' selected entity ids are after an undo/redo
EntityIdList selectedEntityIds;
@@ -3556,7 +3556,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::RefreshSelectedEntityIds(const EntityIdList& selectedEntityIds)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
AZ::TransformNotificationBus::MultiHandler::BusDisconnect();
for (const AZ::EntityId& entityId : selectedEntityIds)
@@ -3573,7 +3573,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::OnTransformChanged(
[[maybe_unused]] const AZ::Transform& localTM, [[maybe_unused]] const AZ::Transform& worldTM)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
if (!m_transformChangedInternally)
{
@@ -3583,7 +3583,7 @@ namespace AzToolsFramework
void EditorTransformComponentSelection::OnViewportViewEntityChanged(const AZ::EntityId& newViewId)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// if a viewport view entity has been set (e.g. we have set EditorCameraComponent to
// match the editor camera translation/orientation), record the entity id if we have
@@ -157,7 +157,7 @@ namespace AzToolsFramework
void EditorVisibleEntityDataCache::CalculateVisibleEntityDatas(const AzFramework::ViewportInfo& viewportInfo)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
// request list of visible entities from authoritative system
EntityIdList nextVisibleEntityIds;
@@ -288,7 +288,7 @@ namespace AzToolsFramework
void EditorVisibleEntityDataCache::OnEntityVisibilityChanged(const bool visibility)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
const AZ::EntityId entityId = *EditorEntityVisibilityNotificationBus::GetCurrentBusId();
@@ -300,7 +300,7 @@ namespace AzToolsFramework
void EditorVisibleEntityDataCache::OnEntityLockChanged(const bool locked)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
const AZ::EntityId entityId = *EditorEntityLockComponentNotificationBus::GetCurrentBusId();
@@ -312,7 +312,7 @@ namespace AzToolsFramework
void EditorVisibleEntityDataCache::OnTransformChanged(const AZ::Transform& /*local*/, const AZ::Transform& world)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
const AZ::EntityId entityId = *AZ::TransformNotificationBus::GetCurrentBusId();
@@ -324,7 +324,7 @@ namespace AzToolsFramework
void EditorVisibleEntityDataCache::OnAccentTypeChanged(const EntityAccentType accent)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
const AZ::EntityId entityId = *EditorComponentSelectionNotificationsBus::GetCurrentBusId();
@@ -336,7 +336,7 @@ namespace AzToolsFramework
void EditorVisibleEntityDataCache::OnSelected()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
const AZ::EntityId entityId = *EntitySelectionEvents::Bus::GetCurrentBusId();
@@ -348,7 +348,7 @@ namespace AzToolsFramework
void EditorVisibleEntityDataCache::OnDeselected()
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
const AZ::EntityId entityId = *EntitySelectionEvents::Bus::GetCurrentBusId();
@@ -360,7 +360,7 @@ namespace AzToolsFramework
void EditorVisibleEntityDataCache::OnEntityIconChanged(const AZ::Data::AssetId& /*entityIconAssetId*/)
{
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework);
AZ_PROFILE_FUNCTION(AzToolsFramework);
const AZ::EntityId entityId = *EditorEntityIconComponentNotificationBus::GetCurrentBusId();