Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2022-04-26 12:13:02 +0300
committerCampbell Barton <ideasman42@gmail.com>2022-04-26 12:13:02 +0300
commit599a8db33c45c2ad94f8d482f01b281252799770 (patch)
tree1544bd23d8e130bb8bc22000574bba9582a64bd1
parentce23c93c2dbb860d891dce1993593feb3076ab1c (diff)
Fix T78854: Cell fracture fails in background mode
Disable redrawing in background mode.
-rw-r--r--object_fracture_cell/fracture_cell_setup.py15
1 files 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):