- Home /
Question by
Le_Woods · May 10, 2021 at 06:39 AM ·
blenderblender-exportingline drawing
How can I get these Blender lines to render in Unity?
How would I go about making these thin lines in Blender appear in Unity?
3-4.png
(352.9 kB)
Comment
Answer by andrew-lukasik · May 10, 2021 at 03:46 PM
You can convert them to basic meshes (before exporting), this is the easiest approach.
Or you can try changing MeshTopology
from script. But mesh's indices must follow an actual line structure { 0,1, 2,3, 4,5, ... }
or { 0,1, 1,2, 2,3, ... }
, because otherwise it will render just a web of lines.
using UnityEngine;
public class SetMeshTopology : MonoBehaviour
{
[SerializeField] MeshTopology _meshTopology = MeshTopology.Triangles;
[SerializeField] MeshFilter _meshFilter = null;
[SerializeField][Min(0)] int _submesh = 0;
[SerializeField] bool _sharedMesh = true;
void Awake ()
{
var mesh = _sharedMesh ? _meshFilter.sharedMesh : _meshFilter.mesh;
var indices = mesh.GetIndices( submesh:_submesh );
mesh.SetIndices( indices:indices , topology:_meshTopology , submesh:_submesh );
}
}
Your answer

Follow this Question
Related Questions
importing from blender 1 Answer
Import Blender Mesh 1 Answer
Local Orientation reversed on transfer from blender to unity 1 Answer