How to create motion clip file (.npz) from other dataset
Great Work! It is amazing , May I ask what is the data structure of motion clip file. If I have some skeleton coordinates for each frame, how should I create a motion clip file for training ? Thanks
if you have the global translation of the root, as well as the rotations for each joint. You can take a look at this example to create a poselib motion file:
https://github.com/nv-tlabs/ASE/blob/de18a567649964d5f12b2bc31f44489d3ef26229/ase/poselib/retarget_motion.py#L253
You will first need to create a skeletonstate by passing the skeleton_tree of your character, the local rotations of the joints, and the root translation to SkeletonState.from_rotation_and_root_translation. Then you can create a skeletonmotion using SkeletonMotion.from_skeleton_state.
if you have the global translation of the root, as well as the rotations for each joint. You can take a look at this example to create a poselib motion file:
https://github.com/nv-tlabs/ASE/blob/de18a567649964d5f12b2bc31f44489d3ef26229/ase/poselib/retarget_motion.py#L253
You will first need to create a skeletonstate by passing the skeleton_tree of your character, the local rotations of the joints, and the root translation to
SkeletonState.from_rotation_and_root_translation. Then you can create a skeletonmotion usingSkeletonMotion.from_skeleton_state.
Thank you for your reply! I import skeleton tree from MJCF file but I notice the joint have only 3 axis and at each frame in my motion file the joints only have a rotation value along one axis , but why the local_rotaion need 4 dimensions and how should I get the root_translation for each frame? In your code "from MJCF" , I saw the local_translation was read from "pos " of joint when creating skeleton tree from MJCF file . Is the root_translation means pos of root joint at each frame ? Here is a example of my motion data , Thanks
The 4 dimensions rotation is in quaternion. It's that your rotation is in euler angle. Root translation is the global root position.