Hi,
We are after some quite..... bespoke functionality from spine. we wanti[/i] to create a new skeleton from an existing skeleton bone hierarchy, only we want to be able to specify which bone will be the new root.
Loading Image
Here is an example of the original skeleton, and in the blue box is the skeleton we want to create. Creating the skeleton seems pretty straight forward.... using old SkeletonData
with spSkeletonCreate
... Setting the other bones to null (we need to keep the same bone index for animations).
However, the 'fun' comes with updating the skeleton, spSkeleton_UpdataeWorldTransform
and spAnimationState_Apply
(we want to continue playing the same animations) call things such as bone = skeleton->bones[self->boneIndex]
with no nullptr check, meaning an exception is thrown if the bone doesn't exist - Which it wont in the new skeleton.
One way around this would be to sift through all the timelines of the new animation and delete them if they reference a NULL bone. This seems pretty ugly way of doing it though.
We would prefer not to edit the runtimes.
Any thoughts?