diff --git a/src/windows/add_to_timeline.py b/src/windows/add_to_timeline.py index 8ebf478ec1..fd140dac31 100644 --- a/src/windows/add_to_timeline.py +++ b/src/windows/add_to_timeline.py @@ -242,7 +242,7 @@ def accept(self): position = max(start_position, new_clip["position"] - fade_length) new_clip["position"] = position - if fade_value == 'Fade In' or fade_value == 'Fade In & Out': + if fade_value in ['Fade In', 'Fade In & Out']: start = openshot.Point(round(start_time * fps_float) + 1, 0.0, openshot.BEZIER) start_object = json.loads(start.Json()) end = openshot.Point(min(round((start_time + fade_length) * fps_float) + 1, round(end_time * fps_float) + 1), 1.0, openshot.BEZIER) @@ -250,7 +250,7 @@ def accept(self): new_clip['alpha']["Points"].append(start_object) new_clip['alpha']["Points"].append(end_object) - if fade_value == 'Fade Out' or fade_value == 'Fade In & Out': + if fade_value in ['Fade Out', 'Fade In & Out']: start = openshot.Point(max(round((end_time * fps_float) + 1) - (round(fade_length * fps_float) + 1), round(start_time * fps_float) + 1), 1.0, openshot.BEZIER) start_object = json.loads(start.Json()) end = openshot.Point(round(end_time * fps_float) + 1, 0.0, openshot.BEZIER) diff --git a/src/windows/views/blender_listview.py b/src/windows/views/blender_listview.py index 21f3412287..bd395f15bc 100644 --- a/src/windows/views/blender_listview.py +++ b/src/windows/views/blender_listview.py @@ -843,9 +843,8 @@ def Render(self): _ = get_app()._tr - if not self.version: - if not self.blender_version_check(): - return + if not self.version and not self.blender_version_check(): + return self.command_output = "" self.current_frame = 0 diff --git a/src/windows/views/timeline_mixins.py b/src/windows/views/timeline_mixins.py index 2a553c4028..b422cbe335 100644 --- a/src/windows/views/timeline_mixins.py +++ b/src/windows/views/timeline_mixins.py @@ -133,11 +133,9 @@ def get_html(self): def keyPressEvent(self, event): """ Keypress callback for timeline """ key_value = event.key() - if (key_value == Qt.Key_Shift or key_value == Qt.Key_Control): - + if key_value in [Qt.Key_Shift, Qt.Key_Control]: # Only pass a few keystrokes to the webview (CTRL and SHIFT) return QWebEngineView.keyPressEvent(self, event) - else: # Ignore most keypresses event.ignore() @@ -212,11 +210,9 @@ def get_html(self): def keyPressEvent(self, event): """ Keypress callback for timeline """ key_value = event.key() - if (key_value == Qt.Key_Shift or key_value == Qt.Key_Control): - + if key_value in [Qt.Key_Shift, Qt.Key_Control]: # Only pass a few keystrokes to the webview (CTRL and SHIFT) return QWebView.keyPressEvent(self, event) - else: # Ignore most keypresses event.ignore() diff --git a/src/windows/views/timeline_webview.py b/src/windows/views/timeline_webview.py index e047d0b0f2..d1a57e87f3 100644 --- a/src/windows/views/timeline_webview.py +++ b/src/windows/views/timeline_webview.py @@ -1183,11 +1183,11 @@ def Layout_Triggered(self, action, clip_ids): clip.data["location_x"] = {"Points": [p_object]} clip.data["location_y"] = {"Points": [p_object]} - if action == MENU_LAYOUT_CENTER or \ - action == MENU_LAYOUT_TOP_LEFT or \ - action == MENU_LAYOUT_TOP_RIGHT or \ - action == MENU_LAYOUT_BOTTOM_LEFT or \ - action == MENU_LAYOUT_BOTTOM_RIGHT: + if action in [MENU_LAYOUT_CENTER, + MENU_LAYOUT_TOP_LEFT, + MENU_LAYOUT_TOP_RIGHT, + MENU_LAYOUT_BOTTOM_LEFT, + MENU_LAYOUT_BOTTOM_RIGHT]: # Reset scale mode clip.data["scale"] = openshot.SCALE_FIT clip.data["gravity"] = new_gravity @@ -1437,7 +1437,7 @@ def Copy_Triggered(self, action, clip_ids, tran_ids): self.copy_clipboard[clip_id] = {} - if action == MENU_COPY_CLIP or action == MENU_COPY_ALL: + if action in [MENU_COPY_CLIP, MENU_COPY_ALL]: self.copy_clipboard[clip_id] = clip.data elif action == MENU_COPY_KEYFRAMES_ALL: self.copy_clipboard[clip_id]['alpha'] = clip.data['alpha'] @@ -1480,7 +1480,7 @@ def Copy_Triggered(self, action, clip_ids, tran_ids): self.copy_transition_clipboard[tran_id] = {} - if action == MENU_COPY_TRANSITION or action == MENU_COPY_ALL: + if action in [MENU_COPY_TRANSITION, MENU_COPY_ALL]: self.copy_transition_clipboard[tran_id] = tran.data elif action == MENU_COPY_KEYFRAMES_ALL: self.copy_transition_clipboard[tran_id]['brightness'] = tran.data['brightness'] @@ -1891,7 +1891,7 @@ def Slice_Triggered(self, action, clip_ids, trans_ids, playhead_position=0): # Determine if waveform needs to be redrawn has_audio_data = clip_id in self.waveform_cache - if action == MENU_SLICE_KEEP_LEFT or action == MENU_SLICE_KEEP_BOTH: + if action in [MENU_SLICE_KEEP_LEFT, MENU_SLICE_KEEP_BOTH]: # Get details of original clip position_of_clip = float(clip.data["position"]) start_of_clip = float(clip.data["start"]) @@ -1954,7 +1954,7 @@ def Slice_Triggered(self, action, clip_ids, trans_ids, playhead_position=0): # Invalid transition, skip to next item continue - if action == MENU_SLICE_KEEP_LEFT or action == MENU_SLICE_KEEP_BOTH: + if action in [MENU_SLICE_KEEP_LEFT, MENU_SLICE_KEEP_BOTH]: # Get details of original transition position_of_tran = float(trans.data["position"])