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:
authorPablo Vazquez <pablo@blender.org>2022-09-20 01:48:06 +0300
committerPablo Vazquez <pablo@blender.org>2022-09-20 01:48:06 +0300
commit36974bed34488753231261e771a60a5afbea7576 (patch)
tree467bcc62f1ae881318c028db6a275e675108ae2e /amaranth
parentcf773d42f07dcbd803b6e5973bac781b9fe3f5e1 (diff)
Amaranth: Fix Jump Keyframes layout
* Move into its own sub-panel inside the Keyframes panel
Diffstat (limited to 'amaranth')
-rw-r--r--amaranth/__init__.py2
-rw-r--r--amaranth/animation/jump_frames.py46
2 files changed, 22 insertions, 26 deletions
diff --git a/amaranth/__init__.py b/amaranth/__init__.py
index 4442e344..61d979b2 100644
--- a/amaranth/__init__.py
+++ b/amaranth/__init__.py
@@ -72,7 +72,7 @@ from amaranth.misc import (
bl_info = {
"name": "Amaranth Toolset",
"author": "Pablo Vazquez, Bassam Kurdali, Sergey Sharybin, Lukas Tönne, Cesar Saez, CansecoGPC",
- "version": (1, 0, 16),
+ "version": (1, 0, 17),
"blender": (3, 2, 0),
"location": "Everywhere!",
"description": "A collection of tools and settings to improve productivity",
diff --git a/amaranth/animation/jump_frames.py b/amaranth/animation/jump_frames.py
index db65709b..16dae391 100644
--- a/amaranth/animation/jump_frames.py
+++ b/amaranth/animation/jump_frames.py
@@ -16,7 +16,7 @@ Find it on the User Preferences, Editing.
"""
import bpy
-from bpy.types import Operator
+from bpy.types import Operator, Panel
from bpy.props import BoolProperty
KEYMAPS = list()
@@ -129,40 +129,35 @@ class AMTH_SCREEN_OT_frame_jump(Operator):
return {"FINISHED"}
-def ui_userpreferences_edit(self, context):
- get_addon = "amaranth" in context.preferences.addons.keys()
- if not get_addon:
- return
+class AMTH_USERPREF_PT_animation(Panel):
+ bl_space_type = 'PREFERENCES'
+ bl_region_type = 'WINDOW'
+ bl_label = "Jump Keyframes"
+ bl_parent_id = "USERPREF_PT_animation_keyframes"
- preferences = context.preferences.addons["amaranth"].preferences
-
- col = self.layout.column()
- split = col.split(factor=0.21)
- split.prop(preferences, "frames_jump",
- text="Frames to Jump")
-
-
-def label(self, context):
- get_addon = "amaranth" in context.preferences.addons.keys()
- if not get_addon:
- return
+ def draw(self, context):
+ preferences = context.preferences.addons["amaranth"].preferences
- layout = self.layout
+ layout = self.layout
- if context.preferences.addons["amaranth"].preferences.use_timeline_extra_info:
- row = layout.row(align=True)
+ col = layout.column()
+ row = col.row()
+ row.label(text="Frames to Jump")
+ row.prop(preferences, "frames_jump", text="")
+ col = layout.column()
+ row = col.row()
+ row.label(text="Jump Operators")
row.operator(AMTH_SCREEN_OT_keyframe_jump_inbetween.bl_idname,
- icon="PREV_KEYFRAME", text="").backwards = True
+ icon="PREV_KEYFRAME", text="Jump to Previous").backwards = True
row.operator(AMTH_SCREEN_OT_keyframe_jump_inbetween.bl_idname,
- icon="NEXT_KEYFRAME", text="").backwards = False
+ icon="NEXT_KEYFRAME", text="Jump to Next").backwards = False
def register():
+ bpy.utils.register_class(AMTH_USERPREF_PT_animation)
bpy.utils.register_class(AMTH_SCREEN_OT_frame_jump)
bpy.utils.register_class(AMTH_SCREEN_OT_keyframe_jump_inbetween)
- bpy.types.USERPREF_PT_animation_timeline.append(ui_userpreferences_edit)
- bpy.types.USERPREF_PT_animation_timeline.append(label)
# register keyboard shortcuts
wm = bpy.context.window_manager
@@ -189,9 +184,10 @@ def register():
def unregister():
+ bpy.utils.unregister_class(AMTH_USERPREF_PT_animation)
bpy.utils.unregister_class(AMTH_SCREEN_OT_frame_jump)
bpy.utils.unregister_class(AMTH_SCREEN_OT_keyframe_jump_inbetween)
- bpy.types.USERPREF_PT_animation_timeline.remove(ui_userpreferences_edit)
+
for km, kmi in KEYMAPS:
km.keymap_items.remove(kmi)
KEYMAPS.clear()