Skip to content

Commit 82d7a5e

Browse files
committed
Fix b/64571071: particle import drops particles
Turns out we were throwing away 1/3 of the particle quads. No more! Change-Id: I1f4257936f0d9a00ecf53a7bedc977f1bf173616
1 parent 87f8e85 commit 82d7a5e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

UnitySDK/Assets/TiltBrush/Scripts/Editor/ParticleMesh.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ internal static void FilterMesh(Mesh mesh, WarningCallback callback) {
5858
ParticleMesh src = ParticleMesh.FromMesh(mesh);
5959
ParticleMesh dst = new ParticleMesh();
6060

61-
// ClassifyQuad wants at least 6 verts to examine
62-
int limit = src.VertexCount - 5;
61+
// ClassifyQuad wants at least 6 indices (2 triangles) to examine
62+
int limit = src.TriangleCount - 6;
6363
int iiVert = 0;
6464
while (iiVert < limit) {
6565
switch (src.ClassifyQuad(iiVert, callback)) {
@@ -109,7 +109,7 @@ private static ParticleMesh FromMesh(Mesh mesh) {
109109
bool m_bNoisy = true;
110110
int? m_lastMod;
111111

112-
internal int VertexCount { get { return m_vertices.Count; } }
112+
internal int TriangleCount { get { return m_triangles.Count; } }
113113

114114
// iiVert is an index to an index to a vert (an index into m_triangles)
115115
// iiVert must be at least 6 verts from the end of the mesh.

0 commit comments

Comments
 (0)