From 084eec36977c9a084aa020031f4a1aa0f0352170 Mon Sep 17 00:00:00 2001
From: Jacques Lucke <mail@jlucke.com>
Date: Wed, 3 Jun 2020 10:54:49 +0200
Subject: [PATCH] Fix T76900: Tri-lighting addon broken when there was no
 camera

Reviewers: lichtwerk

Differential Revision: https://developer.blender.org/D7861
---
 lighting_tri_lights.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lighting_tri_lights.py b/lighting_tri_lights.py
index a5478974a..f86972ed5 100644
--- a/lighting_tri_lights.py
+++ b/lighting_tri_lights.py
@@ -142,7 +142,8 @@ class OBJECT_OT_TriLighting(Operator):
                 scene.camera = cam_obj
                 bpy.ops.view3d.camera_to_view()
                 camera = cam_obj
-                bpy.ops.view3d.view_axis(type='TOP')
+                # Leave camera view again, otherwise redo does not work correctly.
+                bpy.ops.view3d.view_camera()
 
             obj = bpy.context.view_layer.objects.active
 
-- 
GitLab