Skip to content

Commit

Permalink
BUG: Reduce clip distance for orthographic view
Browse files Browse the repository at this point in the history
  • Loading branch information
ajjackson committed Jun 1, 2017
1 parent 488b2b2 commit 86a5e05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The changelog format is inspired by [keep-a-changelog](https://github.com/olivie

### Fixes
- Orthographic projection flag *actually* enabled in CLI
- Camera clipping causing problems in orthographic view, reduce draw distance.

## [1.1.0] - 2017-03-14

Expand Down
4 changes: 3 additions & 1 deletion addons/vsim2blender/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ def setup_camera(lattice_vectors, field_of_view=0.5,
if orthographic:
bpy.data.cameras[camera.name].type = 'ORTHO'
bpy.data.cameras[camera.name].ortho_scale = camera_distance/2.5
# Limit clipping to avoid nasty glitches in orthographic mode
bpy.data.cameras[camera.name].clip_end = 10000
else:
bpy.data.cameras[camera.name].angle = field_of_view
bpy.data.cameras[camera.name].clip_end = 1e8
bpy.data.cameras[camera.name].clip_end = 1e8

# Use tracking to point camera at center of structure
bpy.ops.object.constraint_add(type='TRACK_TO')
Expand Down

0 comments on commit 86a5e05

Please sign in to comment.