How to Rotate, Move, scale Bone3D for Sprite3D by code

Hi,
I have a .c3t file convert from blender by fbx-converter, I can get a skeleton of sprite, and I can get a bone from the skeleton of sprite3D. But I can’t move, rotate, or scale this bone, I used setAnimationValue but it not working.

Can anyone suggest me something to be able to do this?
Sorry if I am wrong about my writing skills.
Best regards!

Have you been able to review cpp-tests?

I went through cpp-test, but I think most of them use animations to runAction.
Or if I have something wrong, can you index it for me?

Do you have a sample project I can play with. I’ll talk to the engineers as well.

I have sample project, you can see resource and source code at here. I think, this feature is very necessary. Please let me know if there is any information.

If you want animate bone properly, you must know bone origin matrix.
but it can not be accessed by default.
It works for me, with little modification.

add this method in Bone3D

Mat4& getOriPose(){ return _oriPose;  } // expose bone origin

and can animate bone manually like this

Bone3D* b = your_sprite3d->getSkeleton()->getBoneByName("bonename");
Mat4 mat = b->getOriPose();
Vec3 position ;
Quaternion rotation;
Vec3 scale;
mat.getTranslation(&position); 
mat.getRotation(&rotation);
mat.getScale(&scale);

////////////////////////////////////////////////////////////////////
// edit position, scale,rotation as you want
////////////////////////////////////////////////////////////////////
//and apply
float p_out[3] = {position.x, position.y, position.z};
float r_out[4] = {rotation.x, rotation.y, rotation.z, rotation.w};
float s_out[3] = {scale.x, scale.y, scale.z};
b->setAnimationValue(p_out, r_out,  s_out );
2 Likes

This is interesting.