diff --git a/operators/sequencer.py b/operators/sequencer.py index b2b5ef6..3ffea51 100644 --- a/operators/sequencer.py +++ b/operators/sequencer.py @@ -1,5 +1,7 @@ +import re from os.path import expandvars, abspath from pathlib import Path + import bpy from bpy.types import Operator from bpy.props import (BoolProperty, StringProperty, FloatProperty, @@ -714,7 +716,9 @@ class VSETB_OT_update_media(Operator): def execute(self, context): for strip in context.selected_sequences: current_movie = Path(abspath(bpy.path.abspath(strip.filepath))) - latest_file = sorted(list(current_movie.parent.glob('*.*')))[-1] + pattern_name = re.sub(r'[^\s._\?]+', '*', current_movie.name) + + latest_file = sorted(list(current_movie.parent.glob(pattern_name)))[-1] if latest_file != current_movie: print(latest_file)