You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In spine-godot it's not possible to get the bounding box of a slot. The SpineMesh2D doesn't expose anything that can be used to calculate the bounds. Internally it does calculate the bounds, so with this little patch it's possible to get them in the GDScript:
It exposes the internal mesh RID to GDScript, then with the RenderingServer you can fetch the bounds:
var mesh = $SpineSprite.get_child(index)
var internal_mesh_rid = mesh.get_mesh_rid()
var mesh_aabb = RenderingServer.mesh_get_custom_aabb(internal_mesh_rid)
Drawback is that this bounding box is calculated after a render, so to use it you probably need to wait for something like:
await get_tree().process_frame
Perhaps there is a cleaner way to implement this, or expose a get_bounds() to the SpineSlot ?
The text was updated successfully, but these errors were encountered:
In spine-godot it's not possible to get the bounding box of a slot. The SpineMesh2D doesn't expose anything that can be used to calculate the bounds. Internally it does calculate the bounds, so with this little patch it's possible to get them in the GDScript:
It exposes the internal mesh RID to GDScript, then with the RenderingServer you can fetch the bounds:
Drawback is that this bounding box is calculated after a render, so to use it you probably need to wait for something like:
await get_tree().process_frame
Perhaps there is a cleaner way to implement this, or expose a get_bounds() to the SpineSlot ?
The text was updated successfully, but these errors were encountered: