diff --git a/spine-ts/spine-threejs/src/SkeletonMesh.ts b/spine-ts/spine-threejs/src/SkeletonMesh.ts index 83909461d..ee90efa64 100644 --- a/spine-ts/spine-threejs/src/SkeletonMesh.ts +++ b/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++) { let vertexSize = clipper.isClipping() ? 2 : SkeletonMesh.VERTEX_SIZE; let slot = drawOrder[i]; - if (!slot.bone.active) continue; + if (!slot.bone.active) { + clipper.clipEndWithSlot(slot); + continue; + } let attachment = slot.getAttachment(); let attachmentColor: Color = null; let texture: ThreeJsTexture = null; @@ -290,8 +293,10 @@ export class SkeletonMesh extends THREE.Object3D { finalIndicesLength = triangles.length; } - if (finalVerticesLength == 0 || finalIndicesLength == 0) + if (finalVerticesLength == 0 || finalIndicesLength == 0) { + clipper.clipEndWithSlot(slot); continue; + } // Start new batch if this one can't hold vertices/indices if (!batch.canBatch(finalVerticesLength, finalIndicesLength)) { diff --git a/spine-ts/spine-webgl/example/drag-and-drop.js b/spine-ts/spine-webgl/example/drag-and-drop.js index f7b5eebea..9b38c8784 100644 --- a/spine-ts/spine-webgl/example/drag-and-drop.js +++ b/spine-ts/spine-webgl/example/drag-and-drop.js @@ -21,7 +21,7 @@ class App { // Setup listener for animation selection box let animationSelectBox = document.body.querySelector("#animations"); animationSelectBox.onchange = () => { - // this.animationState.setAnimation(0, animationSelectBox.value, true); + this.animationState.setAnimation(0, animationSelectBox.value, true); } // Setup listener for the PMA checkbox @@ -123,8 +123,7 @@ class App { option.selected = animation.name == animationName; animationSelectBox.appendChild(option); } - - // if (animationName) this.animationState.setAnimation(0, animationName, true); + this.animationState.setAnimation(0, animationName, true); // Center the skeleton in the viewport this.centerSkeleton();