Mesh with no faces? (Only edges and vertices)

Hi everybody,

I’m trying to get a mesh with no faces (pretty much a number of vertices connected by edges) importing into unity from Blender, but when I drag it into the scene and try to get its vertex counts, I get a 0. I assume that’s because Unity doesn’t allow meshes with no faces? I’ve been trying to find an answer to this myself, but couldn’t :frowning:

Vector3[] vertices = _meshFilter.mesh.vertices;
Debug.Log(vertices.Length);  // outputs 0, whereas the mesh should actually have 5 vertices (that's what it is in Blender)

Anybody have a similar problem or solution to? Thanks heaps!

1 Like

I’ve never imported mesh from blender, but I’ve built a lot of meshes procedurally. When you build a mesh procedurally you must always provides the faces too, so I guess having faces defined is mandatory in Unity.

Oh right, thanks for the info… that is interesting.

But I’ve figured it out - it was obvious, don’t know how I didn’t get it before. When you import an object with no faces with Mesh Compression turned on, the mesh becomes invisible (it gets rid of all geometry since it won’t be visible anyways). So disable “Mesh Compression” and voila! You’ve got a mesh with no faces in the scene :smile:

Hopefully that helps somebody! (spent hours on trying to figure this out)

5 Likes

This is really old but just as an update in unity 2019.4:
Mesh compression is not the one changing it, but turning off “Optimize Mesh” keeps the curve intact for me.

2 Likes

Read/write and Compression off worked for me, thanks!

1 Like