Hello,
we’re being spammed by niagara warning about missing fallbacks meshs for nanite meshes while Cooking.
Said log comes from NiagaraMeshRendererProperties.cpp line 260 and looks like (btw system name is always “None” but it’s not my issue there)
> LogNiagara: Warning: NiagaraRenderableMesh does not have a fallback mesh. Enable Nanite fallback mesh to fix this issue. System: None, Mesh: StaticMesh <mesh path>
NiagaraMeshRendererPropertiesInternal::IsStaticMeshSafeToUse is using HasNaniteFallbackMesh to detect & warn about missing fallbacks (wich is nice to pinpoint errors).
But this calls goes down to FStaticMeshRenderData::HasNaniteFallbackMesh that check bForceGenerateNaniteFallbackMesh, while cooking this value is never initialized as FStaticMeshRenderData::InitResources is not called.
I modified the code like this to prevent being misleaded about real asset settings error
bool FStaticMeshRenderData::HasNaniteFallbackMesh(EShaderPlatform ShaderPlatform) const
{
checkf(HasValidNaniteData(), TEXT("Should only call HasNaniteFallbackMesh(...) if HasValidNaniteData() returns true."));
#if WITH_EDITORONLY_DATA
// fallback meshes are always available in editor
// so here we emulate the value for the requested platform
if (AreNaniteFallbackMeshesEnabledForPlatform(ShaderPlatform))
{
return true;
}
//@CYA EDIT while cooking bForceGenerateNaniteFallbackMesh is not initialized but bHasNaniteFallbackMesh has a valid value
return bForceGenerateNaniteFallbackMesh || bHasNaniteFallbackMesh;
//@CYA END
#else
return bHasNaniteFallbackMesh;
#endif
}
Is that change valid or did i broke something under the hood ?
A better fix would be to find the right place to update bForceGenerateNaniteFallbackMesh value when InitResources is not called but i’m not sure where to add this.
Regards
Cø
[Attachment Removed]