[Bf-extensions-cvs] [19f808ec] temp-power-sequencer: Add Power Sequencer for review

Nathan Lovato noreply at git.blender.org
Tue Sep 3 19:12:24 CEST 2019


Commit: 19f808ec54ab498c3ea909a67a65dba1591eebd4
Author: Nathan Lovato
Date:   Tue Sep 3 18:50:14 2019 +0200
Branches: temp-power-sequencer
https://developer.blender.org/rBAC19f808ec54ab498c3ea909a67a65dba1591eebd4

Add Power Sequencer for review

===================================================================

A	power_sequencer/__init__.py
A	power_sequencer/addon_preferences.py
A	power_sequencer/addon_properties.py
A	power_sequencer/handlers.py
A	power_sequencer/operators/__init__.py
A	power_sequencer/operators/add_transform.py
A	power_sequencer/operators/align_audios.py
A	power_sequencer/operators/audiosync/__init__.py
A	power_sequencer/operators/audiosync/convert_and_trim.py
A	power_sequencer/operators/audiosync/cross_correlation.py
A	power_sequencer/operators/audiosync/ensure_non_zero.py
A	power_sequencer/operators/audiosync/find_offset.py
A	power_sequencer/operators/audiosync/mfcc/__init__.py
A	power_sequencer/operators/audiosync/mfcc/mfcc.py
A	power_sequencer/operators/audiosync/mfcc/segment_axis.py
A	power_sequencer/operators/audiosync/mfcc/trfbank.py
A	power_sequencer/operators/audiosync/std_mfcc.py
A	power_sequencer/operators/channel_offset.py
A	power_sequencer/operators/concatenate_strips.py
A	power_sequencer/operators/copy_selected_sequences.py
A	power_sequencer/operators/crossfade_add.py
A	power_sequencer/operators/crossfade_edit.py
A	power_sequencer/operators/cut_strips_under_cursor.py
A	power_sequencer/operators/delete_direct.py
A	power_sequencer/operators/deselect_all_left_or_right.py
A	power_sequencer/operators/deselect_handles_and_grab.py
A	power_sequencer/operators/duplicate_move.py
A	power_sequencer/operators/expand_to_surrounding_cuts.py
A	power_sequencer/operators/fade_add.py
A	power_sequencer/operators/fade_clear.py
A	power_sequencer/operators/gap_remove.py
A	power_sequencer/operators/grab.py
A	power_sequencer/operators/grab_closest_handle_or_cut.py
A	power_sequencer/operators/grab_sequence_handles.py
A	power_sequencer/operators/import_local_footage.py
A	power_sequencer/operators/jump_time_offset.py
A	power_sequencer/operators/jump_to_cut.py
A	power_sequencer/operators/make_still_image.py
A	power_sequencer/operators/marker_delete_closest.py
A	power_sequencer/operators/marker_delete_direct.py
A	power_sequencer/operators/marker_go_to_next.py
A	power_sequencer/operators/marker_snap_to_cursor.py
A	power_sequencer/operators/markers_as_timecodes.py
A	power_sequencer/operators/markers_create_from_selected.py
A	power_sequencer/operators/markers_set_preview_in_between.py
A	power_sequencer/operators/markers_snap_matching_strips.py
A	power_sequencer/operators/meta_resize_to_content.py
A	power_sequencer/operators/meta_trim_content_to_bounds.py
A	power_sequencer/operators/meta_ungroup_and_trim.py
A	power_sequencer/operators/mouse_toggle_mute.py
A	power_sequencer/operators/mouse_trim_instantly.py
A	power_sequencer/operators/mouse_trim_modal.py
A	power_sequencer/operators/open_project_directory.py
A	power_sequencer/operators/playback_speed_decrease.py
A	power_sequencer/operators/playback_speed_increase.py
A	power_sequencer/operators/playback_speed_set.py
A	power_sequencer/operators/preview_closest_cut.py
A	power_sequencer/operators/preview_to_selection.py
A	power_sequencer/operators/render_apply_preset.py
A	power_sequencer/operators/render_presets/twitter_720p.py
A	power_sequencer/operators/render_presets/youtube_1080.py
A	power_sequencer/operators/ripple_delete.py
A	power_sequencer/operators/save_direct.py
A	power_sequencer/operators/scene_create_from_selection.py
A	power_sequencer/operators/scene_cycle.py
A	power_sequencer/operators/scene_merge_from.py
A	power_sequencer/operators/scene_open_from_strip.py
A	power_sequencer/operators/scene_rename_with_strip.py
A	power_sequencer/operators/select_all_left_or_right.py
A	power_sequencer/operators/select_closest_to_mouse.py
A	power_sequencer/operators/select_linked_effect.py
A	power_sequencer/operators/select_linked_strips.py
A	power_sequencer/operators/select_related_strips.py
A	power_sequencer/operators/select_strips_under_cursor.py
A	power_sequencer/operators/set_timeline_range.py
A	power_sequencer/operators/snap.py
A	power_sequencer/operators/snap_selection.py
A	power_sequencer/operators/space_sequences.py
A	power_sequencer/operators/speed_remove_effect.py
A	power_sequencer/operators/speed_up_movie_strip.py
A	power_sequencer/operators/swap_strips.py
A	power_sequencer/operators/synchronize_titles.py
A	power_sequencer/operators/toggle_selected_mute.py
A	power_sequencer/operators/toggle_waveforms.py
A	power_sequencer/operators/transitions_remove.py
A	power_sequencer/operators/trim_left_or_right_handles.py
A	power_sequencer/operators/trim_three_point_edit.py
A	power_sequencer/operators/trim_to_surrounding_cuts.py
A	power_sequencer/operators/utils/__init__.py
A	power_sequencer/operators/utils/doc.py
A	power_sequencer/operators/utils/draw.py
A	power_sequencer/operators/utils/functions.py
A	power_sequencer/operators/utils/global_settings.py
A	power_sequencer/operators/utils/info_progress_bar.py
A	power_sequencer/scripts/BPSProxy/bpsproxy/__init__.py
A	power_sequencer/scripts/BPSProxy/bpsproxy/__main__.py
A	power_sequencer/scripts/BPSProxy/bpsproxy/call.py
A	power_sequencer/scripts/BPSProxy/bpsproxy/commands.py
A	power_sequencer/scripts/BPSProxy/bpsproxy/config.py
A	power_sequencer/scripts/BPSProxy/bpsproxy/utils.py
A	power_sequencer/scripts/BPSProxy/setup.py
A	power_sequencer/scripts/BPSRender/bpsrender/__init__.py
A	power_sequencer/scripts/BPSRender/bpsrender/__main__.py
A	power_sequencer/scripts/BPSRender/bpsrender/bscripts/mixdown.py
A	power_sequencer/scripts/BPSRender/bpsrender/bscripts/probe.py
A	power_sequencer/scripts/BPSRender/bpsrender/bscripts/video.py
A	power_sequencer/scripts/BPSRender/bpsrender/calls.py
A	power_sequencer/scripts/BPSRender/bpsrender/commands.py
A	power_sequencer/scripts/BPSRender/bpsrender/config.py
A	power_sequencer/scripts/BPSRender/bpsrender/helpers.py
A	power_sequencer/scripts/BPSRender/bpsrender/setup.py
A	power_sequencer/scripts/BPSRender/setup.py
A	power_sequencer/ui/__init__.py
A	power_sequencer/ui/menu_contextual.py
A	power_sequencer/ui/menu_toolbar.py
A	power_sequencer/utils/addon_auto_imports.py
A	power_sequencer/utils/make_readme.py
A	power_sequencer/utils/register_shortcuts.py

