Skip to content

Commit 27810d6

Browse files
committed
[godot] Fix SpineSlotNode Y-down scale regression
1 parent 18b5c27 commit 27810d6

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@
323323
- Fixed `SpineAnimationTrack` editor preview paths for nested `AnimationPlayer` roots, and prevented inactive tracks from clearing `SpineSprite` preview animations.
324324
- Fixed GDExtension animation mix editing in the Godot inspector.
325325
- Fixed `SpineBoneNode` and `SpineSlotNode` transforms when bones use negative scale or shear, and applied `SpineBoneNode` Drive mode before world transforms are computed.
326+
- Fixed `SpineSlotNode` and global bone transforms exposing the runtime Y-down coordinate conversion as negative Godot Node2D Y scale.
326327
- Updated Godot 4.x CI builds to Godot 4.6.2.
327328
- Fixed Godot 4.6 Windows editor CI builds by installing Direct3D 12 SDK dependencies before building Godot.
328329
- Fixed Godot 4.6 GDExtension builds with the latest `godot-cpp` by including the required `Ref` support header in `SpineCommon.h`, updated `SpineEventData` for the `EventData.setupPose` API change, and refreshed vendored `spine-cpp` sources during clean setup.

‎spine-godot/spine_godot/SpineBone.cpp‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ Transform2D SpineBone::get_global_transform() {
190190
Transform2D local;
191191
local[0] = Vector2(applied_pose.getA(), applied_pose.getC());
192192
local[1] = Vector2(applied_pose.getB(), applied_pose.getD());
193+
// Bone::setYDown(true) is a runtime coordinate conversion for Godot. Don't expose it as an authored Node2D Y scale.
194+
if (spine::Bone::isYDown()) local[1] = Vector2(-local[1].x, -local[1].y);
193195
local[2] = Vector2(applied_pose.getWorldX(), applied_pose.getWorldY());
194196
return get_spine_owner()->get_global_transform() * local;
195197
}
@@ -205,6 +207,7 @@ void SpineBone::set_global_transform(Transform2D transform) {
205207
auto bone = get_spine_object();
206208
Transform2D inverse_sprite_transform = get_spine_owner()->get_global_transform().affine_inverse();
207209
Transform2D local = inverse_sprite_transform * transform;
210+
if (spine::Bone::isYDown()) local[1] = Vector2(-local[1].x, -local[1].y);
208211
auto &applied_pose = bone->getAppliedPose();
209212
applied_pose.setA(local[0].x);
210213
applied_pose.setC(local[0].y);

0 commit comments

Comments
 (0)