Hi,
I think your reply was filtered from my Gmail account. I didn't notice that someone replied to my post.
I was waiting for Dr. Watson's response and still my angle calculation is not so good so I thought I better wait rather than disclose.
But I decided to open, because I think my plist, sprite change, and bone support will be helpful to you guys. Please check the attachment and please share if you solve my angle calculation problem.
Regarding the implementation, I tried use transparent CCNodes for handling bones but I was not able to set positions for each sub nodes to the places I intended, and if I apply the scale factor the final result became very ugly. So I did calculations for each level of bones manually.
My test sample (scml) is very simple one os even though it had 3 or more depth of bones, the final scale factor for each sprite became just 1.0f. Actually the designer here didn't want to squeeeze the images he/she made. So maybe mine is not so perfect for handling your very complex animations. The biggest problem is handling 'angle's between the time lines. I am sorry for opening mine in this stage but it is not that ugly than you think.
The static function
static CCSpriterX* create(const char *filename, const char *plist);
creates a CCSpriterX nodes from the plist. You just make your animation with Spriter tool with separate images (because the tool itself don't support plist yet), and you pack those with tools like TexturePacker. Then you just need plist, png, and scml files for creating your own CCSpriter node.
And if you need to change the sprite, or the 'parts' of the animation, you get the CCSprite node from the animation by using following member function.
cocos2d::CCSprite *getSprite(int folderId, int fileId);
If you open the *.scml file, you will see the images are under 'folder' node (of XML file) and the animation happens each 'file' (leaf of the XML file). Each leaf (file)s are represented by CCSprite. So if you know the index number of 'folder' and 'file', you can get the CCSprite node for them and you just change the contents (texture) of the sprite you want to replace.
Finally, as you see mine is not so perfect and I was not able to focus on that because of other work priorities BUT I disclose mine at this stage because it will be good that my humble changes are helpful to you, and surely someone will can solve it simply. If you have another good solution, please SHARE.
I'd like to be the first one when you share yours here, and let me know via my e-mail address.
(brucewang.korea @ gmail . com)
Best regards,
Bruce.
CCSpriter.zip