UI: Movie Clip Editor: Add Overlays Support

Move several clip and mask display options into a common Overlays popover,
consistent with other editors. Includes a global toggle (Shift-Alt-Z) to
show/hide all overlays at once.

Also adds the missing annotations toggle, cursor visibility toggle, and moves mask display options in
the Image Editor into the Overlays popover due to shared code paths.

See PR for images.

Pull Request: https://projects.blender.org/blender/blender/pulls/145895
This commit is contained in:
Aaron Carlisle
2025-09-24 23:51:06 +02:00
committed by Aaron Carlisle
parent e0392599f8
commit 18d0532915
15 changed files with 201 additions and 58 deletions

View File

@@ -3543,6 +3543,8 @@ def km_clip_editor(params):
("clip.cursor_set", params.cursor_set_event, None),
("clip.copy_tracks", {"type": 'C', "value": 'PRESS', "ctrl": True}, None),
("clip.paste_tracks", {"type": 'V', "value": 'PRESS', "ctrl": True}, None),
("wm.context_toggle", {"type": 'Z', "value": 'PRESS', "alt": True, "shift": True},
{"properties": [("data_path", "space_data.overlay.show_overlays")]}),
*_template_items_context_menu("CLIP_MT_tracking_context_menu", params.context_menu_event),
])

View File

