GPencil Tools: Fix timeline scrub snap
Due to API change, timeline scrub snapping crashed when setting scene frame
This commit is contained in:
parent
3a29996583
commit
82d7d6b8bd
|
@ -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": "",
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue