Hello! We are new to this forum and we intend to use Spine for our next C++ project. We will actually be using Cocos2D-x for the rendering but that is probably not important for the following query:
We would like to be able to set custom transformation to specific (or all) bones by code for specific frames. For example:
-
We have a normal Spine-animated character.
-
At some point (where the character may be in a normal key frame or an interpolated/blended frame), we want to start setting transformations to bones that are code-generated, not pre-scripted (for example transformations resulting by physics calculations)
-
After some frames that are customly generated, we want to start using Spine again the "normal" way, and interpolate back to a standard key frame
Is this easily doable? That is how I think this would work (pseudocode cause I am not quite familiar with the API, yet):
// normal character animation frame setting
character->setSpineFrame("animName", frameNum);
...
// after some frames, custom character transformation kicks-in
for each (bone in character->getBones())
{
bone->setLocalFromWorldTransform( boneWorldTransform );
}
...
// after some frames again, we revert back to "normal" Spine animation; not abruptly, but with Spine's usual key-frame blending
// i.e, although the previous frame was custom generated, the next normal Spine frame will blend-in smoothly over the next x-frames
character->setSpineFrame("animName", frameNum);