From a64ec68c3f58fb411264c91a990fa982b86a1da6 Mon Sep 17 00:00:00 2001 From: Davide Tantillo Date: Tue, 4 Nov 2025 11:33:31 +0100 Subject: [PATCH] Animation error in editor. --- spine-ts/spine-construct3/src/instance.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spine-ts/spine-construct3/src/instance.ts b/spine-ts/spine-construct3/src/instance.ts index 4354f841e..c094d9955 100644 --- a/spine-ts/spine-construct3/src/instance.ts +++ b/spine-ts/spine-construct3/src/instance.ts @@ -79,6 +79,7 @@ class SpineC3PluginInstance extends SDK.IWorldInstanceBase { const hasErrors = this.hasErrors(); if (this.skeleton && !hasErrors) { + this.setAnimation(); this.setSkin(); const rectX = this._inst.GetX(); @@ -233,6 +234,7 @@ class SpineC3PluginInstance extends SDK.IWorldInstanceBase { } if (id === PLUGIN_CLASS.PROP_ANIMATION) { + this.setAnimation(); this.layoutView?.Refresh(); return; } @@ -262,6 +264,10 @@ class SpineC3PluginInstance extends SDK.IWorldInstanceBase { console.log("Prop change end"); } + private setAnimation () { + this.animation = this._inst.GetPropertyValue(PLUGIN_CLASS.PROP_ANIMATION) as string; + } + private setSkin () { const { skeleton } = this; if (!skeleton) return; @@ -426,6 +432,12 @@ class SpineC3PluginInstance extends SDK.IWorldInstanceBase { "Animation/Skin bounds provider requires one between skin and animation to be set." ); + this.setError( + "nonExistingAnimation", + Boolean(!animation || this.skeleton?.data.findAnimation(animation)) === false, + "Not existing animation" + ); + const { width, height } = spineBounds; this.setError( "boundsNoDimension",