Browse Source

[ts][threejs] Clipping not properly ended for all code paths.

Mario Zechner 3 years ago
parent
commit
c14cef967f
1 changed files with 7 additions and 2 deletions
  1. 7 2
      spine-ts/spine-threejs/src/SkeletonMesh.ts

+ 7 - 2
spine-ts/spine-threejs/src/SkeletonMesh.ts

@@ -173,7 +173,10 @@ export class SkeletonMesh extends THREE.Object3D {
 		for (let i = 0, n = drawOrder.length; i < n; i++) {
 		for (let i = 0, n = drawOrder.length; i < n; i++) {
 			let vertexSize = clipper.isClipping() ? 2 : SkeletonMesh.VERTEX_SIZE;
 			let vertexSize = clipper.isClipping() ? 2 : SkeletonMesh.VERTEX_SIZE;
 			let slot = drawOrder[i];
 			let slot = drawOrder[i];
-			if (!slot.bone.active) continue;
+			if (!slot.bone.active) {
+				clipper.clipEndWithSlot(slot);
+				continue;
+			}
 			let attachment = slot.getAttachment();
 			let attachment = slot.getAttachment();
 			let attachmentColor: Color = null;
 			let attachmentColor: Color = null;
 			let texture: ThreeJsTexture = null;
 			let texture: ThreeJsTexture = null;
@@ -290,8 +293,10 @@ export class SkeletonMesh extends THREE.Object3D {
 					finalIndicesLength = triangles.length;
 					finalIndicesLength = triangles.length;
 				}
 				}
 
 
-				if (finalVerticesLength == 0 || finalIndicesLength == 0)
+				if (finalVerticesLength == 0 || finalIndicesLength == 0) {
+					clipper.clipEndWithSlot(slot);
 					continue;
 					continue;
+				}
 
 
 				// Start new batch if this one can't hold vertices/indices
 				// Start new batch if this one can't hold vertices/indices
 				if (!batch.canBatch(finalVerticesLength, finalIndicesLength)) {
 				if (!batch.canBatch(finalVerticesLength, finalIndicesLength)) {