I was using UE5.0.1 for my project.
I just updated engine to 5.1.0.
Then, I got crash after launch editor.
The crash indicates
LogWindows: Error: appError called: Assertion failed: !bIsForCompilationOnly [File:D:\UE5\UE5Engine\Engine\Plugins\FX\Niagara\Source\NiagaraEditor\Private\NiagaraGraph.cpp] [Line: 3887]
So I move to the source code NiagaraGraph.cpp
void UNiagaraGraph::SetIsStaticSwitch(const FNiagaraVariable& Variable, bool InValue)
{
check(!bIsForCompilationOnly); // crash is occured
if (TObjectPtr<UNiagaraScriptVariable>* FoundScriptVariable = VariableToScriptVariable.Find(Variable))
{
(*FoundScriptVariable)->SetIsStaticSwitch(InValue);
}
}
and where to call “SetIsStaticSwitch()” is in PostLoad() of NiagaraNodeStaticSwitch.cpp
if (IsStaticSwitch.IsSet() && *IsStaticSwitch == false)
{
UE_LOG(LogNiagaraEditor, Log, TEXT("Static switch constant \"%s\" in \"%s\" didn't have static switch meta-data conversion set properly. Fixing now."), *InputParameterName.ToString(), *GetPathName())
NiagaraGraph->SetIsStaticSwitch(Variable, true);
MarkNodeRequiresSynchronization(TEXT("Static switch metadata updated"), true);
}
It seems in some Niagara assets, static switch is wrong.
I modified engine with removing check(!bIsForCompilationOnly);
For discovering what assets are problem.
And I got same logs randomly when I open any Niagara system assets.
LogNiagaraEditor: Static switch constant "Randomness Mode" in "/Engine/Transient.NiagaraGraph_668:NiagaraNodeStaticSwitch_1" didn't have static switch meta-data conversion set properly. Fixing now.
LogNiagaraEditor: Static switch constant "Evaluation Type" in "/Engine/Transient.NiagaraGraph_668:NiagaraNodeStaticSwitch_6" didn't have static switch meta-data conversion set properly. Fixing now.
LogNiagaraEditor: Static switch constant "Evaluation Type" in "/Engine/Transient.NiagaraGraph_669:NiagaraNodeStaticSwitch_7" didn't have static switch meta-data conversion set properly. Fixing now.
LogNiagaraEditor: Static switch constant "Randomness Mode" in "/Engine/Transient.NiagaraGraph_669:NiagaraNodeStaticSwitch_2" didn't have static switch meta-data conversion set properly. Fixing now.
LogNiagaraEditor: Static switch constant "Evaluation Type" in "/Engine/Transient.NiagaraGraph_669:NiagaraNodeStaticSwitch_8" didn't have static switch meta-data conversion set properly. Fixing now.
LogNiagaraEditor: Static switch constant "Evaluation Type" in "/Engine/Transient.NiagaraGraph_670:NiagaraNodeStaticSwitch_7" didn't have static switch meta-data conversion set properly. Fixing now.
LogNiagaraEditor: Static switch constant "Randomness Mode" in "/Engine/Transient.NiagaraGraph_670:NiagaraNodeStaticSwitch_2" didn't have static switch meta-data conversion set properly. Fixing now.
LogNiagaraEditor: Static switch constant "Evaluation Type" in "/Engine/Transient.NiagaraGraph_670:NiagaraNodeStaticSwitch_8" didn't have static switch meta-data conversion set properly. Fixing now.
LogNiagaraEditor: Static switch constant "Evaluation Type" in "/Engine/Transient.NiagaraGraph_671:NiagaraNodeStaticSwitch_7" didn't have static switch
meta-data conversion set properly. Fixing now.
LogNiagaraEditor: Static switch constant "Randomness Mode" in "/Engine/Transient.NiagaraGraph_671:NiagaraNodeStaticSwitch_2" didn't have static switch meta-data conversion set properly. Fixing now.
LogNiagaraEditor: Static switch constant "Evaluation Type" in "/Engine/Transient.NiagaraGraph_671:NiagaraNodeStaticSwitch_8" didn't have static switch meta-data conversion set properly. Fixing now.
LogNiagaraEditor: Static switch constant "Evaluation Type" in "/Engine/Transient.NiagaraGraph_672:NiagaraNodeStaticSwitch_7" didn't have static switch meta-data conversion set properly. Fixing now.
LogNiagaraEditor: Static switch constant "Randomness Mode" in "/Engine/Transient.NiagaraGraph_672:NiagaraNodeStaticSwitch_2" didn't have static switch meta-data conversion set properly. Fixing now.
LogNiagaraEditor: Static switch constant "Evaluation Type" in "/Engine/Transient.NiagaraGraph_672:NiagaraNodeStaticSwitch_8" didn't have static switch meta-data conversion set properly. Fixing now.
I think it’s weird that I get same logs above when I open any Niagara system asset.
Even I open same file, some times the logs appears and some times not.
It seems It’s not problem of a bad asset, but it’s problem of engine itself.
How can I fix it? Is there anyone who faces this?