Skip to content

Commit

Permalink
Fixed a bug, where the scene is not being set properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Baintner committed Jan 21, 2024
1 parent e4425e8 commit dcc0964
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions utils_bpy/render_settings_setter.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ def set_scene(self, scene_name: str) -> None:
else:
try:
self.current_scene_data = bpy.data.scenes[scene_name]
bpy.context.window.scene = self.current_scene_data
except KeyError:
print_utils.print_error(f"Scene {scene_name} not found!")
self.current_scene_data = bpy.context.scene
self.current_scene_render = self.current_scene_data.render
print_utils.print_info(f"Rendering scene {self.current_scene_data.name}.")

def set_view_layers(self, view_layer_names: List[str]):
"""Set the view layer to be rendered."""
Expand Down Expand Up @@ -171,6 +174,7 @@ def set_output_settings(self, frame_step: int, xres: int,
self.current_scene_data.frame_step = frame_step
self.current_scene_data.render.use_stamp = not high_quality
print_utils.print_info("Finished setting the rendering settings!")
print_utils.print_info(bpy.context.scene)

def custom_commands(self) -> None:
"""Import user commands."""
Expand Down

0 comments on commit dcc0964

Please sign in to comment.