Merge pull request #6517 from aws-lumberyard-dev/mbalfour/gitflow_211220_stabilization_2111RTE
Merge from stabilization/2111RTE
This commit is contained in:
@@ -150,7 +150,7 @@ namespace AZ
|
||||
{
|
||||
// Not using InsertTypeId here to avoid needing to create the temporary value and swap it in that call.
|
||||
node.AddMember(rapidjson::StringRef(JsonSerialization::TypeIdFieldIdentifier),
|
||||
StoreTypeName(classData, context), context.GetJsonAllocator());
|
||||
StoreTypeName(classData, classData.m_typeId, context), context.GetJsonAllocator());
|
||||
result = ResultCode(Tasks::WriteValue, Outcomes::Success);
|
||||
}
|
||||
return result.Combine(StoreClass(node, object, defaultObject, classData, context));
|
||||
@@ -531,7 +531,7 @@ namespace AZ
|
||||
return ResolvePointerResult::ContinueProcessing;
|
||||
}
|
||||
|
||||
rapidjson::Value JsonSerializer::StoreTypeName(const SerializeContext::ClassData& classData, JsonSerializerContext& context)
|
||||
rapidjson::Value JsonSerializer::StoreTypeName(const SerializeContext::ClassData& classData, const Uuid& typeId, JsonSerializerContext& context)
|
||||
{
|
||||
rapidjson::Value result;
|
||||
AZStd::vector<Uuid> ids = context.GetSerializeContext()->FindClassId(Crc32(classData.m_name));
|
||||
@@ -544,7 +544,7 @@ namespace AZ
|
||||
// Only write the Uuid for the class if there are multiple classes sharing the same name.
|
||||
// In this case it wouldn't be enough to determine which class needs to be used. The
|
||||
// class name is still added as a comment for be friendlier for users to read.
|
||||
AZStd::string fullName = classData.m_typeId.ToString<AZStd::string>();
|
||||
AZStd::string fullName = typeId.ToString<AZStd::string>();
|
||||
fullName += ' ';
|
||||
fullName += classData.m_name;
|
||||
result.SetString(fullName.c_str(), aznumeric_caster(fullName.size()), context.GetJsonAllocator());
|
||||
@@ -560,7 +560,7 @@ namespace AZ
|
||||
const SerializeContext::ClassData* data = context.GetSerializeContext()->FindClassData(typeId);
|
||||
if (data)
|
||||
{
|
||||
output = JsonSerializer::StoreTypeName(*data, context);
|
||||
output = JsonSerializer::StoreTypeName(*data, typeId, context);
|
||||
return context.Report(Tasks::WriteValue, Outcomes::Success, "Type id successfully stored to json value.");
|
||||
}
|
||||
else
|
||||
@@ -580,7 +580,7 @@ namespace AZ
|
||||
{
|
||||
rapidjson::Value insertedObject(rapidjson::kObjectType);
|
||||
insertedObject.AddMember(
|
||||
rapidjson::StringRef(JsonSerialization::TypeIdFieldIdentifier), StoreTypeName(classData, context),
|
||||
rapidjson::StringRef(JsonSerialization::TypeIdFieldIdentifier), StoreTypeName(classData, classData.m_typeId, context),
|
||||
context.GetJsonAllocator());
|
||||
|
||||
for (auto& element : output.GetObject())
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace AZ
|
||||
const void*& object, const void*& defaultObject, AZStd::any& defaultObjectStorage,
|
||||
const SerializeContext::ClassData*& elementClassData, const AZ::IRttiHelper& rtti, JsonSerializerContext& context);
|
||||
|
||||
static rapidjson::Value StoreTypeName(const SerializeContext::ClassData& classData, JsonSerializerContext& context);
|
||||
static rapidjson::Value StoreTypeName(const SerializeContext::ClassData& classData, const Uuid& typeId, JsonSerializerContext& context);
|
||||
static JsonSerializationResult::ResultCode StoreTypeName(rapidjson::Value& output,
|
||||
const Uuid& typeId, JsonSerializerContext& context);
|
||||
|
||||
|
||||
@@ -10,6 +10,77 @@
|
||||
#include <Tests/Serialization/Json/JsonSerializationTests.h>
|
||||
#include <Tests/Serialization/Json/TestCases_Classes.h>
|
||||
#include <Tests/Serialization/Json/TestCases_Pointers.h>
|
||||
#include <AzCore/Asset/AssetCommon.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
template<typename T>
|
||||
struct SerializeGenericTypeInfo<JsonSerializationTests::TemplatedClass<T>>
|
||||
{
|
||||
using ThisType = JsonSerializationTests::TemplatedClass<T>;
|
||||
|
||||
class GenericTemplatedClassInfo : public GenericClassInfo
|
||||
{
|
||||
public:
|
||||
GenericTemplatedClassInfo()
|
||||
: m_classData{ SerializeContext::ClassData::Create<ThisType>(
|
||||
"TemplatedClass", "{CA4ADF74-66E7-4D16-B4AC-F71278C60EC7}", nullptr, nullptr) }
|
||||
{
|
||||
}
|
||||
|
||||
SerializeContext::ClassData* GetClassData() override
|
||||
{
|
||||
return &m_classData;
|
||||
}
|
||||
|
||||
size_t GetNumTemplatedArguments() override
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
const Uuid& GetSpecializedTypeId() const override
|
||||
{
|
||||
return m_classData.m_typeId;
|
||||
}
|
||||
|
||||
const Uuid& GetGenericTypeId() const override
|
||||
{
|
||||
return m_classData.m_typeId;
|
||||
}
|
||||
|
||||
const Uuid& GetTemplatedTypeId(size_t element) override
|
||||
{
|
||||
(void)element;
|
||||
return SerializeGenericTypeInfo<T>::GetClassTypeId();
|
||||
}
|
||||
|
||||
void Reflect(SerializeContext* serializeContext) override
|
||||
{
|
||||
if (serializeContext)
|
||||
{
|
||||
serializeContext->RegisterGenericClassInfo(
|
||||
GetSpecializedTypeId(), this, &AZ::AnyTypeInfoConcept<Data::Asset<Data::AssetData>>::CreateAny);
|
||||
serializeContext->RegisterGenericClassInfo(
|
||||
azrtti_typeid<ThisType>(), this,
|
||||
&AZ::AnyTypeInfoConcept<ThisType>::CreateAny);
|
||||
}
|
||||
}
|
||||
|
||||
SerializeContext::ClassData m_classData;
|
||||
};
|
||||
|
||||
using ClassInfoType = GenericTemplatedClassInfo;
|
||||
static ClassInfoType* GetGenericInfo()
|
||||
{
|
||||
return GetCurrentSerializeContextModule().CreateGenericClassInfo<ThisType>();
|
||||
}
|
||||
|
||||
static const Uuid& GetClassTypeId()
|
||||
{
|
||||
return GetGenericInfo()->GetClassData()->m_typeId;
|
||||
}
|
||||
};
|
||||
} // namespace AZ
|
||||
|
||||
namespace JsonSerializationTests
|
||||
{
|
||||
@@ -286,4 +357,32 @@ namespace JsonSerializationTests
|
||||
EXPECT_EQ(Processing::Halted, result.GetProcessing());
|
||||
EXPECT_EQ(Outcomes::Unknown, result.GetOutcome());
|
||||
}
|
||||
|
||||
TEST_F(JsonSerializationTests, StoreTypeId_TemplatedType_StoresUuidWithName)
|
||||
{
|
||||
using namespace AZ;
|
||||
using namespace AZ::JsonSerializationResult;
|
||||
|
||||
m_serializeContext->RegisterGenericType<TemplatedClass<A::Inherited>>();
|
||||
m_serializeContext->RegisterGenericType<TemplatedClass<BaseClass>>();
|
||||
|
||||
Uuid input = azrtti_typeid<TemplatedClass<A::Inherited>>();
|
||||
ResultCode result = JsonSerialization::StoreTypeId(
|
||||
*m_jsonDocument, m_jsonDocument->GetAllocator(), input, AZStd::string_view{}, *m_serializationSettings);
|
||||
|
||||
EXPECT_EQ(Processing::Completed, result.GetProcessing());
|
||||
|
||||
AZStd::string expected =
|
||||
AZStd::string::format(R"("%s TemplatedClass")", azrtti_typeid<TemplatedClass<A::Inherited>>().ToString<AZStd::string>().c_str());
|
||||
Expect_DocStrEq(expected.c_str(), false);
|
||||
|
||||
input = azrtti_typeid<TemplatedClass<BaseClass>>();
|
||||
result = JsonSerialization::StoreTypeId(
|
||||
*m_jsonDocument, m_jsonDocument->GetAllocator(), input, AZStd::string_view{}, *m_serializationSettings);
|
||||
|
||||
expected =
|
||||
AZStd::string::format(R"("%s TemplatedClass")", azrtti_typeid<TemplatedClass<BaseClass>>().ToString<AZStd::string>().c_str());
|
||||
EXPECT_EQ(Processing::Completed, result.GetProcessing());
|
||||
Expect_DocStrEq(expected.c_str(), false);
|
||||
}
|
||||
} // namespace JsonSerializationTests
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace O3DE::ProjectManager
|
||||
QString targetBuildPath = QDir(m_projectInfo.m_path).filePath(ProjectBuildPathPostfix);
|
||||
|
||||
return AZ::Success(QStringList{ ProjectCMakeCommand,
|
||||
"-G", "Visual Studio 16 2019",
|
||||
"-B", targetBuildPath,
|
||||
"-S", m_projectInfo.m_path,
|
||||
QString("-DLY_3RDPARTY_PATH=").append(thirdPartyPath) } );
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace O3DE::ProjectManager
|
||||
if (vsWhereFile.exists() && vsWhereFile.isFile())
|
||||
{
|
||||
QStringList vsWhereBaseArguments = QStringList{"-version",
|
||||
"16.9.2",
|
||||
"[16.9.2,17)",
|
||||
"-latest",
|
||||
"-requires",
|
||||
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64"};
|
||||
@@ -106,10 +106,8 @@ namespace O3DE::ProjectManager
|
||||
}
|
||||
|
||||
return AZ::Failure(QObject::tr("Visual Studio 2019 version 16.9.2 or higher not found.<br><br>"
|
||||
"Visual Studio 2019 is required to build this project."
|
||||
" Install any edition of <a href='https://visualstudio.microsoft.com/downloads/'>Visual Studio 2019</a>"
|
||||
" or update to a newer version before proceeding to the next step."
|
||||
" While installing configure Visual Studio with these <a href='https://o3de.org/docs/welcome-guide/setup/requirements/#visual-studio-configuration'>workloads</a>."));
|
||||
"A compatible version of Visual Studio is required to build this project.<br>"
|
||||
"Refer to the <a href='https://o3de.org/docs/welcome-guide/requirements/#microsoft-visual-studio'>Visual Studio requirements</a> for more information."));
|
||||
}
|
||||
|
||||
AZ::Outcome<void, QString> OpenCMakeGUI(const QString& projectPath)
|
||||
|
||||
+11
-1
@@ -11,6 +11,9 @@
|
||||
#include <AzToolsFramework/API/ComponentEntityObjectBus.h>
|
||||
#include <AzToolsFramework/UI/PropertyEditor/PropertyEditorAPI.h>
|
||||
#include <AzCore/StringFunc/StringFunc.h>
|
||||
#include <Atom/RPI.Public/ViewportContextManager.h>
|
||||
#include <Atom/RPI.Public/RenderPipeline.h>
|
||||
#include <Atom/RPI.Public/Base.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
@@ -199,7 +202,14 @@ namespace AZ
|
||||
}
|
||||
|
||||
const char* LutAttachment = "LutOutput";
|
||||
const AZStd::vector<AZStd::string> LutGenerationPassHierarchy{ "LutGenerationPass" };
|
||||
auto renderPipelineName = AZ::Interface<AZ::RPI::ViewportContextRequestsInterface>::Get()
|
||||
->GetDefaultViewportContext()
|
||||
->GetCurrentPipeline()
|
||||
->GetId();
|
||||
const AZStd::vector<AZStd::string> LutGenerationPassHierarchy{
|
||||
renderPipelineName.GetCStr(),
|
||||
"LutGenerationPass"
|
||||
};
|
||||
|
||||
char resolvedOutputFilePath[AZ_MAX_PATH_LEN] = { 0 };
|
||||
AZ::IO::FileIOBase::GetDirectInstance()->ResolvePath(m_currentTiffFilePath.c_str(), resolvedOutputFilePath, AZ_MAX_PATH_LEN);
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace GraphCanvas
|
||||
|
||||
if (keyStr.empty())
|
||||
{
|
||||
AZ_Error("TranslationDatabase", false, "Every entry in the Translation data must have a key: %s", contextStr.c_str());
|
||||
AZ_Warning("TranslationDatabase", false, "Every entry in the Translation data must have a key: %s", baseKey.c_str());
|
||||
return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Unsupported, "Every entry in the Translation data must have a key");
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,6 @@ namespace ScriptCanvasBuilder
|
||||
}
|
||||
|
||||
// in terms of job creation, assert on anything but smooth sailing from this point
|
||||
|
||||
AZ_Assert(sourceGraph, "Graph component is missing from entity.");
|
||||
AZ_Assert(graphData, "GraphData is missing from entity");
|
||||
|
||||
|
||||
@@ -151,6 +151,7 @@
|
||||
#include <Editor/QtMetaTypes.h>
|
||||
#include <GraphCanvas/Components/SceneBus.h>
|
||||
|
||||
#include <Editor/LyViewPaneNames.h>
|
||||
|
||||
namespace ScriptCanvasEditor
|
||||
{
|
||||
|
||||
@@ -50,7 +50,6 @@
|
||||
#include <AzToolsFramework/API/EditorAssetSystemAPI.h>
|
||||
|
||||
#include <Editor/View/Widgets/AssetGraphSceneDataBus.h>
|
||||
|
||||
#include <Editor/View/Windows/Tools/UpgradeTool/Controller.h>
|
||||
#include <Editor/View/Windows/Tools/UpgradeTool/FileSaver.h>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user