Skip to content

Commit

Permalink
Bugfix: Animate textures with special character in img name
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDuckCow committed Jun 6, 2021
1 parent 99fb668 commit 3ff8d86
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion MCprep_addon/materials/sequences.py
Expand Up @@ -170,7 +170,8 @@ def generate_material_sequence(source_path, image_path, form, export_location, c
root = os.path.basename(seq_path_base)

# match string-ending pattern: .../lava_flow/lava_flow_0001.png
exp = r"(?i)"+root+r"[\/\\]{1}"+root+r"[_][0-9]{1,5}[.](png|jpg|jpeg)$"
resc = re.escape(root) # Safely escape any meta character names
exp = r"(?i)"+resc+r"[\/\\]{1}"+resc+r"[_][0-9]{1,5}[.](png|jpg|jpeg)$"
if re.search(exp, source_path):
# now it will point to originating subfolder and check caching there
seq_path_base = os.path.dirname(seq_path_base)
Expand Down

0 comments on commit 3ff8d86

Please sign in to comment.