From 86a5e050534f35e46ce9a687ef6d6e2d6bd30704 Mon Sep 17 00:00:00 2001 From: "Adam J. Jackson" Date: Thu, 1 Jun 2017 11:14:45 +0100 Subject: [PATCH] BUG: Reduce clip distance for orthographic view --- CHANGELOG.md | 1 + addons/vsim2blender/camera.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c955fd9..45759fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/addons/vsim2blender/camera.py b/addons/vsim2blender/camera.py index 4336373..407998a 100644 --- a/addons/vsim2blender/camera.py +++ b/addons/vsim2blender/camera.py @@ -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')