small fixes

This commit is contained in:
ChristopheSeux
2024-04-16 18:28:36 +02:00
parent 0055e0f39e
commit 7f60aae277
5 changed files with 37 additions and 25 deletions
+6 -2
View File
@@ -418,7 +418,11 @@ class WM_OT_split_view(Operator):
scn = context.scene
video_channels = [i for i, c in enumerate(scn.sequence_editor.channels) if 'Video' in c.name]
if len(video_channels) == 2 and len(preview_areas) == 1:
if len(video_channels) < 2:
self.report({"ERROR"}, 'You need two channels to split the view')
return {"CANCELLED"}
if len(preview_areas) == 1:
# Split area
with bpy.context.temp_override(area=preview_areas[0]):
bpy.ops.screen.area_split(direction="VERTICAL")
@@ -427,7 +431,7 @@ class WM_OT_split_view(Operator):
# Update areas
preview_areas = self.get_preview_areas(context)
preview_areas[-1].spaces[0].display_channel = video_channels[-1]
preview_areas[-1].spaces[0].display_channel = 0 #video_channels[-1]
preview_areas[0].spaces[0].display_channel = video_channels[-2]
preview_areas[0].spaces[0].show_gizmo_navigate = False