diff options
Diffstat (limited to 'live-mogrify.py')
| -rw-r--r-- | live-mogrify.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/live-mogrify.py b/live-mogrify.py index 90fe30e..63a7962 100644 --- a/live-mogrify.py +++ b/live-mogrify.py @@ -134,10 +134,10 @@ class Listener(): def _set_fn(self, key, value): if hasattr(self.data_opt, key): try: - if str(value) == 'true': + if str(value) == 'True': setattr(self.data_opt, key, True) print('set {} {}: {}'.format(type(new_value), key, True)) - elif str(value) == 'false': + elif str(value) == 'False': setattr(self.data_opt, key, False) print('set {} {}: {}'.format(type(new_value), key, False)) else: @@ -198,9 +198,13 @@ def process_live_input(opt, data_opt, rpc_client): if data_opt.sequence and A_dir is not None: A_img = Image.open(sequence_path).convert('RGB') A_im = np.asarray(A_img) - t = lerp(math.sin(i / data_opt.transition_period * math.pi * 2.0 ) / 2.0 + 0.5, data_opt.transition_min, data_opt.transition_max) - frac_a = data_opt.recursive_frac * (1.0 - t) - frac_b = data_opt.sequence_frac * (1.0 - t) + if data_opt.transition: + t = lerp(math.sin(i / data_opt.transition_period * math.pi * 2.0 ) / 2.0 + 0.5, data_opt.transition_min, data_opt.transition_max) + frac_a = data_opt.recursive_frac * (1.0 - t) + frac_b = data_opt.sequence_frac * (1.0 - t) + else: + frac_a = data_opt.recursive_frac + frac_b = data_opt.sequence_frac frac_c = 1.0 - frac_a - frac_b array_a = np.multiply(last_im.astype('float64'), frac_a) array_b = np.multiply(A_im.astype('float64'), frac_b) |
