From 50a8a47ff0c100caea64c181a5973f2e6e4c2807 Mon Sep 17 00:00:00 2001 From: Davide Tantillo Date: Wed, 19 Nov 2025 17:59:09 +0100 Subject: [PATCH] Ensure array size passed to draw mesh also for editor instance. --- spine-ts/spine-construct3/src/instance.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/spine-ts/spine-construct3/src/instance.ts b/spine-ts/spine-construct3/src/instance.ts index fb70baac4..86597d45f 100644 --- a/spine-ts/spine-construct3/src/instance.ts +++ b/spine-ts/spine-construct3/src/instance.ts @@ -125,8 +125,14 @@ class SpineC3PluginInstance extends SDK.IWorldInstanceBase { while (command) { const { numVertices, positions, uvs, colors, indices, numIndices, blendMode } = command; - const vertices = this.tempVertices; - const c3colors = this.tempColors; + const vertices = this.tempVertices.length < numVertices * 3 + ? (this.tempVertices = new Float32Array(numVertices * 3)) + : this.tempVertices; + + const c3colors = this.tempColors.length < numVertices * 4 + ? (this.tempColors = new Float32Array(numVertices * 4)) + : this.tempColors; + for (let i = 0; i < numVertices; i++) { const srcIndex = i * 2; const dstIndex = i * 3;