Skip to content

Faster Sequence Loading #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions bseq/callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,18 @@

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

file_sequences = []

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


def item_fileseq(self, context):
'''
Detects all the file sequences in the directory
'''

p = context.scene.BSEQ.path
try:
f = fileseq.findSequencesOnDisk(p)
Expand All @@ -24,15 +23,19 @@ def item_fileseq(self, context):

if not f:
return [("None", "No sequence detected", "", 1)]
file_seq = []

file_sequences.clear()
if len(f) >= 20:
file_seq.append(("None", "Too much sequence detected, could be false detection, please use pattern below", "", 1))
file_sequences.append(("None", "Too much sequence detected, could be false detection, please use pattern below", "", 1))
else:
count = 1
for seq in f:
file_seq.append((str(seq), seq.basename() + "@" + seq.extension(), "", count))
file_sequences.append((str(seq), seq.basename() + "@" + seq.extension(), "", count))
count += 1
return file_seq


def item_fileseq(self, context):
return file_sequences


def update_selected_obj_num(self, context):
Expand Down