diff --git a/Plugins/UnrealMCPython/Source/UnrealMCPython/Private/MCPythonHelper.cpp b/Plugins/UnrealMCPython/Source/UnrealMCPython/Private/MCPythonHelper.cpp index 5fbc42f..d08f410 100644 --- a/Plugins/UnrealMCPython/Source/UnrealMCPython/Private/MCPythonHelper.cpp +++ b/Plugins/UnrealMCPython/Source/UnrealMCPython/Private/MCPythonHelper.cpp @@ -645,6 +645,13 @@ static UEdGraphNode* CreateBPNodeFromJson(UEdGraph* Graph, UBlueprint* Blueprint UK2Node_SpawnActorFromClass* SpawnNode = Creator.CreateNode(false); SpawnNode->NodePosX = PosX; SpawnNode->NodePosY = PosY; + // Engine bug workaround: UK2Node_SpawnActorFromClass::PostPlacedNewNode() does not call + // Super::PostPlacedNewNode() and unconditionally dereferences GetScaleMethodPin() via + // FindPinChecked, but that pin is only created in AllocateDefaultPins(). FGraphNodeCreator:: + // Finalize() always calls PostPlacedNewNode() before AllocateDefaultPins(), so on this node + // type it hard-crashes (assert) unless pins already exist beforehand. The real editor UI + // avoids this node-creation path entirely; we can't, so pre-allocate pins ourselves. + SpawnNode->AllocateDefaultPins(); Creator.Finalize(); NewNode = SpawnNode; }