Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Lovato <nathan@gdquest.com>2019-09-05 18:22:37 +0300
committerNathan Lovato <nathan@gdquest.com>2019-09-05 18:22:52 +0300
commit61d48c0a4be0ab8f71e6e1d35f0aa99c77fcfd33 (patch)
treef64d0ea88789184f45112b489598990d549788f2 /power_sequencer/ui
parentda5a1175e30c347fbce05e49e2f5f895be30bd5b (diff)
Add the VSE addon Power Sequencer
Diffstat (limited to 'power_sequencer/ui')
-rw-r--r--power_sequencer/ui/__init__.py48
-rw-r--r--power_sequencer/ui/menu_contextual.py83
-rw-r--r--power_sequencer/ui/menu_toolbar.py204
3 files changed, 335 insertions, 0 deletions
diff --git a/power_sequencer/ui/__init__.py b/power_sequencer/ui/__init__.py
new file mode 100644
index 00000000..61edcb35
--- /dev/null
+++ b/power_sequencer/ui/__init__.py
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2016-2019 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors
+#
+# This file is part of Power Sequencer.
+#
+# Power Sequencer is free software: you can redistribute it and/or modify it under the terms of the
+# GNU General Public License as published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# Power Sequencer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with Power Sequencer. If
+# not, see <https://www.gnu.org/licenses/>.
+#
+import bpy
+from .menu_contextual import POWER_SEQUENCER_MT_contextual
+from .menu_toolbar import (
+ POWER_SEQUENCER_MT_main,
+ POWER_SEQUENCER_MT_playback,
+ POWER_SEQUENCER_MT_strips,
+ POWER_SEQUENCER_MT_select,
+ POWER_SEQUENCER_MT_edit,
+ POWER_SEQUENCER_MT_markers,
+ POWER_SEQUENCER_MT_file,
+ POWER_SEQUENCER_MT_trim,
+ POWER_SEQUENCER_MT_preview,
+ POWER_SEQUENCER_MT_audio,
+ POWER_SEQUENCER_MT_transitions,
+)
+
+classes = [
+ POWER_SEQUENCER_MT_contextual,
+ POWER_SEQUENCER_MT_main,
+ POWER_SEQUENCER_MT_playback,
+ POWER_SEQUENCER_MT_strips,
+ POWER_SEQUENCER_MT_select,
+ POWER_SEQUENCER_MT_edit,
+ POWER_SEQUENCER_MT_markers,
+ POWER_SEQUENCER_MT_file,
+ POWER_SEQUENCER_MT_trim,
+ POWER_SEQUENCER_MT_preview,
+ POWER_SEQUENCER_MT_audio,
+ POWER_SEQUENCER_MT_transitions,
+]
+
+register_ui, unregister_ui = bpy.utils.register_classes_factory(classes)
diff --git a/power_sequencer/ui/menu_contextual.py b/power_sequencer/ui/menu_contextual.py
new file mode 100644
index 00000000..6ba0640a
--- /dev/null
+++ b/power_sequencer/ui/menu_contextual.py
@@ -0,0 +1,83 @@
+#
+# Copyright (C) 2016-2019 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors
+#
+# This file is part of Power Sequencer.
+#
+# Power Sequencer is free software: you can redistribute it and/or modify it under the terms of the
+# GNU General Public License as published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# Power Sequencer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with Power Sequencer. If
+# not, see <https://www.gnu.org/licenses/>.
+#
+import bpy
+from ..operators.utils.global_settings import SequenceTypes
+
+
+class POWER_SEQUENCER_MT_contextual(bpy.types.Menu):
+ bl_label = "Power Sequencer"
+ # bl_idname = "SEQUENCER_MT_power_sequencer_menu"
+
+ def draw(self, context):
+ layout = self.layout
+
+ if not bpy.data.is_saved:
+ layout.label("Please save your project")
+ layout.operator("wm.save_as_mainfile", icon="SAVE_AS", text="Save as")
+ return
+
+ if not context.sequences:
+ layout.operator(
+ "power_sequencer.import_local_footage", icon="SEQUENCE", text="Import local footage"
+ )
+ return
+
+ selection = context.selected_sequences
+ active_strip = context.scene.sequence_editor.active_strip
+ types = set([s.type for s in selection])
+
+ if active_strip.type == "GAMMA_CROSS":
+ layout.operator(
+ "power_sequencer.crossfade_edit", icon="ACTION_TWEAK", text="Edit crossfade"
+ )
+
+ for t in types:
+ if t in SequenceTypes.VIDEO:
+ layout.operator("power_sequencer.fade_add", icon="IMAGE_ALPHA", text="Fade strips")
+ break
+
+ if len(selection) == 1:
+ for s in [active_strip, selection[0]]:
+ if s.type in SequenceTypes.VIDEO or s.type in SequenceTypes.IMAGE:
+ layout.separator()
+ layout.operator(
+ "power_sequencer.crossfade_add", icon="IMAGE_ALPHA", text="Auto crossfade"
+ )
+ break
+
+ # TODO: Doesn't work from the menu, I guess there's an issue with the invoke method?
+ # layout.separator()
+ # layout.operator('power_sequencer.grab_closest_handle_or_cut', icon='SNAP_SURFACE', text='Grab cut or handle')
+
+ if len(selection) > 1:
+ layout.separator()
+
+ layout.operator(
+ "power_sequencer.ripple_delete", icon="AUTOMERGE_ON", text="Ripple delete"
+ )
+ layout.operator(
+ "power_sequencer.snap_selection", icon="SNAP_ON", text="Snap selection"
+ )
+
+ layout.separator()
+
+ layout.operator(
+ "power_sequencer.import_local_footage", icon="SEQUENCE", text="Import local footage"
+ )
+ layout.operator(
+ "power_sequencer.render_video", icon="RENDER_ANIMATION", text="Render video for the web"
+ )
diff --git a/power_sequencer/ui/menu_toolbar.py b/power_sequencer/ui/menu_toolbar.py
new file mode 100644
index 00000000..cb647da5
--- /dev/null
+++ b/power_sequencer/ui/menu_toolbar.py
@@ -0,0 +1,204 @@
+#
+# Copyright (C) 2016-2019 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors
+#
+# This file is part of Power Sequencer.
+#
+# Power Sequencer is free software: you can redistribute it and/or modify it under the terms of the
+# GNU General Public License as published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# Power Sequencer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
+# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with Power Sequencer. If
+# not, see <https://www.gnu.org/licenses/>.
+#
+import bpy
+
+
+class POWER_SEQUENCER_MT_main(bpy.types.Menu):
+ bl_label = "Power Sequencer"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.separator()
+
+ layout.menu("POWER_SEQUENCER_MT_file")
+ layout.menu("POWER_SEQUENCER_MT_edit")
+ layout.menu("POWER_SEQUENCER_MT_select")
+ layout.menu("POWER_SEQUENCER_MT_trim")
+ layout.menu("POWER_SEQUENCER_MT_strips")
+ layout.menu("POWER_SEQUENCER_MT_transitions")
+ layout.menu("POWER_SEQUENCER_MT_audio")
+ layout.menu("POWER_SEQUENCER_MT_playback")
+ layout.menu("POWER_SEQUENCER_MT_preview")
+ layout.menu("POWER_SEQUENCER_MT_markers")
+
+ layout.separator()
+
+ layout.operator("power_sequencer.render_apply_preset", text="Apply Render Preset")
+
+
+class POWER_SEQUENCER_MT_playback(bpy.types.Menu):
+ bl_label = "Playback"
+
+ def draw(self, context):
+ layout = self.layout
+ layout.operator("power_sequencer.playback_speed_increase")
+ layout.operator("power_sequencer.playback_speed_decrease")
+ layout.operator("power_sequencer.playback_speed_set")
+
+
+class POWER_SEQUENCER_MT_strips(bpy.types.Menu):
+ bl_label = "Strips"
+
+ def draw(self, context):
+ layout = self.layout
+ layout.operator("power_sequencer.speed_up_movie_strip")
+ layout.operator("power_sequencer.speed_remove_effect")
+
+ layout.separator()
+
+ layout.operator("power_sequencer.concatenate_strips")
+ layout.operator("power_sequencer.swap_strips")
+ layout.operator("power_sequencer.toggle_selected_mute")
+ layout.operator("power_sequencer.channel_offset")
+
+ layout.separator()
+
+ layout.operator("power_sequencer.make_still_image")
+
+
+class POWER_SEQUENCER_MT_transitions(bpy.types.Menu):
+ bl_label = "Transitions"
+
+ def draw(self, context):
+ layout = self.layout
+ layout.operator("power_sequencer.fade_add")
+ layout.operator("power_sequencer.fade_clear")
+
+ layout.separator()
+
+ layout.operator("power_sequencer.crossfade_add")
+ layout.operator("power_sequencer.crossfade_edit")
+ layout.operator("power_sequencer.transitions_remove")
+
+
+class POWER_SEQUENCER_MT_select(bpy.types.Menu):
+ bl_label = "Select"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.operator("power_sequencer.select_linked_effect")
+
+ layout.separator()
+
+ layout.operator("power_sequencer.deselect_all_strips_left_or_right")
+ layout.operator("power_sequencer.deselect_handles_and_grab")
+
+
+class POWER_SEQUENCER_MT_edit(bpy.types.Menu):
+ bl_label = "Edit"
+
+ def draw(self, context):
+ layout = self.layout
+ layout.operator("power_sequencer.delete_direct")
+ layout.operator("power_sequencer.ripple_delete")
+
+ layout.separator()
+
+ layout.operator("power_sequencer.gap_remove")
+ layout.operator(
+ "power_sequencer.copy_selected_sequences", text="Copy Selected", icon="COPYDOWN"
+ )
+
+ layout.separator()
+
+ layout.operator("power_sequencer.grab")
+ layout.operator("power_sequencer.grab_closest_cut")
+ layout.operator("power_sequencer.grab_sequence_handles")
+
+ layout.separator()
+
+ layout.operator("power_sequencer.trim_left_or_right_handles")
+ layout.operator("power_sequencer.snap_selection")
+
+ layout.separator()
+
+ layout.operator("power_sequencer.scene_cycle")
+
+
+class POWER_SEQUENCER_MT_markers(bpy.types.Menu):
+ bl_label = "Markers"
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.operator("power_sequencer.marker_delete_closest")
+ layout.operator("power_sequencer.marker_delete_direct")
+
+ layout.separator()
+
+ layout.operator("power_sequencer.synchronize_titles")
+
+ layout.separator()
+
+ layout.operator("power_sequencer.marker_go_to_next")
+ layout.operator("power_sequencer.copy_markers_as_timecodes")
+ layout.operator("power_sequencer.marker_snap_to_cursor")
+ layout.operator("power_sequencer.set_preview_between_markers")
+ layout.operator("power_sequencer.markers_snap_matching_strips")
+
+
+class POWER_SEQUENCER_MT_file(bpy.types.Menu):
+ bl_label = "File"
+
+ def draw(self, context):
+ layout = self.layout
+ layout.operator(
+ "power_sequencer.open_project_directory",
+ text="Open Project Directory",
+ icon="FILE_FOLDER",
+ )
+ layout.operator("power_sequencer.save_direct")
+ layout.operator("power_sequencer.import_local_footage")
+
+
+class POWER_SEQUENCER_MT_trim(bpy.types.Menu):
+ bl_label = "Trim"
+
+ def draw(self, context):
+ layout = self.layout
+ layout.operator("power_sequencer.trim_three_point_edit")
+ layout.operator("power_sequencer.trim_to_surrounding_cuts")
+
+ layout.separator()
+
+ layout.operator("power_sequencer.mouse_trim")
+ layout.operator("power_sequencer.mouse_trim_instantly")
+
+
+class POWER_SEQUENCER_MT_preview(bpy.types.Menu):
+ bl_label = "Preview"
+
+ def draw(self, context):
+ layout = self.layout
+ layout.operator("power_sequencer.preview_closest_cut")
+ layout.operator("power_sequencer.preview_to_selection")
+
+ layout.separator()
+
+ layout.operator("power_sequencer.set_timeline_range")
+
+
+class POWER_SEQUENCER_MT_audio(bpy.types.Menu):
+ bl_label = "Audio"
+
+ def draw(self, context):
+ layout = self.layout
+ layout.operator("power_sequencer.align_audios")
+ layout.operator("power_sequencer.toggle_waveforms")
+ layout.operator("power_sequencer.mouse_toggle_mute")