Fix Split Strips operator not showing shortcut #113143

Merged
Sergey Sharybin merged 3 commits from Sergey/blender:vse_split_strip_shortcut into blender-v4.0-release 2023-10-02 16:20:39 +02:00

This is because the menu entry was using different operator
properties from what the shortcut is defined for. It was needed
to make it so an operator which is called from the menu does not
have dependency on the mouse location.

Now it is achieved by resolving MOUSE side to RIGHT from the
operator's exec().

Ref #112598

This is because the menu entry was using different operator properties from what the shortcut is defined for. It was needed to make it so an operator which is called from the menu does not have dependency on the mouse location. Now it is achieved by resolving MOUSE side to RIGHT from the operator's exec(). Ref #112598
Sergey Sharybin added the
Interest
Video Sequencer
Module
VFX & Video
labels 2023-10-02 14:36:49 +02:00
Sergey Sharybin added 1 commit 2023-10-02 14:37:00 +02:00
8570a62584 Fix Split Strips operator not showing shortcut
This is because the menu entry was using different operator
properties from what the shortcut is defined for. It was needed
to make it so an operator which is called from the menu does not
have dependency on the mouse location.

Now it is achieved by resolving MOUSE side to RIGHT from the
operator's exec().

Ref ##112598
Sergey Sharybin requested review from Richard Antalik 2023-10-02 14:39:30 +02:00
Richard Antalik approved these changes 2023-10-02 15:05:13 +02:00
@ -20,6 +20,7 @@ from bl_ui.space_toolsystem_common import (
ToolActivePanelHelper,
)
from rna_prop_ui import PropertyPanel
from bl_ui_utils.layout import operator_context

Not quite sure why this change is needed.

Not quite sure why this change is needed.
Author
Owner

A part of the patch got lost. It was supposed to be

            with operator_context(layout, 'EXEC_DEFAULT'):
                props = layout.operator("sequencer.split", text="Split")
                props.type = 'SOFT'

                props = layout.operator("sequencer.split", text="Hold Split")
                props.type = 'HARD'

later on. I guess the autopep8 got stuck for too long, and i did commit before it finished =\

The annoying part is: for some reason changing the operator_context makes shortcuts to go missing from the menu. Need to have a deeper look.

A part of the patch got lost. It was supposed to be ``` with operator_context(layout, 'EXEC_DEFAULT'): props = layout.operator("sequencer.split", text="Split") props.type = 'SOFT' props = layout.operator("sequencer.split", text="Hold Split") props.type = 'HARD' ``` later on. I guess the autopep8 got stuck for too long, and i did commit before it finished =\ The annoying part is: for some reason changing the `operator_context` makes shortcuts to go missing from the menu. Need to have a deeper look.

Ah, I see now. Because with current state shortcut shows up, but didn't notice, that it defaults to SEQ_SIDE_MOUSE.
I wonder whether other editors do use same approach to show operator shortcuts as this seems to be a bit hacky. I could imagine having some flag for properties, that are not "significant", so shortcut could be shown. But this could go also multilple levels deep, so not sure if that would be great idea.

Ah, I see now. Because with current state shortcut shows up, but didn't notice, that it defaults to `SEQ_SIDE_MOUSE`. I wonder whether other editors do use same approach to show operator shortcuts as this seems to be a bit hacky. I could imagine having some flag for properties, that are not "significant", so shortcut could be shown. But this could go also multilple levels deep, so not sure if that would be great idea.
Sergey Sharybin changed title from Fix Split Strips operator not showing shortcut to WIP: Fix Split Strips operator not showing shortcut 2023-10-02 15:20:07 +02:00
Sergey Sharybin added 1 commit 2023-10-02 15:21:13 +02:00
c49332964e Add missing operator context override
Unfortunately, it makes it so shortcuts are not shown in the menu.
Sergey Sharybin added 1 commit 2023-10-02 15:34:51 +02:00
db1bb4eff0 Make the operator to actually when exec from the menu
- Use EXEC_REGION_WIN as this allows hsortcut to be displayed
- Access frame from the scene in the exec unless mouse cursor is requested
Sergey Sharybin changed title from WIP: Fix Split Strips operator not showing shortcut to Fix Split Strips operator not showing shortcut 2023-10-02 15:35:02 +02:00
Author
Owner

Did tweaks to the code. A bit more tricky, but mostly because the operator tries to do too many things already. The "explicit" behavior and mouse-dependent one shouldn't really be merged together. lets give it another whirl!

Did tweaks to the code. A bit more tricky, but mostly because the operator tries to do too many things already. The "explicit" behavior and mouse-dependent one shouldn't really be merged together. lets give it another whirl!
Sergey Sharybin requested review from Richard Antalik 2023-10-02 15:36:13 +02:00
Richard Antalik approved these changes 2023-10-02 15:54:43 +02:00
Sergey Sharybin merged commit 0e01667e25 into blender-v4.0-release 2023-10-02 16:20:39 +02:00
Sergey Sharybin deleted branch vse_split_strip_shortcut 2023-10-02 16:20:41 +02:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#113143
No description provided.