Crash when trying to undo in custom editor

Hey guys,

I’m currently implementing my custom node editor as a plugin for UE 4.13.

I just ran into a problem, that when I try to undo something in my Editor the Engine crashes.
The only occurs when the undo action deletes nodes in my graph. Undoing Pin Connections etc. are no problem.

The mainly occurs in this function:
SGraphPin Line 752:

FText SGraphPin::GetPinLabel() const
{
	if (UEdGraphNode* GraphNode = GetPinObj()->GetOwningNodeUnchecked())
	{
		return GraphNode->GetPinDisplayName(GetPinObj());
	}
	return FText::GetEmpty();
}

I hope you can help me :slight_smile:

Greetings

Hello ,

Are you able to reproduce this issue in a base version of the editor? If not, this could be dependent on the changes you’ve made and not a bug with the engine. Also, can you please provide the Callstack that appears whenever you as well as the logs from the project?

Hello Matthew,
thanks for the reply.
I put the transaction in again, and everything works (almost) fine.
The problem seemed to be my custom PinFactory, which I created. I deleted it now and let my NodeWidget “spawn” the pins.

But now my Graph behaves like this:
I spawn a Node, which automatically spawn 4 new Child Nodes.
Before creating these Child Nodes I begin the Transaction
After creating and placing them I end the Transaction

When I undo everything works fine and the 4 Nodes will be deleted.
But when I redo the Nodes wont be created again. and the Pins of the parent Node will be marked as connected.

Do you know a solution to this?

Ok the Node actually will be created again, but the Graph doesnt refresh itself when pressing Ctrl+Z or Ctrl+Y.
In other Editors this is defaultly implemented.
I call Modify on:
Graph, affected Nodes, affected Pins, Asset (Which the Graph belongs to)

Ok I finally made it :slight_smile:
In had to implement the Function PostUndo / PostRedo in my
FAssetEditorToolkit class. There I called NotifyGraphChanged on my Graph.

gg