google-research / kubric

A data generation pipeline for creating semi-realistic synthetic multi-object videos with rich annotations such as instance segmentation masks, depth maps, and optical flow.
Apache License 2.0
2.35k stars 233 forks source link

Rendering Issues with GLB Files in Kubric: Incorrect Orientation #324

Open domejiraphon opened 7 months ago

domejiraphon commented 7 months ago

Hi! I've been exploring Kubric for data generation and using my own mesh. I've followed the suggestions from this issue. Basically, I converted my glb file to obtain collision geometry and a URDF file, similar to what's done in your shapenet code.

However, I encounter a problem when setting the render filename to my GLB file: the rendering isn't correct. The orientation is off, and it varies from mesh to mesh. The left image uses render_filename as glb, while the right image uses obj. The left satellite looks detached and differs in orientation. This would make the physics simulation incorrect where the pybullet uses obj and blender uses glb. out

I double checked these glb and obj files by loading into blender UI and it looks the same. I digged further and found that the code for loading the glb file is not necessary correct. Sometimes, it works but some other time I have to fix it to be.

blender_obj.rotation_mode = 'XYZ'
blender_obj.rotation_euler[0] += math.radians(180)

Is this related to +Y up? Any guidance how to correct this?