Skip to content

Commit

Permalink
render terminal op - suppress errors while saving the blend
Browse files Browse the repository at this point in the history
  • Loading branch information
p2or committed Jun 16, 2024
1 parent 08fedfd commit e9dc33c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions loom.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from bpy_extras.io_utils import ImportHelper, ExportHelper
from bl_operators.presets import AddPresetBase
from bl_ui.utils import PresetPanel
from contextlib import suppress
from numpy import arange, around, isclose
from itertools import count, groupby
from time import strftime
Expand Down Expand Up @@ -3692,8 +3693,11 @@ def poll(cls, context):
def execute(self, context):
prefs = context.preferences.addons[__name__].preferences

if bpy.data.is_dirty: # Save latest changes
bpy.ops.wm.save_as_mainfile(filepath=bpy.data.filepath)
if bpy.data.is_dirty:
# Save latest changes and suppress visual errors
with suppress(RuntimeError):
bpy.ops.wm.save_as_mainfile(
filepath=bpy.data.filepath)

python_expr = ("import bpy;" +\
"bpy.ops.render.image_sequence(" +\
Expand Down

0 comments on commit e9dc33c

Please sign in to comment.