Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-addons
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
blender-addons
Commits
07584de9
Commit
07584de9
authored
13 years ago
by
Michael Krupa
Browse files
Options
Downloads
Patches
Plain Diff
Updated to use the sensor size in blender 2.61
parent
370b15a0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
io_anim_nuke_chan/export_nuke_chan.py
+14
-6
14 additions, 6 deletions
io_anim_nuke_chan/export_nuke_chan.py
io_anim_nuke_chan/import_nuke_chan.py
+13
-3
13 additions, 3 deletions
io_anim_nuke_chan/import_nuke_chan.py
with
27 additions
and
9 deletions
io_anim_nuke_chan/export_nuke_chan.py
+
14
−
6
View file @
07584de9
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
io_anim_nuke_chan/import_nuke_chan.py
+
13
−
3
View file @
07584de9
...
...
@@ -106,9 +106,19 @@ def read_chan(context, filepath, z_up, rot_ord):
# check if the object is camera and fov data is present
if
obj
.
type
==
'
CAMERA
'
and
len
(
data
)
>
7
:
v_fov
=
float
(
data
[
7
])
sensor_v
=
32.0
sensor_h
=
sensor_v
*
res_ratio
lenslen
=
((
sensor_h
/
2.0
)
/
tan
(
radians
(
v_fov
/
2.0
)))
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
lenslen
=
((
sensor_y
/
2.0
)
/
tan
(
radians
(
v_fov
/
2.0
)))
obj
.
data
.
lens
=
lenslen
obj
.
data
.
keyframe_insert
(
"
lens
"
)
filehandle
.
close
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment