Fix T59526: VSE Add submenus for clips/masks dont show with only one

item
This commit is contained in:
Philipp Oeser 2018-12-28 15:27:06 +01:00
parent 3610f1fc43
commit 8c01cafabf
Notes: blender-bot 2023-02-14 04:25:21 +01:00
Referenced by issue #59526, VSE: Add menu scenes, clips and masks submenus do not show with only one clip or mask
1 changed files with 2 additions and 2 deletions

View File

@ -329,7 +329,7 @@ class SEQUENCER_MT_add(Menu):
if len(bpy.data.movieclips) > 10:
layout.operator_context = 'INVOKE_DEFAULT'
layout.operator("sequencer.movieclip_strip_add", text="Clip...", icon='CLIP')
elif len(bpy.data.movieclips) > 1:
elif len(bpy.data.movieclips) > 0:
layout.operator_menu_enum("sequencer.movieclip_strip_add", "clip", text="Clip", icon='CLIP')
else:
layout.menu("SEQUENCER_MT_add_empty", text="Clip", icon='CLIP')
@ -337,7 +337,7 @@ class SEQUENCER_MT_add(Menu):
if len(bpy.data.masks) > 10:
layout.operator_context = 'INVOKE_DEFAULT'
layout.operator("sequencer.mask_strip_add", text="Mask...", icon='MOD_MASK')
elif len(bpy.data.masks) > 1:
elif len(bpy.data.masks) > 0:
layout.operator_menu_enum("sequencer.mask_strip_add", "mask", text="Mask", icon='MOD_MASK')
else:
layout.menu("SEQUENCER_MT_add_empty", text="Mask", icon='MOD_MASK')