===================================================================

diff --git a/power_sequencer/__init__.py b/power_sequencer/__init__.py
new file mode 100644
index 00000000..7bc1c6ca
--- /dev/null
+++ b/power_sequencer/__init__.py
@@ -0,0 +1,84 @@
+#
+# 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 .addon_preferences import register_preferences, unregister_preferences
+from .addon_properties import register_properties, unregister_properties
+from .operators import classes
+from .utils.register_shortcuts import register_shortcuts
+from .handlers import register_handlers, unregister_handlers
+from .utils import addon_auto_imports
+from .ui import register_ui, unregister_ui
+
+
+# load and reload submodules
+##################################
+modules = addon_auto_imports.setup_addon_modules(
+    __path__, __name__, ignore_packages=[".utils", ".audiosync"], ignore_modules=[]
+)
+
+
+bl_info = {
+    "name": "Power Sequencer",
+    "description": "Video editing tools for content creators",
+    "author": "Nathan Lovato",
+    "version": (1, 4, 0),
+    "blender": (2, 80, 0),
+    "location": "Sequencer",
+    "tracker_url": "https://github.com/GDquest/Blender-power-sequencer/issues",
+    "wiki_url": "https://www.youtube.com/playlist?list=PLhqJJNjsQ7KFjp88Cu57Zb9_wFt7nlkEI",
+    "support": "COMMUNITY",
+    "category": "Sequencer",
+}
+
+
+addon_keymaps = []
+
+
+def register():
+    global addon_keymaps
+
+    register_preferences()
+    register_properties()
+    register_handlers()
+    register_ui()
+
+    for c in classes:
+        bpy.utils.register_class(c)
+
+    keymaps = register_shortcuts()
+    addon_keymaps += keymaps
+
+    print("Registered {} with {} modules".format(bl_info["name"], len(modules)))
+
+
+def unregister():
+    global addon_keymaps
+
+    for km, kmi in addon_keymaps:
+        km.keymap_items.remove(kmi)
+    addon_keymaps.clear()
+
+    for c in classes:
+        bpy.utils.unregister_class(c)
+
+    unregister_ui()
+    unregister_preferences()
+    unregister_properties()
+    unregister_handlers()
+
+    print("Unregistered {}".format(bl_info["name"]))
diff --git a/power_sequencer/addon_preferences.py b/power_sequencer/addon_preferences.py
new file mode 100644
index 00000000..0e8e7d71
--- /dev/null
+++ b/power_sequencer/addon_preferences.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/>.
+#
+"""
+Add-on preferences and interface in the Blender preferences window.
+"""
+import bpy
+
+
+def get_preferences(context):
+    return context.preferences.addons[__package__].preferences
+
+class PowerSequencerPreferences(bpy.types.AddonPreferences):
+    bl_idname = __package__
+
+    proxy_25: bpy.props.BoolProperty(name="25%", default=False)
+    proxy_50: bpy.props.BoolProperty(name="50%", default=False)
+    proxy_75: bpy.props.BoolProperty(name="75%", default=False)
+    proxy_100: bpy.props.BoolProperty(name="100%", default=False)
+
+    def draw(self, context):
+        layout = self.layout
+
+        layout.label(text="Proxy")
+
+        row = layout.row()
+        row.prop(self, "proxy_25")
+        row.prop(self, "proxy_50")
+        row.prop(self, "proxy_75")
+        row.prop(self, "proxy_100")
+
+
+register_preferences, unregister_preferences = bpy.utils.register_classes_factory(
+    [PowerSequencerPreferences]
+)
diff --git a/power_sequencer/addon_properties.py b/power_sequencer/addon_properties.py
new file mode 100644
index 00000000..06cbe1da
--- /dev/null
+++ b/power_sequencer/addon_properties.py
@@ -0,0 +1,46 @@
+#
+# 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 PowerSequencerProperties(bpy.types.PropertyGroup):
+    playback_speed: bpy.props.EnumProperty(
+        items=[
+            ("NORMAL", "Normal (1x)", ""),
+            ("FAST", "Fast (1.33x)", ""),
+            ("FASTER", "Faster (1.66x)", ""),
+            ("DOUBLE", "Double (2x)", ""),
+            ("TRIPLE", "Triple (3x)", ""),
+        ],
+        name="Playback",
+        default="NORMAL",
+    )
+
+    frame_pre: bpy.props.IntProperty(name="Frame before frame_change", default=0, min=0)
+
+    active_tab: bpy.props.StringProperty(
+        name="Active Tab", description="The name of the active tab in the UI", default="Sequencer"
+    )
+
+
+def register_properties():
+    bpy.utils.register_class(PowerSequencerProperties)
+    bpy.types.Scene.power_sequencer = bpy.props.PointerProperty(type=PowerSequencerProperties)
+
+
+def unregister_properties():
+    bpy.utils.unregister_class(PowerSequencerProperties)
diff --git a/power_sequencer/handlers.py b/power_sequencer/handlers.py
new file mode 100644
index 00000000..8e93bb27
--- /dev/null
+++ b/power_sequencer/handlers.py
@@ -0,0 +1,89 @@
+#
+# 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 bpy.app.handlers import persistent
+
+
+ at persistent
+def power_sequencer_load_file_post(arg):
+    """
+    Called after loading the blend file
+    """
+    for scene in bpy.data.scenes:
+        scene.power_sequencer.frame_pre = bpy.context.scene.frame_current
+
+
+ at persistent
+def power_sequencer_playback_speed_post(scene):
+    """
+    Handler function for faster playback
+    Skips keyframes after a frame change based on the playback_speed value
+    It steps over frame rather than increase the playback speed smoothly,
+    but it's still useful for faster editing
+    """
+    if bpy.context.screen and not bpy.context.screen.is_animation_playing:
+        return
+
+    playback_speed = scene.power_sequencer.playback_speed
+
+    frame_start = scene.frame_current
+    frame_post = scene.frame_current
+
+    if playback_speed == "FAST" and frame_start % 3 == 0:
+        frame_post += 1
+    elif playback_speed == "FASTER" and frame_start % 2 == 0:
+        frame_post += 1
+    elif playback_speed == "DOUBLE":
+        # 2.5x -> skip 5 frames for 2. 2 then 3 then 2 etc.
+        frame_post += 1
+    elif playback_speed == "TRIPLE":
+        frame_post += 2
+
+    if frame_start != frame_post:
+        bpy.ops.screen.frame_offset(delta=frame_post - frame_start)
+    scene.power_sequencer.frame_pre = scene.frame_current
+
+
+def draw_playback_speed(self, context):
+    layout = self.layout
+    scene = context.scene
+    layout.prop(scene.power_sequencer, "playback_speed")
+
+
+def draw_ui_menu(self, context):
+    layout = self.layout
+    layout.menu("POWER_SEQUENCER_MT_main")
+
+
+def register_handlers():
+    # Menus
+    bpy.types.SEQUENCER_HT_header.append(draw_ui_menu)
+    bpy.types.SEQUENCER_HT_header.append(draw_playback_speed)
+
+    # Handlers
+    bpy.app.handlers.load_post.append(power_sequencer_load_file_post)
+    bpy.app.handlers.frame_change_post.append(power_sequencer_playback_speed_post)
+
+
+def unregister_handlers():
+    # Menus
+    bpy.types.SEQUENCER_HT_header.remove(draw_ui_menu)
+    bpy.types.SEQUENCER_HT_header.remove(draw_playback_speed)
+
+    # Handlers
+    bpy.app.handlers.load_post.remove(power_sequencer_load_file_post)
+    bpy.app.handlers.frame_change_post.remove(power_sequencer_playback_speed_post)
diff --git a/power_sequencer/operators/__init__.py b/power_sequencer/operators/__init__.py
new file mode 100644
index 00000000..e1de647d
--- /dev/null
+++ b/power_sequencer/operators/__init__.py
@@ -0,0 +1,167 @@
+#
+# Copyright (C) 2016-2019 by N

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list