From 82d7a5e1560ef8c032ef7807ea024c41e8c5aa2b Mon Sep 17 00:00:00 2001 From: Paul Du Bois Date: Thu, 10 Aug 2017 13:09:56 -0700 Subject: [PATCH] Fix b/64571071: particle import drops particles Turns out we were throwing away 1/3 of the particle quads. No more! Change-Id: I1f4257936f0d9a00ecf53a7bedc977f1bf173616 --- UnitySDK/Assets/TiltBrush/Scripts/Editor/ParticleMesh.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/UnitySDK/Assets/TiltBrush/Scripts/Editor/ParticleMesh.cs b/UnitySDK/Assets/TiltBrush/Scripts/Editor/ParticleMesh.cs index 10f02b19..8e29b393 100644 --- a/UnitySDK/Assets/TiltBrush/Scripts/Editor/ParticleMesh.cs +++ b/UnitySDK/Assets/TiltBrush/Scripts/Editor/ParticleMesh.cs @@ -58,8 +58,8 @@ internal static void FilterMesh(Mesh mesh, WarningCallback callback) { ParticleMesh src = ParticleMesh.FromMesh(mesh); ParticleMesh dst = new ParticleMesh(); - // ClassifyQuad wants at least 6 verts to examine - int limit = src.VertexCount - 5; + // ClassifyQuad wants at least 6 indices (2 triangles) to examine + int limit = src.TriangleCount - 6; int iiVert = 0; while (iiVert < limit) { switch (src.ClassifyQuad(iiVert, callback)) { @@ -109,7 +109,7 @@ private static ParticleMesh FromMesh(Mesh mesh) { bool m_bNoisy = true; int? m_lastMod; - internal int VertexCount { get { return m_vertices.Count; } } + internal int TriangleCount { get { return m_triangles.Count; } } // iiVert is an index to an index to a vert (an index into m_triangles) // iiVert must be at least 6 verts from the end of the mesh.