From 8ac602168de027f3aa3ed28c0c9ca9c3ae805e76 Mon Sep 17 00:00:00 2001 From: Joshua Deville Date: Wed, 8 Jul 2026 20:37:33 -0400 Subject: [PATCH] Fix wildcard pin resolution in UnrealMCPython's ConnectBlueprintPins ConnectBlueprintPins called SourcePin->MakeLinkTo(TargetPin) but never notified either node of the new connection, so wildcard-typed pins (MacroInstance nodes like ForEachLoop, and by extension any wildcard array/map library call) never resolved their type -- compilation failed with "type ... is undetermined" regardless of how many times you recompiled. The real graph editor triggers this via the schema's TryCreateConnection; MakeLinkTo alone doesn't. Fix: call NodeConnectionListChanged() on both nodes after linking, matching what the schema does. Verified against the exact ForEachLoop scenario that failed twice before the fix -- the Array pin now resolves to a concrete type and the graph compiles. Rebuilt via full offline Build.bat (UnrealEditor target) rather than Live Coding -- Live Coding's patch-link step hit a persistent "Could not spawn process UbaCli.exe (Error 267)" in this environment, unrelated to the code change itself (the .cpp compiled cleanly both times; only the hot-patch link step failed). --- .../Source/UnrealMCPython/Private/MCPythonHelper.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Plugins/UnrealMCPython/Source/UnrealMCPython/Private/MCPythonHelper.cpp b/Plugins/UnrealMCPython/Source/UnrealMCPython/Private/MCPythonHelper.cpp index faccbd4..5fbc42f 100644 --- a/Plugins/UnrealMCPython/Source/UnrealMCPython/Private/MCPythonHelper.cpp +++ b/Plugins/UnrealMCPython/Source/UnrealMCPython/Private/MCPythonHelper.cpp @@ -783,6 +783,13 @@ FString UMCPythonHelper::ConnectBlueprintPins(UBlueprint* Blueprint, const FStri SourcePin->MakeLinkTo(TargetPin); + // Notify both nodes so wildcard pins (e.g. MacroInstance nodes like ForEachLoop, or + // wildcard array library calls) can resolve their type from the new connection. The + // real graph editor does this via the schema's TryCreateConnection; MakeLinkTo alone + // doesn't trigger it, so wildcard-typed pins were silently left unresolved. + SourceNode->NodeConnectionListChanged(); + TargetNode->NodeConnectionListChanged(); + FBlueprintEditorUtils::MarkBlueprintAsModified(Blueprint); return MakeJsonSuccess(FString::Printf(TEXT("Connected %s.%s -> %s.%s"), *SourceNodeName, *SourcePinName, *TargetNodeName, *TargetPinName));