Skip to content
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

Camera Fov Y exported wrong. #2315

Open
voidstorm opened this issue Aug 13, 2024 · 1 comment
Open

Camera Fov Y exported wrong. #2315

voidstorm opened this issue Aug 13, 2024 · 1 comment
Labels
question Further information is requested

Comments

@voidstorm
Copy link

voidstorm commented Aug 13, 2024

Describe the bug
Camera y-fov export is wrong. Instead of exporting it in radians it seems its exported as degrees/100. E.g a fov of 39.9 is exported as 0.3999 instead of 0.69. The erratic behavior is also apparent when re-importing the previously imported gltf file. If you re-import, the fovy that was exported as 39.9 becomes now 22.9 instead.
Changing lens units from/to fov or mm also does not change behavior.

To Reproduce
Steps to reproduce the behavior:
Create a camera, export gltf including cameras. Check json -> value will be wrong. To further confirm, re-import gltf, now the imported camera will also have a wrong fov.

Expected behavior
E.g 39.9 should export as 6.999 radians

Version

  • OS: Win11
  • Blender Version 4.2
@julienduroure
Copy link
Collaborator

Hello,

Exporting / Importing camera yfov is not as simple as field of view conversion, as it require also aspect ratio (so render size) and sensor fit

We can find the conversion used here:

def yvof_blender_to_gltf(angle, width, height, sensor_fit):

At import, we currently don't fully manage aspect ratio / render size :

cam.angle_y = pycamera.perspective.yfov

@julienduroure julienduroure added the question Further information is requested label Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants