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:
authorMichael Krupa <kroopson@wp.pl>2011-12-06 17:38:12 +0400
committerMichael Krupa <kroopson@wp.pl>2011-12-06 17:38:12 +0400
commit07584de9c16ced5bbebbfcd44ebf4c04f00b3003 (patch)
tree122f6b1e763653ef78204dc134023029e184dbc3 /io_anim_nuke_chan/export_nuke_chan.py
parent370b15a0d12641659083a0c3802286836ba5bb55 (diff)
Updated to use the sensor size in blender 2.61
Diffstat (limited to 'io_anim_nuke_chan/export_nuke_chan.py')
-rw-r--r--io_anim_nuke_chan/export_nuke_chan.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/io_anim_nuke_chan/export_nuke_chan.py b/io_anim_nuke_chan/export_nuke_chan.py
index 3760e342..4e1cd120 100644
--- a/io_anim_nuke_chan/export_nuke_chan.py
+++ b/io_anim_nuke_chan/export_nuke_chan.py
@@ -73,13 +73,21 @@ def save_chan(context, filepath, y_up, rot_ord):
# if we have a camera, add the focal length
if obj.type == 'CAMERA':
- # I've found via the experiments that this is a blenders
- # default sensor size (in mm)
- sensor_x = 32.0
- # the vertical sensor size we get by multiplying the sensor_x by
- # resolution ratio
- sensor_y = sensor_x * res_ratio
+ sensor_x = 0
+ sensor_y = 0
+ if hasattr(obj.data, "sensor_width"): # Preserve compatibility
+ if obj.data.sensor_fit == 'VERTICAL':
+ sensor_x = obj.data.sensor_width
+ sensor_y = obj.data.sensor_height
+ else:
+ sensor_x = obj.data.sensor_width
+ sensor_y = sensor_x * res_ratio
+ else:
+ sensor_x = 32 # standard blender's sensor size
+ sensor_y = sensor_x * res_ratio
+
cam_lens = obj.data.lens
+
# calculate the vertical field of view
# we know the vertical size of (virtual) sensor, the focal length
# of the camera so all we need to do is to feed this data to