Open iznaut opened 1 year ago
Thx for this, I got the 4.27 version and this was happening there too. It needs to be handled for both HandleEditorModeEnter
and HandleEditorModeExit
or the crash happens when closing animbp (and potentially some other editors like Niagara or Cascade) as well.
Here's the code if anyone wants to just copy/paste it (replace the existing code)
void UElgEditorContext_LevelEditor::HandleEditorModeEnter(const FEditorModeID& ModeID)
{
FText oldName = CurrentEditorMode;
FEdMode* mode = GLevelEditorModeTools().GetActiveMode(ModeID);
if(mode != nullptr){
CurrentEditorMode = mode->GetModeInfo().Name;
OnEnterMode.Broadcast(CurrentEditorMode);
if (!oldName.EqualTo(CurrentEditorMode)) {
OnEditorModeChanged.Broadcast(CurrentEditorMode);
}
}
}
void UElgEditorContext_LevelEditor::HandleEditorModeExit(const FEditorModeID& ModeID)
{
FEdMode* mode = GLevelEditorModeTools().GetActiveMode(ModeID);
if(mode != nullptr){
OnExitMode.Broadcast(mode->GetModeInfo().Name);
}
}
When opening an animation blueprint with this plugin enabled, UE4 will crash.
The third line of this function in
ElgEditorContext_LevelEditor.cpp
was the problem:My colleague was able to fix it by simply doing a check to make sure
mode != NULL
, so there's a workaround, but I thought I would report here so it could be properly fixed in the source.