Merge remote-tracking branch 'origin/master' into 1.12

# Conflicts:
#	Content/Editor/MaterialTemplates/Deformable.shader
#	Flax.flaxproj
#	Source/Engine/Content/Content.h
#	Source/Engine/Serialization/JsonTools.cpp
This commit is contained in:
Wojtek Figat
2026-04-01 17:14:21 +02:00
115 changed files with 2933 additions and 1074 deletions

View File

@@ -72,6 +72,13 @@ void ChangeIds(rapidjson_flax::Value& obj, rapidjson_flax::Document& document, c
}
}
void JsonTools::MergeObjects(Value& target, Value& source, Value::AllocatorType& allocator)
{
ASSERT(target.IsObject() && source.IsObject());
for (auto itr = source.MemberBegin(); itr != source.MemberEnd(); ++itr)
target.AddMember(itr->name, itr->value, allocator);
}
void JsonTools::ChangeIds(Document& doc, const Dictionary<Guid, Guid>& mapping)
{
if (mapping.IsEmpty())
@@ -235,6 +242,14 @@ Plane JsonTools::GetPlane(const Value& value)
return result;
}
Rectangle JsonTools::GetRectangle(const Value& value)
{
return Rectangle(
GetVector2(value, "Location", Vector2::Zero),
GetVector2(value, "Size", Vector2::Zero)
);
}
BoundingSphere JsonTools::GetBoundingSphere(const Value& value)
{
BoundingSphere result;
@@ -283,3 +298,14 @@ DateTime JsonTools::GetDateTime(const Value& value)
{
return DateTime(value.GetInt64());
}
bool JsonTools::GetGuidIfValid(Guid& result, const Value& node, const char* name)
{
auto member = node.FindMember(name);
if (member != node.MemberEnd())
{
result = GetGuid(member->value);
return result.IsValid();
}
return false;
}