675abc683e84af47d9737317cd4b0718643cd656
[blender-addons-contrib.git] / sequencer_extra_actions / __init__.py
1 # ##### BEGIN GPL LICENSE BLOCK #####
2 #
3 #  This program is free software; you can redistribute it and/or
4 #  modify it under the terms of the GNU General Public License
5 #  as published by the Free Software Foundation; either version 2
6 #  of the License, or (at your option) any later version.
7 #
8 #  This program is distributed in the hope that it will be useful,
9 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 #  GNU General Public License for more details.
12 #
13 #  You should have received a copy of the GNU General Public License
14 #  along with this program; if not, write to the Free Software Foundation,
15 #  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 #
17 # ##### END GPL LICENSE BLOCK #####
18
19 bl_info = {
20     "name": "Extra Sequencer Actions",
21     "author": "Turi Scandurra, Carlos Padial",
22     "version": (3, 6),
23     "blender": (2, 65, 0),
24     "api": 53177,
25     "category": "Sequencer",
26     "location": "Sequencer",
27     "description": "Collection of extra operators to manipulate VSE strips",
28     "wiki_url": "http://wiki.blender.org/index.php/"
29     "Extensions:2.6/Py/Scripts/Sequencer/Extra_Sequencer_Actions",
30     "tracker_url": "http://projects.blender.org/tracker/index.php?func=detail"
31                    "&aid=30474",
32     "support": "COMMUNITY"}
33
34 if "bpy" in locals():
35     import imp
36     imp.reload(operators_extra_actions)
37     imp.reload(ui)
38 else:
39     from . import operators_extra_actions
40     from . import ui
41
42 import bpy
43 import os.path
44 from bpy.types import Menu
45 from bpy.types import Header
46
47
48 # Registration
49 def register():
50     bpy.utils.register_module(__name__)
51
52     # Append menu entries
53     bpy.types.SEQUENCER_MT_select.prepend(ui.sequencer_select_menu_func)
54     bpy.types.SEQUENCER_MT_strip.prepend(ui.sequencer_strip_menu_func)
55     bpy.types.SEQUENCER_HT_header.append(ui.sequencer_header_func)
56     bpy.types.CLIP_HT_header.append(ui.clip_header_func)
57     bpy.types.CLIP_MT_clip.prepend(ui.clip_clip_menu_func)
58     bpy.types.TIME_MT_frame.prepend(ui.time_frame_menu_func)
59     bpy.types.TIME_HT_header.append(ui.time_header_func)
60
61     # Add keyboard shortcut configuration
62     kc = bpy.context.window_manager.keyconfigs.addon
63     km = kc.keymaps.new(name='Frames')
64     kmi = km.keymap_items.new('screenextra.frame_skip',
65     'RIGHT_ARROW', 'PRESS', ctrl=True, shift=True)
66     kmi.properties.back = False
67     kmi = km.keymap_items.new('screenextra.frame_skip',
68     'LEFT_ARROW', 'PRESS', ctrl=True, shift=True)
69     kmi.properties.back = True
70
71
72 def unregister():
73     bpy.utils.unregister_module(__name__)
74
75     #  Remove menu entries
76     bpy.types.SEQUENCER_MT_select.remove(ui.sequencer_select_menu_func)
77     bpy.types.SEQUENCER_MT_strip.remove(ui.sequencer_strip_menu_func)
78     bpy.types.SEQUENCER_HT_header.remove(ui.sequencer_header_func)
79     bpy.types.CLIP_HT_header.remove(ui.clip_header_func)
80     bpy.types.CLIP_MT_clip.remove(ui.clip_clip_menu_func)
81     bpy.types.TIME_MT_frame.remove(ui.time_frame_menu_func)
82     bpy.types.TIME_HT_header.remove(ui.time_header_func)
83
84     #  Remove keyboard shortcut configuration
85     kc = bpy.context.window_manager.keyconfigs.addon
86     km = kc.keymaps['Frames']
87     km.keymap_items.remove(km.keymap_items['screenextra.frame_skip'])
88     km.keymap_items.remove(km.keymap_items['screenextra.frame_skip'])
89
90
91 if __name__ == '__main__':
92     register()