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

# Conflicts:
#	Source/Engine/Graphics/Materials/MaterialShader.h
This commit is contained in:
Wojtek Figat
2025-02-18 09:19:59 +01:00
133 changed files with 2253 additions and 654 deletions

View File

@@ -20,6 +20,7 @@
#include "Engine/Profiler/ProfilerCPU.h"
#include "Engine/Utilities/StringConverter.h"
#include "Engine/Threading/MainThreadTask.h"
#include "Engine/Level/SceneObject.h"
#include "FlaxEngine.Gen.h"
namespace
@@ -41,6 +42,22 @@ namespace
Log::Logger::Write(type, stack);
Log::Logger::Write(type, TEXT(""));
}
bool SerializeValue(const Variant& a, const Variant& b)
{
bool result = a != b;
if (result)
{
// Special case for scene objects to handle prefab object references
auto* aSceneObject = ScriptingObject::Cast<SceneObject>((ScriptingObject*)a);
auto* bSceneObject = ScriptingObject::Cast<SceneObject>((ScriptingObject*)b);
if (aSceneObject && bSceneObject)
{
result = Serialization::ShouldSerialize(aSceneObject, bSceneObject);
}
}
return result;
}
}
#if VISUAL_SCRIPT_DEBUGGING
@@ -1978,7 +1995,7 @@ void VisualScriptingBinaryModule::SerializeObject(JsonWriter& stream, ScriptingO
auto& param = asset->Graph.Parameters[paramIndex];
auto& value = params[paramIndex];
auto& otherValue = otherParams->Value.Params[paramIndex];
if (value != otherValue)
if (SerializeValue(value, otherValue))
{
param.Identifier.ToString(idName, Guid::FormatType::N);
stream.Key(idName, 32);
@@ -1993,7 +2010,7 @@ void VisualScriptingBinaryModule::SerializeObject(JsonWriter& stream, ScriptingO
auto& param = asset->Graph.Parameters[paramIndex];
auto& value = params[paramIndex];
auto& otherValue = param.Value;
if (value != otherValue)
if (SerializeValue(value, otherValue))
{
param.Identifier.ToString(idName, Guid::FormatType::N);
stream.Key(idName, 32);