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:
authorPullusb <bernou.samuel@gmail.com>2022-03-14 21:51:31 +0300
committerPullusb <bernou.samuel@gmail.com>2022-03-14 21:51:31 +0300
commit82d7d6b8bdec8dfc47c5366607f40b8ff219a718 (patch)
tree664302ec6bf0f3d80f500b36beda5b8677d7b8d3
parent3a299965833c65ae76a324a5540bcf5b31a3b669 (diff)
GPencil Tools: Fix timeline scrub snap
Due to API change, timeline scrub snapping crashed when setting scene frame
-rw-r--r--greasepencil_tools/__init__.py2
-rw-r--r--greasepencil_tools/timeline_scrub.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/greasepencil_tools/__init__.py b/greasepencil_tools/__init__.py
index 18b808c4..0205362b 100644
--- a/greasepencil_tools/__init__.py
+++ b/greasepencil_tools/__init__.py
@@ -4,7 +4,7 @@ bl_info = {
"name": "Grease Pencil Tools",
"description": "Extra tools for Grease Pencil",
"author": "Samuel Bernou, Antonio Vazquez, Daniel Martinez Lara, Matias Mendiola",
-"version": (1, 5, 6),
+"version": (1, 5, 7),
"blender": (2, 91, 0),
"location": "Sidebar > Grease Pencil > Grease Pencil Tools",
"warning": "",
diff --git a/greasepencil_tools/timeline_scrub.py b/greasepencil_tools/timeline_scrub.py
index 8f058ed9..eaccab99 100644
--- a/greasepencil_tools/timeline_scrub.py
+++ b/greasepencil_tools/timeline_scrub.py
@@ -21,13 +21,13 @@ from bpy.props import (BoolProperty,
EnumProperty)
-def nearest(array, value):
+def nearest(array, value) -> int:
'''
Get a numpy array and a target value
Return closest val found in array to passed value
'''
idx = (np.abs(array - value)).argmin()
- return array[idx]
+ return int(array[idx])
def draw_callback_px(self, context):