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:
authorCampbell Barton <ideasman42@gmail.com>2011-11-06 06:47:04 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-11-06 06:47:04 +0400
commit81771c7a18d982b0d17df3cf31eb60378e60fe8c (patch)
treeacfa70b24fd8ed1cbc84369b0f55756124727973
parent384d5473826ab927d0297142867ef0335c11c1d3 (diff)
write out camera sensor width and height into FBX
-rw-r--r--io_scene_fbx/export_fbx.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/io_scene_fbx/export_fbx.py b/io_scene_fbx/export_fbx.py
index e217f1cf..806c9030 100644
--- a/io_scene_fbx/export_fbx.py
+++ b/io_scene_fbx/export_fbx.py
@@ -235,6 +235,9 @@ def save_single(operator, scene, filepath="",
if global_matrix is None:
global_matrix = Matrix()
+ global_scale = 1.0
+ else:
+ global_scale = global_matrix.median_scale
# Use this for working out paths relative to the export location
base_src = os.path.dirname(bpy.data.filepath)
@@ -896,12 +899,14 @@ def save_single(operator, scene, filepath="",
'\n\t\t\tProperty: "ShowTimeCode", "bool", "",0'
)
- fw('\n\t\t\tProperty: "NearPlane", "double", "",%.6f' % data.clip_start)
- fw('\n\t\t\tProperty: "FarPlane", "double", "",%.6f' % data.clip_end)
+ fw('\n\t\t\tProperty: "NearPlane", "double", "",%.6f' % (data.clip_start * global_scale))
+ fw('\n\t\t\tProperty: "FarPlane", "double", "",%.6f' % (data.clip_end * global_scale))
- fw('\n\t\t\tProperty: "FilmWidth", "double", "",1.0'
- '\n\t\t\tProperty: "FilmHeight", "double", "",1.0'
- )
+ # film width & weight from mm to inches
+ # we could be clever and try use auto/width/hight but for now write
+ # as is.
+ fw('\n\t\t\tProperty: "FilmWidth", "double", "",%.6f' % (global_scale * (data.sensor_width * 0.0393700787)))
+ fw('\n\t\t\tProperty: "FilmHeight", "double", "",%.6f' % (global_scale * (data.sensor_height * 0.0393700787)))
fw('\n\t\t\tProperty: "FilmAspectRatio", "double", "",%.6f' % aspect)