GPencil Tools: Fix T90976 Timeline-scrub toggle
Add a checkbox in preference to Disable timeline-scrub feature. Following task https://developer.blender.org/T90976 required for industry standard keymap conflict. Also Add {key Numpad Enter} to valid Box-deform (following user request https://github.com/Pullusb/greasepencil-addon/issues/8)
This commit is contained in:
parent
104ba1c568
commit
326e03a597
Notes:
blender-bot
2023-02-14 18:32:30 +01:00
Referenced by issue #90976, Grease Pencil Time Line Scrub, Overrides Industry Keymap
|
@ -21,7 +21,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, 2),
|
||||
"version": (1, 5, 3),
|
||||
"blender": (2, 91, 0),
|
||||
"location": "Sidebar > Grease Pencil > Grease Pencil Tools",
|
||||
"warning": "",
|
||||
|
|
|
@ -333,7 +333,7 @@ def cancel_cage(self):
|
|||
self.gp_obj.grease_pencil_modifiers.remove(mod)
|
||||
else:
|
||||
print(f'tmp_lattice modifier not found to remove on {self.gp_obj.name}')
|
||||
|
||||
|
||||
for ob in self.other_gp:
|
||||
mod = ob.grease_pencil_modifiers.get('tmp_lattice')
|
||||
if mod:
|
||||
|
@ -458,7 +458,7 @@ valid:Spacebar/Enter, cancel:Del/Backspace/Tab/Ctrl+T"
|
|||
return {"RUNNING_MODAL"}
|
||||
|
||||
# Valid
|
||||
if event.type in {'RET', 'SPACE'}:
|
||||
if event.type in {'RET', 'SPACE', 'NUMPAD_ENTER'}:
|
||||
if event.value == 'PRESS':
|
||||
context.window_manager.boxdeform_running = False
|
||||
self.restore_prefs(context)
|
||||
|
@ -586,7 +586,7 @@ valid:Spacebar/Enter, cancel:Del/Backspace/Tab/Ctrl+T"
|
|||
## silent return
|
||||
return {'CANCELLED'}
|
||||
|
||||
|
||||
|
||||
# bpy.ops.ed.undo_push(message="Box deform step")#don't work as expected (+ might be obsolete)
|
||||
# https://developer.blender.org/D6147 <- undo forget
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ class GreasePencilAddonPrefs(bpy.types.AddonPreferences):
|
|||
name = "Use Hud",
|
||||
description = "Display angle lines and angle value as text on viewport",
|
||||
default = False)
|
||||
|
||||
|
||||
canvas_use_view_center: BoolProperty(
|
||||
name = "Rotate From View Center In Camera",
|
||||
description = "Rotate from view center in camera view, Else rotate from camera center",
|
||||
|
|
|
@ -211,7 +211,7 @@ class GPTS_OT_time_scrub(bpy.types.Operator):
|
|||
else:
|
||||
self.init_index = 0
|
||||
self.init_frame = self.new_frame = self.pos[0]
|
||||
|
||||
|
||||
# del active_pos
|
||||
self.index_limit = len(self.pos) - 1
|
||||
|
||||
|
@ -311,14 +311,14 @@ class GPTS_OT_time_scrub(bpy.types.Operator):
|
|||
shader = gpu.shader.from_builtin('2D_UNIFORM_COLOR') # initiate shader
|
||||
self.batch_timeline = batch_for_shader(
|
||||
shader, 'LINES', {"pos": self.hud_lines})
|
||||
|
||||
|
||||
if self.rolling_mode:
|
||||
current_id = self.pos.index(self.new_frame)
|
||||
# Add init_frame to "cancel" it in later UI code
|
||||
ui_key_pos = [i - current_id + self.init_frame for i, _f in enumerate(self.pos[:-2])]
|
||||
else:
|
||||
ui_key_pos = self.pos[:-2]
|
||||
|
||||
|
||||
|
||||
# keyframe display
|
||||
if self.keyframe_aspect == 'LINE':
|
||||
|
@ -555,6 +555,12 @@ class GPTS_timeline_settings(bpy.types.PropertyGroup):
|
|||
description="Alternative Gap-less timeline. No time informations to quickly roll/flip over keys\nOverride normal and 'always snap' mode",
|
||||
default=False)
|
||||
|
||||
use: BoolProperty(
|
||||
name="Enable",
|
||||
description="Enable/Disable timeline scrub",
|
||||
default=True,
|
||||
update=auto_rebind)
|
||||
|
||||
use_in_timeline_editor: BoolProperty(
|
||||
name="Shortcut in timeline editors",
|
||||
description="Add the same shortcut to scrub in timeline editor windows",
|
||||
|
@ -681,6 +687,9 @@ class GPTS_timeline_settings(bpy.types.PropertyGroup):
|
|||
def draw_ts_pref(prefs, layout):
|
||||
# - General settings
|
||||
layout.label(text='Timeline Scrub:')
|
||||
layout.prop(prefs, 'use')
|
||||
if not prefs.use:
|
||||
return
|
||||
layout.prop(prefs, 'evaluate_gp_obj_key')
|
||||
layout.prop(prefs, 'pixel_step')
|
||||
|
||||
|
@ -716,7 +725,7 @@ def draw_ts_pref(prefs, layout):
|
|||
snap_text = 'Disable keyframes snap: '
|
||||
else:
|
||||
snap_text = 'Keyframes snap: '
|
||||
|
||||
|
||||
snap_text += 'Left Mouse' if prefs.keycode == 'RIGHTMOUSE' else 'Right Mouse'
|
||||
if not prefs.use_ctrl:
|
||||
snap_text += ' or Ctrl'
|
||||
|
@ -724,7 +733,7 @@ def draw_ts_pref(prefs, layout):
|
|||
snap_text += ' or Shift'
|
||||
if not prefs.use_alt:
|
||||
snap_text += ' or Alt'
|
||||
|
||||
|
||||
if prefs.rolling_mode:
|
||||
snap_text = 'Gap-less mode (always snap)'
|
||||
|
||||
|
@ -769,6 +778,9 @@ addon_keymaps = []
|
|||
|
||||
def register_keymaps():
|
||||
prefs = get_addon_prefs().ts
|
||||
if not prefs.use:
|
||||
return
|
||||
|
||||
addon = bpy.context.window_manager.keyconfigs.addon
|
||||
km = addon.keymaps.new(name="Grease Pencil",
|
||||
space_type="EMPTY", region_type='WINDOW')
|
||||
|
|
Loading…
Reference in New Issue