Skip to content

UglTFRuntimeAsset will not load static mesh when nodes contain just "lines" #114

@matthew-rimmer

Description

@matthew-rimmer

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):

plantModel.zip

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions