From 248d96324f7c53f089ee0b3bd03f151e7762c1c8 Mon Sep 17 00:00:00 2001 From: ionthedev <97857574+ionthedev@users.noreply.github.com> Date: Tue, 9 May 2023 16:21:47 -0500 Subject: [PATCH] Update 0.6.75 Added extra conditionals to the Auto Reload function. This is directly to make working with addons like Primambase a little more fluid. --- __init__.py | 2 +- sprytile_utils.py | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/__init__.py b/__init__.py index e45dfb9..f754f5d 100644 --- a/__init__.py +++ b/__init__.py @@ -2,7 +2,7 @@ "name": "ReSprytile", "author": "Jeiel Aranal Updated by: Brandon Friend", # Final version number must be two numerals to support x.x.00 - "version": (0, 6, 62), + "version": (0, 6, 75), "blender": (3, 4, 0), "description": "A utility for creating tile based low spec scenes with paint/map editor tools", "location": "View3D > UI panel > ReSprytile", diff --git a/sprytile_utils.py b/sprytile_utils.py index 0424e83..2cfbf2c 100644 --- a/sprytile_utils.py +++ b/sprytile_utils.py @@ -1248,7 +1248,7 @@ def modal(self, context, event): if context.scene.sprytile_data.auto_reload is False: self.cancel(context) return {'CANCELLED'} - + if self.check_files(): for window in context.window_manager.windows: for area in window.screen.areas: @@ -1281,13 +1281,18 @@ def invoke(self, context, event): self.last_check_time = None self.check_files() wm = context.window_manager - self._timer = wm.event_timer_add(2, window=context.window) + if self._timer is not None: + wm.event_timer_remove(self._timer) + self._timer = wm.event_timer_add(0.1, window=context.window) wm.modal_handler_add(self) return {'RUNNING_MODAL'} def cancel(self, context): wm = context.window_manager - wm.event_timer_remove(self._timer) + if isinstance(self._timer, bpy.types.Timer): + wm.event_timer_remove(self._timer) + self._timer = None + class UTIL_OP_SprytileUpdateCheck(bpy.types.Operator):