diff options
author | Julien Duroure <julien.duroure@gmail.com> | 2020-07-21 21:16:08 +0300 |
---|---|---|
committer | Julien Duroure <julien.duroure@gmail.com> | 2020-07-21 21:16:08 +0300 |
commit | 2b4bf943d0a323e6b0430179cee7fa7ffb5907d3 (patch) | |
tree | 9c7ae90d5c2e07d0e9f6d12a2dfd45a9b4f050c7 /io_scene_gltf2/blender/exp/gltf2_blender_gather_cameras.py | |
parent | 63dd8498ac106b5645822a124aa0edb0d917d5a8 (diff) |
glTF exporter: Fix exporting `aspectRatio` for Perspective Cameras
Thanks pop!
Diffstat (limited to 'io_scene_gltf2/blender/exp/gltf2_blender_gather_cameras.py')
-rwxr-xr-x | io_scene_gltf2/blender/exp/gltf2_blender_gather_cameras.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_cameras.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_cameras.py index 585f0be3..bb211fe2 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_cameras.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_cameras.py @@ -92,18 +92,18 @@ def __gather_perspective(blender_camera, export_settings): width = bpy.context.scene.render.pixel_aspect_x * bpy.context.scene.render.resolution_x height = bpy.context.scene.render.pixel_aspect_y * bpy.context.scene.render.resolution_y - perspective.aspectRatio = width / height + perspective.aspect_ratio = width / height if width >= height: if blender_camera.sensor_fit != 'VERTICAL': - perspective.yfov = 2.0 * math.atan(math.tan(blender_camera.angle * 0.5) / perspective.aspectRatio) + perspective.yfov = 2.0 * math.atan(math.tan(blender_camera.angle * 0.5) / perspective.aspect_ratio) else: perspective.yfov = blender_camera.angle else: if blender_camera.sensor_fit != 'HORIZONTAL': perspective.yfov = blender_camera.angle else: - perspective.yfov = 2.0 * math.atan(math.tan(blender_camera.angle * 0.5) / perspective.aspectRatio) + perspective.yfov = 2.0 * math.atan(math.tan(blender_camera.angle * 0.5) / perspective.aspect_ratio) perspective.znear = blender_camera.clip_start perspective.zfar = blender_camera.clip_end |