@@ -36,38 +36,6 @@ class CLIP_PT_display(Panel):
pass
class CLIP_PT_marker_display(Panel):
bl_space_type = 'CLIP_EDITOR'
bl_region_type = 'HEADER'
bl_label = "Marker Display"
bl_parent_id = "CLIP_PT_display"
bl_ui_units_x = 13
def draw(self, context):
layout = self.layout
view = context.space_data
row = layout.row()
col = row.column()
col.prop(view, "show_marker_pattern", text="Pattern")
col.prop(view, "show_marker_search", text="Search")
col.prop(view, "show_track_path", text="Path")
col = col.column()
col.active = view.show_track_path
col.prop(view, "path_length", text="Length")
col = row.column()
col.prop(view, "show_disabled", text="Show Disabled")
col.prop(view, "show_names", text="Info")
if view.mode != 'MASK':
col.prop(view, "show_bundles", text="3D Markers")
col.prop(view, "show_tiny_markers", text="Display Thin")
class CLIP_PT_clip_display(Panel):
bl_space_type = 'CLIP_EDITOR'
bl_region_type = 'HEADER'
@@ -98,7 +66,6 @@ class CLIP_PT_clip_display(Panel):
col.prop(sc.clip_user, "use_render_undistorted", text="Render Undistorted")
col = row.column()
col.prop(sc, "show_stable", text="Show Stable")
col.prop(sc, "show_grid", text="Grid")
col.prop(sc, "use_manual_calibration", text="Calibration")
clip = sc.clip
@@ -236,7 +203,6 @@ class CLIP_HT_header(Header):
row = layout.row()
row.template_ID(sc, "mask", new="mask.new")
row.popover(panel="CLIP_PT_mask_display")
row = layout.row(align=True)
icon = 'LOCKED' if sc.lock_selection else 'UNLOCKED'
row.operator("clip.lock_selection_toggle", icon=icon, text="", depress=sc.lock_selection)
@@ -246,6 +212,7 @@ class CLIP_HT_header(Header):
layout = self.layout
sc = context.space_data
overlay = sc.overlay
layout.template_header()
@@ -263,6 +230,14 @@ class CLIP_HT_header(Header):
sub.active = sc.show_gizmo
sub.popover(panel="CLIP_PT_gizmo_display", text="")
# Overlay toggle & popover.
if sc.view == 'CLIP':
row = layout.row(align=True)
row.prop(overlay, "show_overlays", icon='OVERLAY', text="")
sub = row.row(align=True)
sub.active = overlay.show_overlays
sub.popover(panel="CLIP_PT_overlay", text="")
class CLIP_PT_proportional_edit(Panel):
bl_space_type = 'CLIP_EDITOR'
@@ -1236,10 +1211,6 @@ class CLIP_PT_tools_mask_tools(MASK_PT_tools, Panel):
bl_category = "Mask"
class CLIP_PT_mask_display(MASK_PT_display, Panel):
bl_space_type = 'CLIP_EDITOR'
bl_region_type = 'HEADER'
# --- end mask ---
@@ -1960,6 +1931,77 @@ class CLIP_MT_view_pie(Menu):
pie.operator("clip.graph_center_current_frame")
class CLIP_PT_overlay_display(Panel):
bl_space_type = 'CLIP_EDITOR'
bl_region_type = 'HEADER'
bl_label = "Marker Display"
bl_parent_id = "CLIP_PT_overlay"
def draw(self, context):
layout = self.layout
view = context.space_data
row = layout.row()
col = row.column()
col.prop(view, "show_marker_pattern", text="Pattern")
col.prop(view, "show_marker_search", text="Search")
col.prop(view, "show_track_path", text="Path")
col = col.column()
col.active = view.show_track_path
col.prop(view, "path_length", text="Length")
col = row.column()
col.prop(view, "show_disabled", text="Show Disabled")
col.prop(view, "show_names", text="Info")
if view.mode != 'MASK':
col.prop(view, "show_bundles", text="3D Markers")
col.prop(view, "show_tiny_markers", text="Display Thin")
class CLIP_PT_overlay_mask(MASK_PT_display, Panel):
bl_space_type = 'CLIP_EDITOR'
bl_region_type = 'HEADER'
bl_parent_id = "CLIP_PT_overlay"
@classmethod
def poll(cls, context):
sc = context.space_data
return sc.mode == 'MASK'
class CLIP_PT_overlay_guides(Panel):
bl_space_type = 'CLIP_EDITOR'
bl_region_type = 'HEADER'
bl_parent_id = "CLIP_PT_overlay"
bl_label = "Guides"
def draw(self, context):
layout = self.layout
sc = context.space_data
overlay = sc.overlay
col = layout.column()
col.prop(sc, "show_grid", text="Distortion Grid")
col.prop(overlay, "show_cursor", text="Cursor")
col.prop(sc, "show_annotation", text="Annotations")
class CLIP_PT_overlay(Panel):
bl_space_type = 'CLIP_EDITOR'
bl_region_type = 'HEADER'
bl_label = "Overlays"
bl_ui_units_x = 13
def draw(self, _context):
layout = self.layout
layout.label(text="Viewport Overlays")
class CLIP_PT_gizmo_display(Panel):
bl_space_type = 'CLIP_EDITOR'
bl_region_type = 'HEADER'
@@ -1986,7 +2028,6 @@ classes = (
CLIP_HT_header,
CLIP_PT_display,
CLIP_PT_clip_display,
CLIP_PT_marker_display,
CLIP_MT_tracking_editor_menus,
CLIP_MT_masking_editor_menus,
CLIP_PT_track,
@@ -2015,7 +2056,6 @@ classes = (
CLIP_PT_2d_cursor,
CLIP_PT_mask,
CLIP_PT_mask_layers,
CLIP_PT_mask_display,
CLIP_PT_active_mask_spline,
CLIP_PT_active_mask_point,
CLIP_PT_mask_animation,
@@ -2053,6 +2093,10 @@ classes = (
CLIP_MT_reconstruction_pie,
CLIP_MT_solving_pie,
CLIP_MT_view_pie,
CLIP_PT_overlay,
CLIP_PT_overlay_guides,
CLIP_PT_overlay_mask,
CLIP_PT_overlay_display,
CLIP_PT_gizmo_display,
)

View File

@@ -942,9 +942,6 @@ class IMAGE_HT_header(Header):
if ima.is_stereo_3d:
row = layout.row()
row.prop(sima, "show_stereo_3d", text="")
if show_maskedit:
row = layout.row()
row.popover(panel="IMAGE_PT_mask_display")
# layers.
layout.template_image_layers(ima, iuser)
@@ -1043,11 +1040,6 @@ class IMAGE_PT_mask_animation(MASK_PT_animation, Panel):
bl_category = "Mask"
class IMAGE_PT_mask_display(MASK_PT_display, Panel):
bl_space_type = 'IMAGE_EDITOR'
bl_region_type = 'HEADER'
# --- end mask ---
class IMAGE_PT_snapping(Panel):
@@ -1787,6 +1779,18 @@ class IMAGE_PT_overlay_render_guides(Panel):
subrow.prop(overlay, "passepartout_alpha", text="Passepartout")
class IMAGE_PT_overlay_mask(MASK_PT_display, Panel):
bl_space_type = 'IMAGE_EDITOR'
bl_region_type = 'HEADER'
bl_parent_id = "IMAGE_PT_overlay"
@classmethod
def poll(cls, context):
si = context.space_data
return si.ui_mode == 'MASK'
# Grease Pencil properties
class IMAGE_PT_annotation(AnnotationDataPanel, Panel):
bl_space_type = 'IMAGE_EDITOR'
@@ -1840,7 +1844,6 @@ classes = (
IMAGE_PT_active_tool,
IMAGE_PT_mask,
IMAGE_PT_mask_layers,
IMAGE_PT_mask_display,
IMAGE_PT_active_mask_spline,
IMAGE_PT_active_mask_point,
IMAGE_PT_mask_animation,
@@ -1882,6 +1885,7 @@ classes = (
IMAGE_PT_overlay_uv_display,
IMAGE_PT_overlay_image,
IMAGE_PT_overlay_render_guides,
IMAGE_PT_overlay_mask,
IMAGE_AST_brush_paint,
)