From b1cd144d7efcef47bb6f360b34a7523b3d934646 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 14 Oct 2023 16:00:56 +1100 Subject: [PATCH] PlayAnim: don't expand sequences when passing in multiple files Only expand image sequences when a single file is passed in. This allows shell globing to expand images without expanding each. Prepare for support multiple file drag & drop where it also doesn't make sense to expand sequences when dropping multiple files. --- source/blender/windowmanager/intern/wm_playanim.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/source/blender/windowmanager/intern/wm_playanim.cc b/source/blender/windowmanager/intern/wm_playanim.cc index d80de871a4b..0b667b8c949 100644 --- a/source/blender/windowmanager/intern/wm_playanim.cc +++ b/source/blender/windowmanager/intern/wm_playanim.cc @@ -1830,10 +1830,19 @@ static char *wm_main_playanim_intern(int argc, const char **argv) GHOST_SwapWindowBuffers(ps.ghost_data.window); + /* One of the frames was invalid or not passed in. */ if (sfra == -1 || efra == -1) { - /* one of the frames was invalid, just use all images */ sfra = 1; - efra = MAXFRAME; + if (argc == 1) { + /* A single file was passed in, attempt to load all images from an image sequence. + * (if it is an image sequence). */ + efra = MAXFRAME; + } + else { + /* Multiple files passed in, show each file without expanding image sequences. + * This occurs when dropping multiple files. */ + efra = 1; + } } build_pict_list(