diff --git a/spine-ts/biome.json b/spine-ts/biome.json index fb8fcc747..2d69ac2c2 100644 --- a/spine-ts/biome.json +++ b/spine-ts/biome.json @@ -1,11 +1,14 @@ { - "formatter": { - "enabled": false - }, - "linter": { - "enabled": true, - "rules": { - "recommended": true - } - } -} \ No newline at end of file + "formatter": { + "enabled": false + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true, + "suspicious": { + "noAssignInExpressions": "off" + } + } + } +} diff --git a/spine-ts/spine-pixi-v8/src/SpinePipe.ts b/spine-ts/spine-pixi-v8/src/SpinePipe.ts index e08a08d3b..bfa244e4d 100644 --- a/spine-ts/spine-pixi-v8/src/SpinePipe.ts +++ b/spine-ts/spine-pixi-v8/src/SpinePipe.ts @@ -27,17 +27,17 @@ * THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ +import { MeshAttachment, RegionAttachment } from '@esotericsoftware/spine-core'; import { - extensions, ExtensionType, - InstructionSet, type BLEND_MODES, - type Container, + type Container, ExtensionType, + extensions, + type InstructionSet, type Renderer, type RenderPipe, } from 'pixi.js'; import { BatchableSpineSlot } from './BatchableSpineSlot.js'; -import { Spine } from './Spine.js'; -import { MeshAttachment, RegionAttachment } from '@esotericsoftware/spine-core'; +import type { Spine } from './Spine.js'; const spineBlendModeMap: Record = { 0: 'normal', @@ -123,6 +123,7 @@ export class SpinePipe implements RenderPipe { const slot = drawOrder[i]; const attachment = slot.applied.attachment; const blendMode = spineBlendModeMap[slot.data.blendMode]; + let skipRender = false; if (attachment instanceof RegionAttachment || attachment instanceof MeshAttachment) { const cacheData = spine._getCachedData(slot, attachment); @@ -135,7 +136,8 @@ export class SpinePipe implements RenderPipe { roundPixels ); - if (!cacheData.skipRender) { + skipRender = cacheData.skipRender; + if (!skipRender) { batcher.addToBatch(batchableSpineSlot, instructionSet); } } @@ -145,9 +147,12 @@ export class SpinePipe implements RenderPipe { if (containerAttachment) { const container = containerAttachment.container; - container.includeInBuild = true; - // See https://github.com/pixijs/pixijs/blob/b4c050a791fe65e979e467c9cba2bda0c01a1c35/src/scene/container/utils/collectAllRenderables.ts#L28 - container.collectRenderables(instructionSet, this.renderer, null!); + if (!skipRender) { + container.includeInBuild = true; + // See https://github.com/pixijs/pixijs/blob/b4c050a791fe65e979e467c9cba2bda0c01a1c35/src/scene/container/utils/collectAllRenderables.ts#L28 + container.collectRenderables(instructionSet, this.renderer, null!); + } + container.includeInBuild = false; } }