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-08 19:29:38 +0400
committerMichael Krupa <kroopson@wp.pl>2011-12-08 19:29:38 +0400
commit3f139678404e0f76d2fae817d12e8c937d4f57eb (patch)
treebda96efea0e1ea7b49edb8331598355ecdebc507 /io_anim_nuke_chan
parent21eaa36c71f3714404b4a53a5f668662790154f3 (diff)
Updated to use bpy.types.Camera.angle_y property.
Diffstat (limited to 'io_anim_nuke_chan')
-rw-r--r--io_anim_nuke_chan/export_nuke_chan.py11
-rw-r--r--io_anim_nuke_chan/import_nuke_chan.py5
2 files changed, 4 insertions, 12 deletions
diff --git a/io_anim_nuke_chan/export_nuke_chan.py b/io_anim_nuke_chan/export_nuke_chan.py
index e0fdefb5..bdb8a87c 100644
--- a/io_anim_nuke_chan/export_nuke_chan.py
+++ b/io_anim_nuke_chan/export_nuke_chan.py
@@ -23,7 +23,7 @@ It takes the currently active object and writes it's transformation data
into a text file with .chan extension."""
from mathutils import Matrix
-from math import radians, degrees, atan2
+from math import radians, degrees
def save_chan(context, filepath, y_up, rot_ord):
@@ -73,14 +73,7 @@ def save_chan(context, filepath, y_up, rot_ord):
if camera:
sensor_x = camera.sensor_width
sensor_y = camera.sensor_height
- cam_lens = camera.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
- # atan2 function whitch returns the degree (in radians) of
- # an angle formed by a triangle with two legs of a given lengths
- vfov = degrees(atan2(sensor_y / 2, cam_lens)) * 2.0
+ vfov = degrees(camera.angle_y)
fw("%f" % vfov)
fw("\n")
diff --git a/io_anim_nuke_chan/import_nuke_chan.py b/io_anim_nuke_chan/import_nuke_chan.py
index 05bbfa0c..48103e09 100644
--- a/io_anim_nuke_chan/import_nuke_chan.py
+++ b/io_anim_nuke_chan/import_nuke_chan.py
@@ -21,7 +21,7 @@
""" This script is an importer for the nuke's .chan files"""
from mathutils import Vector, Matrix, Euler
-from math import radians, tan
+from math import radians
def read_chan(context, filepath, z_up, rot_ord, sensor_width, sensor_height):
@@ -103,11 +103,10 @@ def read_chan(context, filepath, z_up, rot_ord, sensor_width, sensor_height):
# check if the object is camera and fov data is present
if camera and len(data) > 7:
- v_fov = float(data[7])
camera.sensor_fit = 'HORIZONTAL'
camera.sensor_width = sensor_width
camera.sensor_height = sensor_height
- camera.lens = (sensor_height / 2.0) / tan(radians(v_fov / 2.0))
+ camera.angle_y = radiansfloat(data[7])
camera.keyframe_insert("lens")
filehandle.close()