Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Duroure <julien.duroure@gmail.com>2020-07-21 21:16:08 +0300
committerJulien Duroure <julien.duroure@gmail.com>2020-07-21 21:16:08 +0300
commit2b4bf943d0a323e6b0430179cee7fa7ffb5907d3 (patch)
tree9c7ae90d5c2e07d0e9f6d12a2dfd45a9b4f050c7
parent63dd8498ac106b5645822a124aa0edb0d917d5a8 (diff)
glTF exporter: Fix exporting `aspectRatio` for Perspective Cameras
Thanks pop!
-rwxr-xr-xio_scene_gltf2/__init__.py2
-rwxr-xr-xio_scene_gltf2/blender/exp/gltf2_blender_gather_cameras.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index 9329c556..16fc681e 100755
--- a/io_scene_gltf2/__init__.py
+++ b/io_scene_gltf2/__init__.py
@@ -15,7 +15,7 @@
bl_info = {
'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
- "version": (1, 3, 32),
+ "version": (1, 3, 33),
'blender': (2, 90, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',
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