Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
SAM-tak committed Aug 26, 2022
1 parent 8d69d84 commit 81ab69c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,12 +594,6 @@ def clean_up(self, context):

def render_image(self, direction):

# update focus distance if focus object is set
if self.camera.data.dof.use_dof and self.camera_origin.data.dof.focus_object is not None:
focus_location = self.camera_origin.data.dof.focus_object.matrix_world.translation
icm = self.camera_origin.matrix_world.inverted_safe()
self.camera.data.dof.focus_distance = abs((icm @ focus_location).z)

# Render the image and load it into the script
name = f'temp_img_store_{os.getpid()}_{direction}'
if self.is_stereo:
Expand Down Expand Up @@ -686,6 +680,12 @@ def render_image(self, direction):

def render_images(self):

# update focus distance if focus object is set
if self.camera.data.dof.use_dof and self.camera_origin.data.dof.focus_object is not None:
focus_location = self.camera_origin.data.dof.focus_object.matrix_world.translation
icm = self.camera_origin.matrix_world.inverted_safe()
self.camera.data.dof.focus_distance = abs((icm @ focus_location).z)

# Render the images for every direction
image_list_l = []
image_list_r = []
Expand Down

0 comments on commit 81ab69c

Please sign in to comment.