keyframe jump global UI filter

1.0.8:

- feat: Keyframe jump filter added in UI to change general behavior. Keymap own jump filter can override this new global settings if specified
gpv2
Pullusb 2021-05-02 23:14:38 +02:00
parent 02ed04cd3d
commit b193c67358
5 changed files with 36 additions and 11 deletions

View File

@ -26,15 +26,16 @@ class GPTB_OT_jump_gp_keyframe(bpy.types.Operator):
))
keyframe_type : EnumProperty(
name="Keyframe Filter", description="Only jump to defined keyframe type",
default='ALL', options={'HIDDEN', 'SKIP_SAVE'},
name="Keyframe Filter", description="Jump to choosen keyframe type, else use the UI jump filter",
default='NONE', options={'HIDDEN', 'SKIP_SAVE'},
items=(
('ALL', 'All', '', 0), # 'KEYFRAME'
('KEYFRAME', 'Keyframe', '', 'KEYTYPE_KEYFRAME_VEC', 1),
('BREAKDOWN', 'Breakdown', '', 'KEYTYPE_BREAKDOWN_VEC', 2),
('MOVING_HOLD', 'Moving Hold', '', 'KEYTYPE_MOVING_HOLD_VEC', 3),
('EXTREME', 'Extreme', '', 'KEYTYPE_EXTREME_VEC', 4),
('JITTER', 'Jitter', '', 'KEYTYPE_JITTER_VEC', 5),
('NONE', 'Use UI Filter', '', 0), # 'KEYFRAME'
('ALL', 'All', '', 1),
('KEYFRAME', 'Keyframe', '', 'KEYTYPE_KEYFRAME_VEC', 2),
('BREAKDOWN', 'Breakdown', '', 'KEYTYPE_BREAKDOWN_VEC', 3),
('MOVING_HOLD', 'Moving Hold', '', 'KEYTYPE_MOVING_HOLD_VEC', 4),
('EXTREME', 'Extreme', '', 'KEYTYPE_EXTREME_VEC', 5),
('JITTER', 'Jitter', '', 'KEYTYPE_JITTER_VEC', 6),
))
def execute(self, context):
@ -53,6 +54,11 @@ class GPTB_OT_jump_gp_keyframe(bpy.types.Operator):
elif self.target == 'ACCESSIBLE':
gpl = [l for l in context.object.data.layers if not l.hide and not l.lock]
if self.keyframe_type != 'NONE':
# use shortcut choice override
kftype = self.keyframe_type
else:
kftype = context.scene.gptoolprops.keyframe_type
current = context.scene.frame_current
p = n = None
@ -62,7 +68,7 @@ class GPTB_OT_jump_gp_keyframe(bpy.types.Operator):
for l in gpl:
for f in l.frames:
# keyframe type filter
if self.keyframe_type != 'ALL' and f.keyframe_type != self.keyframe_type:
if kftype != 'ALL' and f.keyframe_type != kftype:
continue
if f.frame_number < current:

View File

@ -112,6 +112,9 @@ Panel in sidebar : 3D view > sidebar 'N' > Gpencil
## Changelog:
1.0.8:
- feat: Keyframe jump filter added in UI to change general behavior. Keymap own jump filter can override this new global settings if specified
1.0.7:

View File

@ -132,6 +132,10 @@ class GPTB_PT_sidebar_panel(bpy.types.Panel):
## Options
layout.separator()
layout.label(text = 'Options:')
## Kf Jump filter
layout.prop(context.scene.gptoolprops, 'keyframe_type', text='Jump On') # Keyframe Jump
# row = layout.row(align=False)
## maybe remove cursor_follow icon that look like
text, icon = ('Cursor Follow On', 'PIVOT_CURSOR') if context.scene.gptoolprops.cursor_follow else ('Cursor Follow Off', 'CURSOR')

View File

@ -15,7 +15,7 @@ bl_info = {
"name": "GP toolbox",
"description": "Set of tools for Grease Pencil in animation production",
"author": "Samuel Bernou",
"version": (1, 0, 7),
"version": (1, 0, 8),
"blender": (2, 91, 0),
"location": "sidebar (N menu) > Gpencil > Toolbox / Gpencil properties",
"warning": "",
@ -235,7 +235,7 @@ class GPTB_prefs(bpy.types.AddonPreferences):
## KF jumper
kfj_use_shortcut: BoolProperty(
name = "Use Keyframe Jump Shortcut",
description = "Auto bind shotcut for keyframe jump (else you can bien manually using 'screen.gp_keyframe_jump' id_name)",
description = "Auto bind shotcut for keyframe jump (else you can bind manually using 'screen.gp_keyframe_jump' id_name)",
default = True)
kfj_prev_keycode : StringProperty(

View File

@ -4,6 +4,7 @@ from bpy.props import (
BoolProperty,
StringProperty,
FloatProperty,
EnumProperty,
)
from .OP_cursor_snap_canvas import cursor_follow_update
@ -44,6 +45,17 @@ class GP_PG_ToolsSettings(bpy.types.PropertyGroup) :
name="Render_name", description="Name use for render current",
default="")
keyframe_type : EnumProperty(
name="Keyframe Filter", description="Only jump to defined keyframe type",
default='ALL', options={'HIDDEN', 'SKIP_SAVE'},
items=(
('ALL', 'All', '', 0), # 'KEYFRAME'
('KEYFRAME', 'Keyframe', '', 'KEYTYPE_KEYFRAME_VEC', 1),
('BREAKDOWN', 'Breakdown', '', 'KEYTYPE_BREAKDOWN_VEC', 2),
('MOVING_HOLD', 'Moving Hold', '', 'KEYTYPE_MOVING_HOLD_VEC', 3),
('EXTREME', 'Extreme', '', 'KEYTYPE_EXTREME_VEC', 4),
('JITTER', 'Jitter', '', 'KEYTYPE_JITTER_VEC', 5),
))
"""
reconnect_parent = bpy.props.PointerProperty(type =bpy.types.Object,poll=poll_armature)