From 64cd898a659c103c76e964b0f596eeb6cdc1ff3a Mon Sep 17 00:00:00 2001 From: Alex Ray Date: Thu, 27 Nov 2025 18:09:11 +0100 Subject: [PATCH] Bypassing Call Logic in Editor Preview --- .../MaterialGenerator.Material.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Source/Engine/Tools/MaterialGenerator/MaterialGenerator.Material.cpp b/Source/Engine/Tools/MaterialGenerator/MaterialGenerator.Material.cpp index c778c03ee..bdade721e 100644 --- a/Source/Engine/Tools/MaterialGenerator/MaterialGenerator.Material.cpp +++ b/Source/Engine/Tools/MaterialGenerator/MaterialGenerator.Material.cpp @@ -790,9 +790,21 @@ void MaterialGenerator::ProcessGroupFunction(Box* box, Node* node, Value& value) // Function Input case 1: { + // Check the stack count.If only 1 graph is present, + // we are processing the graph in isolation (e.g., in the Editor Preview). + // In this case, we skip the caller-finding logic and use the node's default value. + if (_graphStack.Count() < 2) + { + // Use the default value from the function input node's box (usually box 1) + value = tryGetValue(node->TryGetBox(1), Value::Zero); + break; + } + // Find the function call Node* functionCallNode = nullptr; - ASSERT(_graphStack.Count() >= 2); + + // The original ASSERT has been effectively replaced by the 'if' above. + //ASSERT(_graphStack.Count() >= 2); Graph* graph; for (int32 i = _callStack.Count() - 1; i >= 0; i--) {