Add set empty animation.

This commit is contained in:
Davide Tantillo 2025-11-05 12:40:20 +01:00
parent 57c2fa1cfd
commit be761e2792
5 changed files with 53 additions and 0 deletions

View File

@ -120,6 +120,21 @@
"id": "stop",
"scriptName": "Stop",
"highlight": false
},
{
"id": "set-empty-animation",
"scriptName": "SetEmptyAnimation",
"highlight": false,
"params": [
{
"id": "track",
"type": "number"
},
{
"id": "mix-duration",
"type": "number"
}
]
}
],
"expressions": [

View File

@ -31,6 +31,10 @@ C3.Plugins.EsotericSoftware_SpineConstruct3.Acts =
Stop (this: SDKInstanceClass) {
this.stop();
},
SetEmptyAnimation (this: SDKInstanceClass, track: number, mixDuration: number) {
this.setEmptyAnimation(track, mixDuration);
}
};

View File

@ -175,6 +175,10 @@ class SpineC3Instance extends globalThis.ISDKWorldInstanceBase {
this.isPlaying = false;
}
public setEmptyAnimation (track: number, mixDuration = 0) {
this.state?.setEmptyAnimation(track, mixDuration);
}
private _setSkin () {
const { skeleton } = this;
if (!skeleton) return;

View File

@ -194,6 +194,21 @@
"list-name": "Stop",
"display-text": "Stop animation",
"description": "Pause or stop the animation"
},
"set-empty-animation": {
"list-name": "Set empty animation",
"display-text": "Set empty animation on track {0} with mix duration {1}",
"description": "Set an empty animation on a specific track",
"params": {
"track": {
"name": "Track",
"desc": "Track index"
},
"mix-duration": {
"name": "Mix duration",
"desc": "Duration in seconds to mix from the current animation to empty"
}
}
}
},
"expressions": {

View File

@ -196,6 +196,21 @@
"display-text": "停止动画",
"description": "暂停或停止动画"
},
"set-empty-animation": {
"list-name": "设置空动画",
"display-text": "在轨道{0}上设置空动画,混合时长{1}",
"description": "在特定轨道上设置空动画",
"params": {
"track": {
"name": "轨道",
"desc": "轨道索引"
},
"mix-duration": {
"name": "混合时长",
"desc": "从当前动画混合到空动画的持续时间(秒)"
}
}
},
"expressions": {
"double": {
"description": "将数字翻倍。",