From 599a8db33c45c2ad94f8d482f01b281252799770 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 26 Apr 2022 19:13:02 +1000 Subject: Fix T78854: Cell fracture fails in background mode Disable redrawing in background mode. --- object_fracture_cell/fracture_cell_setup.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/object_fracture_cell/fracture_cell_setup.py b/object_fracture_cell/fracture_cell_setup.py index dfd7975c..ccb1e204 100644 --- a/object_fracture_cell/fracture_cell_setup.py +++ b/object_fracture_cell/fracture_cell_setup.py @@ -7,13 +7,14 @@ import bpy import bmesh - -def _redraw_yasiamevil(): - _redraw_yasiamevil.opr(**_redraw_yasiamevil.arg) - - -_redraw_yasiamevil.opr = bpy.ops.wm.redraw_timer -_redraw_yasiamevil.arg = dict(type='DRAW_WIN_SWAP', iterations=1) +if bpy.app.background: + def _redraw_yasiamevil(): + pass +else: + def _redraw_yasiamevil(): + _redraw_yasiamevil.opr(**_redraw_yasiamevil.arg) + _redraw_yasiamevil.opr = bpy.ops.wm.redraw_timer + _redraw_yasiamevil.arg = dict(type='DRAW_WIN_SWAP', iterations=1) def _points_from_object(depsgraph, scene, obj, source): -- cgit v1.2.3