ROMP icon indicating copy to clipboard operation
ROMP copied to clipboard

About the exported FBX file

Open Rulai1 opened this issue 2 years ago • 2 comments

Hello Arthur, thanks for your excellent work. But I have one question when trying to use the exported .fbx file. I export the .fbx file using your code convert2fbx.py. Then I import the .fbx file into Blender. What I want to do is to see the imported mesh and bones in the view of the camera system in Blender. I set the camera type as Perspective, and FOV as 60 degress. however, I do not know how to set the translation of the camera. I tried cam_trans and cam from .npz file exported from simple_romp, but both seemed not the correct answer. I also tried just set the camera at the world coordinate (0, 0, 0), but still not work. When I view the .fbx file from this camera view (I set the original image as the background of the camera view), the result is not the same as what simple_romp rendered. The following figures show simple_romp rendered image and image I view from Blender camera.

Could you please tell me what is the correct camera parameters when I want to get the same image when viewed from Blender's camera as what is rendered by simple_romp? Thank you.

romp blender

Rulai1 avatar Jan 13 '23 04:01 Rulai1

Good question. There is some in-convenient design in current code leads to such problem. Note that the cam_trans is related to a root that is the mean of left and right hip joints, instead of the root joint (0-th pelvis joint of smpl) used in blender view. To get the cam_trans that is related to the root joint (0-th pelvis joint of smpl), you just need to cam_trans + joints[0] (assuming cam_trans is of shape 3, and joints is of shape Nx3, N is joint number).

Arthur151 avatar Jan 13 '23 09:01 Arthur151

Thanks for your reply Arthur! So I followed your advice and reply code in covert2fbx.py

https://github.com/Arthur151/ROMP/blob/a349c6bf4d6229b8fba2e900d38ef210888937d0/simple_romp/tools/convert2fbx.py#L229-L230

by

        poses[inds] = frame_results[frame_name]['smpl_thetas'][0]
        trans[inds] = frame_results[frame_name]['cam_trans'][0]
        joints[inds] = frame_results[frame_name]['joints'][0]
        trans[inds] += joints[inds][0]

and remain the rest of the code the same.

In Blender, I still set the Perspective Camera of FOV 60 degrees at the world center. However, the result seems still not correct.

Could you please help me find out what is wrong this time? Thank you ! blender2

Rulai1 avatar Jan 14 '23 11:01 Rulai1