-
Notifications
You must be signed in to change notification settings - Fork 132
Description
Hello!
There appears to be an issue in loading models that have only "lines", i.e. vertices/edges with no faces. I have an example model here (GitHub will only let me upload it as zip, apologies. But you can recreate it manually in blender by just making a line):
This model has nodes which are just "lines" around some of the leaves. When I load it into an asset and load the static mesh via asset->LoadStaticMeshRecursive
, it returns a nullptr
and just refuses to load the model. I believe this is due to this function returning false when bSkipLine
is true:
if (Primitive.Mode >= 1 && Primitive.Mode <= 3 && MaterialsConfig.bSkipLines)
{
return false;
}
Which in turn causes LoadMeshIntoMeshLOD
to return false, and then LoadStaticMeshRecursive
returns a nullptr
here:
FglTFRuntimeMeshLOD* LOD = nullptr;
if (!LoadMeshIntoMeshLOD(JsonMeshObject.ToSharedRef(), LOD, StaticMeshConfig.MaterialsConfig))
{
AddError("LoadStaticMeshRecursive()", FString::Printf(TEXT("Unable to load Mesh \"%s\""), *ChildNode.Name));
return nullptr;
}
This behaviour seems inconsistent with AglTFRuntimeAssetActor
which successfully loads the model, I imagine because it skips over the weird nodes. I would have thought it would be desired for it to skip for static meshes too and render what nodes work? It could be worked around already by working out what nodes are lines and adding them to the excludeNodes
param, but this seems like it could be a parameter to the function anyway.