-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
convert to fbx file #57
Comments
+1 |
https://github.com/JYuhao88/SMPLerX-Server |
I solved this by first converting to AMASS format and then using smplx_blender_addon to export fbx.
def convert_to_amass_npz(npy_path, npz_path):
# Read motion data from npy file
motion = np.load(npy_path)
motion = torch.tensor(motion).float()
# Extract motion parameters
motion_parms = {
"root_orient": motion[:, :3],
"pose_body": motion[:, 3 : 3 + 63],
"pose_hand": motion[:, 66 : 66 + 90],
"pose_jaw": motion[:, 66 + 90 : 66 + 93],
"trans": motion[:, 309 : 309 + 3],
"betas": motion[:, 312:],
}
# Create amass format data
frame_length = motion.shape[0]
gender = "male"
left_eye_smplhf_and_right_eye_smplhf = np.zeros((frame_length, 2 * 3))
# AMASS JOINTS format
poses = np.concatenate(
(
motion_parms["root_orient"],
motion_parms["pose_body"],
motion_parms["pose_jaw"],
left_eye_smplhf_and_right_eye_smplhf,
motion_parms["pose_hand"],
),
axis=1,
)
trans = motion_parms["trans"]
betas = motion_parms["betas"][0]
# Save data in amass format (NPZ file)
os.makedirs(
os.path.dirname(npz_path), exist_ok=True
) # Create necessary directories
np.savez(
npz_path,
poses=poses,
gender=gender,
mocap_framerate=30,
betas=betas,
trans=trans,
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to convert Motion-X files to FBX for 3D animation programs?
The text was updated successfully, but these errors were encountered: