-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathshared_state.py
71 lines (51 loc) · 1.75 KB
/
shared_state.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# TODO: change name to reflect what it actually does (share info for automatic periodic time cuts
class ThreadsSharedState:
def __init__(self):
self.sample_folder = None
self.job_name = None
self.frames_threshold = None
self.current_cut = 1
self.sample_res = None
self.render_res = None
self.upload_to_ftp = False
self.delete_at_the_end = False
def get_sample_folder(self):
return self.sample_folder
def set_folder(self, folder):
self.sample_folder = folder
def get_job_name(self):
return self.job_name
def set_job_name(self, job_name):
self.job_name = job_name
def get_frames_threshold(self):
return self.frames_threshold
def set_frames_threshold(self, nbr_frames):
self.frames_threshold = nbr_frames
def get_current_cut(self):
return self.current_cut
def set_current_cut(self, cut):
self.current_cut = cut
def init_current_cut(self):
self.current_cut = 1
def increment_cut(self):
self.current_cut += 1
def get_sample_res(self):
return self.sample_res
def set_sample_res(self, res):
self.sample_res = res
def get_render_res(self):
return self.render_res
def set_render_res(self, res):
self.render_res = res
def is_upload_to_ftp(self):
return self.upload_to_ftp
def set_upload_to_ftp(self, upload_to_ftp):
self.upload_to_ftp = upload_to_ftp
def is_delete_at_the_end(self):
return self.delete_at_the_end
def set_delete_at_the_end(self, upload_to_ftp):
self.delete_at_the_end = upload_to_ftp
def get_time_cut_folder_name(self):
return '{}_time_cut{:04d}'.format(self.get_job_name(), self.get_current_cut())
def has_boxes(self):
return not (self.get_render_res() is None or self.get_sample_res() == self.get_render_res())