Merge branch 'development' into cmake/AddressSanitizer
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> # Conflicts: # Code/Legacy/CryCommon/LegacyAllocator.h
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
|
||||
#include <QPushButton>
|
||||
#include <QHBoxLayout>
|
||||
#include <QKeyEvent>
|
||||
|
||||
namespace O3DE::ProjectManager
|
||||
{
|
||||
@@ -27,4 +28,14 @@ namespace O3DE::ProjectManager
|
||||
: FormBrowseEditWidget(labelText, "", parent)
|
||||
{
|
||||
}
|
||||
|
||||
void FormBrowseEditWidget::keyPressEvent(QKeyEvent* event)
|
||||
{
|
||||
int key = event->key();
|
||||
if (key == Qt::Key_Return || key == Qt::Key_Enter)
|
||||
{
|
||||
HandleBrowseButton();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace O3DE::ProjectManager
|
||||
|
||||
@@ -24,6 +24,9 @@ namespace O3DE::ProjectManager
|
||||
explicit FormBrowseEditWidget(const QString& labelText = "", QWidget* parent = nullptr);
|
||||
~FormBrowseEditWidget() = default;
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent* event) override;
|
||||
|
||||
protected slots:
|
||||
virtual void HandleBrowseButton() = 0;
|
||||
};
|
||||
|
||||
@@ -34,7 +34,6 @@ namespace O3DE::ProjectManager
|
||||
{
|
||||
setText(directory);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void FormFolderBrowseEditWidget::setText(const QString& text)
|
||||
@@ -42,4 +41,5 @@ namespace O3DE::ProjectManager
|
||||
QString path = QDir::toNativeSeparators(text);
|
||||
FormBrowseEditWidget::setText(path);
|
||||
}
|
||||
|
||||
} // namespace O3DE::ProjectManager
|
||||
|
||||
@@ -9,6 +9,15 @@
|
||||
#include "DebugOutput.h"
|
||||
#include <AzCore/std/optional.h>
|
||||
|
||||
#include <AzCore/IO/SystemFile.h>
|
||||
#include <AzFramework/StringFunc/StringFunc.h>
|
||||
#include <SceneAPI/SceneCore/Containers/Scene.h>
|
||||
#include <SceneAPI/SceneCore/Containers/Views/PairIterator.h>
|
||||
#include <SceneAPI/SceneCore/Containers/Views/SceneGraphDownwardsIterator.h>
|
||||
#include <SceneAPI/SceneCore/DataTypes/IGraphObject.h>
|
||||
#include <SceneAPI/SceneCore/Events/ExportProductList.h>
|
||||
#include <SceneAPI/SceneCore/Utilities/Reporting.h>
|
||||
|
||||
namespace AZ::SceneAPI::Utilities
|
||||
{
|
||||
void DebugOutput::Write(const char* name, const char* data)
|
||||
@@ -118,4 +127,63 @@ namespace AZ::SceneAPI::Utilities
|
||||
{
|
||||
return m_output;
|
||||
}
|
||||
|
||||
void WriteAndLog(AZ::IO::SystemFile& dbgFile, const char* strToWrite)
|
||||
{
|
||||
AZ_TracePrintf(AZ::SceneAPI::Utilities::LogWindow, "%s", strToWrite);
|
||||
dbgFile.Write(strToWrite, strlen(strToWrite));
|
||||
dbgFile.Write("\n", strlen("\n"));
|
||||
}
|
||||
|
||||
void DebugOutput::BuildDebugSceneGraph(const char* outputFolder, AZ::SceneAPI::Events::ExportProductList& productList, const AZStd::shared_ptr<AZ::SceneAPI::Containers::Scene>& scene, AZStd::string productName)
|
||||
{
|
||||
const int debugSceneGraphVersion = 1;
|
||||
AZStd::string debugSceneFile;
|
||||
|
||||
AzFramework::StringFunc::Path::ConstructFull(outputFolder, productName.c_str(), debugSceneFile);
|
||||
AZ_TracePrintf(AZ::SceneAPI::Utilities::LogWindow, "outputFolder %s, name %s.\n", outputFolder, productName.c_str());
|
||||
|
||||
AZ::IO::SystemFile dbgFile;
|
||||
if (dbgFile.Open(debugSceneFile.c_str(), AZ::IO::SystemFile::SF_OPEN_CREATE | AZ::IO::SystemFile::SF_OPEN_WRITE_ONLY))
|
||||
{
|
||||
WriteAndLog(dbgFile, AZStd::string::format("ProductName: %s", productName.c_str()).c_str());
|
||||
WriteAndLog(dbgFile, AZStd::string::format("debugSceneGraphVersion: %d", debugSceneGraphVersion).c_str());
|
||||
WriteAndLog(dbgFile, scene->GetName().c_str());
|
||||
|
||||
const AZ::SceneAPI::Containers::SceneGraph& sceneGraph = scene->GetGraph();
|
||||
auto names = sceneGraph.GetNameStorage();
|
||||
auto content = sceneGraph.GetContentStorage();
|
||||
auto pairView = AZ::SceneAPI::Containers::Views::MakePairView(names, content);
|
||||
auto view = AZ::SceneAPI::Containers::Views::MakeSceneGraphDownwardsView<
|
||||
AZ::SceneAPI::Containers::Views::BreadthFirst>(
|
||||
sceneGraph, sceneGraph.GetRoot(), pairView.cbegin(), true);
|
||||
|
||||
for (auto&& viewIt : view)
|
||||
{
|
||||
if (viewIt.second == nullptr)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
AZ::SceneAPI::DataTypes::IGraphObject* graphObject = const_cast<AZ::SceneAPI::DataTypes::IGraphObject*>(viewIt.second.get());
|
||||
|
||||
WriteAndLog(dbgFile, AZStd::string::format("Node Name: %s", viewIt.first.GetName()).c_str());
|
||||
WriteAndLog(dbgFile, AZStd::string::format("Node Path: %s", viewIt.first.GetPath()).c_str());
|
||||
WriteAndLog(dbgFile, AZStd::string::format("Node Type: %s", graphObject->RTTI_GetTypeName()).c_str());
|
||||
|
||||
AZ::SceneAPI::Utilities::DebugOutput debugOutput;
|
||||
viewIt.second->GetDebugOutput(debugOutput);
|
||||
|
||||
if (!debugOutput.GetOutput().empty())
|
||||
{
|
||||
WriteAndLog(dbgFile, debugOutput.GetOutput().c_str());
|
||||
}
|
||||
}
|
||||
dbgFile.Close();
|
||||
|
||||
static const AZ::Data::AssetType dbgSceneGraphAssetType("{07F289D1-4DC7-4C40-94B4-0A53BBCB9F0B}");
|
||||
productList.AddProduct(productName, AZ::Uuid::CreateName(productName.c_str()), dbgSceneGraphAssetType,
|
||||
AZStd::nullopt, AZStd::nullopt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,22 @@
|
||||
#include <AzCore/std/optional.h>
|
||||
#include <cinttypes>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
namespace SceneAPI
|
||||
{
|
||||
namespace Containers
|
||||
{
|
||||
class Scene;
|
||||
}
|
||||
namespace Events
|
||||
{
|
||||
struct ExportProduct;
|
||||
class ExportProductList;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace AZ::SceneAPI::Utilities
|
||||
{
|
||||
class DebugOutput
|
||||
@@ -42,6 +58,8 @@ namespace AZ::SceneAPI::Utilities
|
||||
|
||||
SCENE_CORE_API const AZStd::string& GetOutput() const;
|
||||
|
||||
SCENE_CORE_API static void BuildDebugSceneGraph(const char* outputFolder, AZ::SceneAPI::Events::ExportProductList& productList, const AZStd::shared_ptr<AZ::SceneAPI::Containers::Scene>& scene, AZStd::string productName);
|
||||
|
||||
protected:
|
||||
AZStd::string m_output;
|
||||
};
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace AZ
|
||||
|
||||
void ManifestWidget::BuildFromScene(const AZStd::shared_ptr<Containers::Scene>& scene)
|
||||
{
|
||||
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor);
|
||||
AZ_PROFILE_FUNCTION(Editor);
|
||||
ui->m_tabs->clear();
|
||||
m_pages.clear();
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace AZ
|
||||
|
||||
bool ManifestWidget::AddObject(const AZStd::shared_ptr<DataTypes::IManifestObject>& object)
|
||||
{
|
||||
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor);
|
||||
AZ_PROFILE_FUNCTION(Editor);
|
||||
for (ManifestWidgetPage* page : m_pages)
|
||||
{
|
||||
if (page->SupportsType(object))
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace AZ
|
||||
|
||||
bool ManifestWidgetPage::AddObject(const AZStd::shared_ptr<DataTypes::IManifestObject>& object)
|
||||
{
|
||||
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor);
|
||||
AZ_PROFILE_FUNCTION(Editor);
|
||||
if (!SupportsType(object))
|
||||
{
|
||||
return false;
|
||||
@@ -218,7 +218,7 @@ namespace AZ
|
||||
|
||||
void ManifestWidgetPage::RefreshPage()
|
||||
{
|
||||
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Editor);
|
||||
AZ_PROFILE_FUNCTION(Editor);
|
||||
m_propertyEditor->InvalidateAll();
|
||||
m_propertyEditor->ExpandAll();
|
||||
}
|
||||
|
||||
@@ -231,14 +231,14 @@ namespace AreaChart
|
||||
|
||||
void AreaChart::AddPoint(size_t seriesId, int position, unsigned int value)
|
||||
{
|
||||
AZ_PROFILE_TIMER("Standalone Tools", __FUNCTION__);
|
||||
AZ_PROFILE_FUNCTION(AzToolsFramework);
|
||||
LinePoint linePoint(position,value);
|
||||
AddPoint(seriesId,linePoint);
|
||||
}
|
||||
|
||||
void AreaChart::AddPoint(size_t seriesId, const LinePoint& linePoint)
|
||||
{
|
||||
AZ_PROFILE_TIMER("Standalone Tools", __FUNCTION__);
|
||||
AZ_PROFILE_FUNCTION(AzToolsFramework);
|
||||
if (!IsValidSeriesId(seriesId))
|
||||
{
|
||||
AZ_Error("AreaChart", false, "Invalid SeriesId given.");
|
||||
@@ -419,7 +419,7 @@ namespace AreaChart
|
||||
|
||||
void AreaChart::paintEvent(QPaintEvent* event)
|
||||
{
|
||||
AZ_PROFILE_TIMER("Standalone Tools", __FUNCTION__);
|
||||
AZ_PROFILE_FUNCTION(AzToolsFramework);
|
||||
(void)event;
|
||||
|
||||
if (m_sizingDirty)
|
||||
@@ -435,7 +435,7 @@ namespace AreaChart
|
||||
|
||||
if (m_regenGraph)
|
||||
{
|
||||
AZ_PROFILE_TIMER("Standalone Tools", "Generating Graph Data");
|
||||
AZ_PROFILE_FUNCTION(AzToolsFramework);
|
||||
m_regenGraph = false;
|
||||
|
||||
if (m_verticalAxis)
|
||||
|
||||
@@ -203,7 +203,7 @@ namespace Driller
|
||||
|
||||
void RedrawGraph()
|
||||
{
|
||||
AZ_PROFILE_TIMER("Standalone Tools", __FUNCTION__);
|
||||
AZ_PROFILE_FUNCTION(AzToolsFramework);
|
||||
switch (m_displayMode)
|
||||
{
|
||||
case DisplayMode::Active:
|
||||
@@ -518,7 +518,7 @@ namespace Driller
|
||||
|
||||
void RefreshView(FrameNumberType frameId)
|
||||
{
|
||||
AZ_PROFILE_TIMER("Standalone Tools", __FUNCTION__);
|
||||
AZ_PROFILE_FUNCTION(AzToolsFramework);
|
||||
AZStd::unordered_set< Key > discoveredSet;
|
||||
|
||||
m_tableViewOrdering.clear();
|
||||
|
||||
@@ -1628,7 +1628,7 @@ namespace Driller
|
||||
|
||||
void ReplicaDataView::ParseFrameData(FrameNumberType frameId)
|
||||
{
|
||||
AZ_PROFILE_TIMER("Standalone Tools", __FUNCTION__);
|
||||
AZ_PROFILE_FUNCTION(AzToolsFramework);
|
||||
if (frameId < 0 || frameId >= m_aggregator->GetFrameCount() || m_parsedFrames.find(frameId) != m_parsedFrames.end())
|
||||
{
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user