Commit Graph

4 Commits

Author SHA1 Message Date
Joshua Deville
536f828b6c Fix wildcard array library functions (Array_Add, Array_RemoveItem, etc)
Real root cause, found after two incorrect attempts: ConnectBlueprintPins
always instantiated the generic UK2Node_CallFunction for every CallFunction
node, including wildcard array library functions like Array_Add and
Array_RemoveItem. Only UK2Node_CallArrayFunction (a UK2Node_CallFunction
subclass) overrides NotifyPinConnectionListChanged to resolve its wildcard
TargetArray/Item pins from the connected array's type -- the generic base
class has a no-op default, so no connection-notification of any kind could
ever have fixed it. This also explains why the ForEachLoop fix (a
MacroInstance, unrelated class hierarchy) worked while this didn't, despite
looking like the same "wildcard pin" symptom.

Debugging trail for the record: first tried NodeConnectionListChanged()
(wrong function, no args -- happened to be irrelevant to both bugs and
coincidentally look like it fixed ForEachLoop). Then tried adding
ReconstructNode() (no effect). Then matched the schema's actual
TryCreateConnection code exactly (PinConnectionListChanged(Pin) with the
specific pin) -- correct in general (this IS what fixes MacroInstance
wildcards, confirmed via UE_LOG marker showing the call executes), but
insufficient here because the node class itself was wrong.

Fix: check TargetFunc->HasMetaData(TEXT("ArrayParm")) (the same meta key
UK2Node_CallArrayFunction itself checks) and instantiate the correct class
before calling SetFromFunction(). Verified: Array_Add's TargetArray/NewItem
pins now show concrete "object/Actor" type instead of wildcard, and the
containing Blueprint compiles.
2026-07-08 22:49:16 -04:00
Joshua Deville
226a979d66 Fix hard crash in SpawnActor node creation
UK2Node_SpawnActorFromClass::PostPlacedNewNode() (engine source)
overrides the base class without calling Super::PostPlacedNewNode(),
and unconditionally dereferences GetScaleMethodPin() via
FindPinChecked -- but that pin is only created in
AllocateDefaultPins(), which FGraphNodeCreator::Finalize() always
calls *after* PostPlacedNewNode(). Result: a hard assertion failure
(EdGraphNode.h:586) that crashes the whole editor, every time,
regardless of any node_json parameters.

The real editor UI never hits this because it creates nodes through
a different path (node spawner templates) that doesn't have this
ordering problem. Our plugin uses the generic FGraphNodeCreator
pattern directly, so it does.

Fix: manually call SpawnNode->AllocateDefaultPins() before
Creator.Finalize(), so pins already exist by the time
PostPlacedNewNode() runs. Verified: SpawnActor node now creates
cleanly with all expected pins (Class, SpawnTransform, etc), editor
stayed stable and MCP connection alive afterward.

Rebuilt via Live Coding successfully this time (Ctrl+Alt+F11) --
the earlier UbaCli spawn failure appears to have been a one-off,
possibly from a conflicting concurrent Build.bat invocation.
2026-07-08 22:33:50 -04:00
Joshua Deville
8ac602168d 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).
2026-07-08 20:37:33 -04:00
Joshua Deville
496320cc8c Add empty test level and Unreal MCP tooling
- L_TestFlight: empty, zero-gravity level for Phase 0 flight testing,
  set as editor/game default map.
- Enable UnrealMCPython + Python Editor Script Plugin, third-party
  MCP plugin (GenOrca/unreal-mcp v2.2.0) giving direct editor control
  (actors, blueprints, levels, materials, etc.) alongside Epic's
  built-in Unreal MCP plugin.
- Vendor the mcp-server Python source used to bridge to the plugin.
- .mcp.json intentionally gitignored (machine-specific absolute paths).
2026-07-08 14:56:57 -04:00