Skip to content

Commit e12708a

Browse files
justo46digitalillusions
authored andcommitted
Added an array for the current file sequences that is only updated when the directory updates
1 parent d3b9d08 commit e12708a

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

bseq/callback.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,14 @@
33

44
# Code here are mostly about the callback/update/items functions used in properties.py
55

6+
file_sequences = []
67

78
def update_path(self, context):
89
# When the path has been changed, reset the selected sequence to None
910
context.scene.BSEQ['fileseq'] = 1
1011
context.scene.BSEQ.use_pattern = False
1112
context.scene.BSEQ.pattern = ""
1213

13-
14-
def item_fileseq(self, context):
15-
'''
16-
Detects all the file sequences in the directory
17-
'''
18-
1914
p = context.scene.BSEQ.path
2015
try:
2116
f = fileseq.findSequencesOnDisk(p)
@@ -24,15 +19,22 @@ def item_fileseq(self, context):
2419

2520
if not f:
2621
return [("None", "No sequence detected", "", 1)]
27-
file_seq = []
22+
23+
file_sequences.clear()
2824
if len(f) >= 20:
29-
file_seq.append(("None", "Too much sequence detected, could be false detection, please use pattern below", "", 1))
25+
file_sequences.append(("None", "Too much sequence detected, could be false detection, please use pattern below", "", 1))
3026
else:
3127
count = 1
3228
for seq in f:
33-
file_seq.append((str(seq), seq.basename() + "@" + seq.extension(), "", count))
29+
file_sequences.append((str(seq), seq.basename() + "@" + seq.extension(), "", count))
3430
count += 1
35-
return file_seq
31+
32+
33+
def item_fileseq(self, context):
34+
'''
35+
Detects all the file sequences in the directory
36+
'''
37+
return file_sequences
3638

3739

3840
def update_selected_obj_num(self, context):

0 commit comments

Comments
 (0)