Add versioning updates for prefab conversion, and PR clean up & nitpicks

Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com>
This commit is contained in:
chcurran
2021-06-29 17:25:23 -07:00
parent fb448124e2
commit 355776d3a9
7 changed files with 111 additions and 45 deletions
@@ -209,7 +209,7 @@ namespace DatumHelpers
}
else if (typeID == azrtti_typeid<AZ::Vector2>())
{
target = BehaviorContextObject::Create<AZ::Vector2>(AZ::Vector2(static_cast<float>(sourceVector.GetX()), static_cast<float>(sourceVector.GetY())), behaviorClass);
target = BehaviorContextObject::Create<AZ::Vector2>(AZ::Vector2((sourceVector.GetX()), (sourceVector.GetY())), behaviorClass);
}
else if (typeID == azrtti_typeid<AZ::Vector4>())
{
@@ -264,7 +264,7 @@ namespace DatumHelpers
}
else if (typeID == azrtti_typeid<AZ::Vector2>())
{
target = BehaviorContextObject::Create<AZ::Vector2>(AZ::Vector2(static_cast<float>(sourceVector.GetX()), static_cast<float>(sourceVector.GetY())), behaviorClass);
target = BehaviorContextObject::Create<AZ::Vector2>(AZ::Vector2((sourceVector.GetX()), (sourceVector.GetY())), behaviorClass);
}
else if (typeID == azrtti_typeid<AZ::Vector4>())
{
@@ -2478,7 +2478,7 @@ namespace ScriptCanvas
AZStd::string Datum::ToStringColor(const Data::ColorType& c) const
{
return AZStd::string::format("(r=%.7f,g=%.7f,b=%.7f,a=%.7f)", static_cast<float>(c.GetR()), static_cast<float>(c.GetG()), static_cast<float>(c.GetB()), static_cast<float>(c.GetA()));
return AZStd::string::format("(r=%.7f,g=%.7f,b=%.7f,a=%.7f)", (c.GetR()), (c.GetG()), (c.GetB()), (c.GetA()));
}
bool Datum::ToStringBehaviorClassObject(Data::StringType& stringOut) const
@@ -2555,9 +2555,9 @@ namespace ScriptCanvas
AZ::Vector3 eulerRotation = AZ::ConvertTransformToEulerDegrees(AZ::Transform::CreateFromQuaternion(source));
return AZStd::string::format
("(Pitch: %5.2f, Roll: %5.2f, Yaw: %5.2f)"
, static_cast<float>(eulerRotation.GetX())
, static_cast<float>(eulerRotation.GetY())
, static_cast<float>(eulerRotation.GetZ()));
, (eulerRotation.GetX())
, (eulerRotation.GetY())
, (eulerRotation.GetZ()));
}
AZStd::string Datum::ToStringTransform(const Data::TransformType& source) const
@@ -2570,8 +2570,8 @@ namespace ScriptCanvas
("(Position: X: %f, Y: %f, Z: %f,"
" Rotation: X: %f, Y: %f, Z: %f,"
" Scale: %f)"
, static_cast<float>(pos.GetX()), static_cast<float>(pos.GetY()), static_cast<float>(pos.GetZ())
, static_cast<float>(rotation.GetX()), static_cast<float>(rotation.GetY()), static_cast<float>(rotation.GetZ())
, (pos.GetX()), (pos.GetY()), (pos.GetZ())
, (rotation.GetX()), (rotation.GetY()), (rotation.GetZ())
, scale);
}
@@ -2587,19 +2587,19 @@ namespace ScriptCanvas
{
return AZStd::string::format
("(X: %f, Y: %f, Z: %f)"
, static_cast<float>(source.GetX())
, static_cast<float>(source.GetY())
, static_cast<float>(source.GetZ()));
, (source.GetX())
, (source.GetY())
, (source.GetZ()));
}
AZStd::string Datum::ToStringVector4(const AZ::Vector4& source) const
{
return AZStd::string::format
("(X: %f, Y: %f, Z: %f, W: %f)"
, static_cast<float>(source.GetX())
, static_cast<float>(source.GetY())
, static_cast<float>(source.GetZ())
, static_cast<float>(source.GetW()));
, (source.GetX())
, (source.GetY())
, (source.GetZ())
, (source.GetW()));
}
AZ::Outcome<void, AZStd::string> Datum::CallBehaviorContextMethod(const AZ::BehaviorMethod* method, AZ::BehaviorValueParameter* params, unsigned int numExpectedArgs)
@@ -1226,8 +1226,8 @@ namespace ScriptCanvas
(nodeling->GetEntityId()
, nullptr
, AZStd::string::format
("%s is the name of multiple In Nodelings in a subgraph,\n"
"this will result in a difficult or impossible to use Function Node when used in another graph", displayName.data()));
( "%s is the name of multiple In Nodelings in a subgraph,\n"
"this will result in a difficult or impossible to use Function Node when used in another graph", displayName.c_str()));
return;
}
else
@@ -1355,8 +1355,8 @@ namespace ScriptCanvas
if (ExecutionContainsCycles(node, outSlot))
{
AddError(nullptr, aznew Internal::ParseError(node.GetEntityId(), AZStd::string::format
("Execution cycle detected (see connections to %s-%s. Use a looping node like While or For"
, node.GetDebugName().data(), outSlot.GetName().data()).data()));
( "Execution cycle detected (see connections to %s-%s. Use a looping node like While or For"
, node.GetDebugName().c_str(), outSlot.GetName().c_str()).c_str()));
return true;
}
@@ -5,10 +5,9 @@
*
*/
#include "ScriptUserDataSerializer.h"
#include <AzCore/Serialization/Json/JsonSerialization.h>
#include <ScriptCanvas/Asset/RuntimeAsset.h>
#include <ScriptCanvas/Serialization/ScriptUserDataSerializer.h>
using namespace ScriptCanvas;
@@ -31,10 +30,10 @@ namespace AZ
JsonSerializationResult::ResultCode result(JSR::Tasks::ReadField);
AZ::Uuid typeId = AZ::Uuid::CreateNull();
auto typeIdMember = inputValue.FindMember("$type");
auto typeIdMember = inputValue.FindMember(JsonSerialization::TypeIdFieldIdentifier);
if (typeIdMember == inputValue.MemberEnd())
{
return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Catastrophic, "ScriptUserDataSerializer::Load failed to load the $type member");
return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Catastrophic, AZStd::string::format("ScriptUserDataSerializer::Load failed to load the %s member", JsonSerialization::TypeIdFieldIdentifier).c_str());
}
result.Combine(LoadTypeId(typeId, typeIdMember->value, context));
@@ -46,13 +45,13 @@ namespace AZ
outputVariable->value = context.GetSerializeContext()->CreateAny(typeId);
if (outputVariable->value.empty() || outputVariable->value.type() != typeId)
{
return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Catastrophic, "ScriptUserDataSerializer::Load failed to load a value matched the reported AZ TypeId. The C++ declaration may have been deleted or changed.");
return context.Report(JSR::Tasks::ReadField, JSR::Outcomes::Unknown, "ScriptUserDataSerializer::Load failed to load a value matched the reported AZ TypeId. The C++ declaration may have been deleted or changed.");
}
result.Combine(ContinueLoadingFromJsonObjectField(AZStd::any_cast<void>(&outputVariable->value), typeId, inputValue, "value", context));
return context.Report(result, result.GetProcessing() != JSR::Processing::Halted
? "ScriptUserDataSerializer Store finished loading RuntimeVariable"
: "ScriptUserDataSerializer Store failed to load RuntimeVariable");
? "ScriptUserDataSerializer Load finished loading RuntimeVariable"
: "ScriptUserDataSerializer Load failed to load RuntimeVariable");
}
JsonSerializationResult::Result ScriptUserDataSerializer::Store
@@ -91,7 +90,7 @@ namespace AZ
rapidjson::Value typeValue;
typeValue.SetString(azTypeString.begin(), azTypeString.length(), context.GetJsonAllocator());
result.Combine(StoreTypeId(typeValue, inputAnyPtr->type(), context));
outputValue.AddMember("$type", typeValue, context.GetJsonAllocator());
outputValue.AddMember("$type", AZStd::move(typeValue), context.GetJsonAllocator());
}
result.Combine(ContinueStoringToJsonObjectField(outputValue, "value", AZStd::any_cast<void>(inputAnyPtr), AZStd::any_cast<void>(defaultAnyPtr), inputAnyPtr->type(), context));
@@ -101,4 +100,4 @@ namespace AZ
: "ScriptUserDataSerializer Store failed to save RuntimeVariable");
}
}
}
@@ -102,6 +102,9 @@ namespace ScriptCanvas
classElement.RemoveElementByName(AZ_CRC_CE("Scope"));
classElement.AddElementWithData<VariableFlags::InitialValueSource>(context, "InitialValueSource", VariableFlags::InitialValueSource::Component);
}
classElement.RemoveElementByName(AZ_CRC("ExposeAsInput", 0x0f7879f0));
classElement.RemoveElementByName(AZ_CRC("Exposure", 0x398f29cd));
}
else
if (classElement.GetVersion() < 3)