67 lines
1.6 KiB
Python
67 lines
1.6 KiB
Python
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
bl_info = {
|
|
"name": "VSE ToolBox",
|
|
"description": "In-House Video editing Tools",
|
|
"author": "Samuel Bernou, Clement Ducarteron, Christophe Seux",
|
|
"version": (0, 1, 0),
|
|
"blender": (4, 0, 2),
|
|
"location": "Sequencer",
|
|
"warning": "",
|
|
"category": "Sequencer",
|
|
}
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
#sys.modules['vse_toolbox'] = sys.modules.pop(Path(__file__).parent.name)
|
|
|
|
from vse_toolbox import ui
|
|
from vse_toolbox import operators
|
|
from vse_toolbox.constants import ASSET_PREVIEWS
|
|
from vse_toolbox.sequencer_utils import set_active_strip, update_text_strips
|
|
from vse_toolbox.bl_utils import get_addon_prefs
|
|
|
|
|
|
modules = (
|
|
operators,
|
|
ui,
|
|
)
|
|
|
|
if 'bpy' in locals():
|
|
import importlib
|
|
for mod in modules:
|
|
importlib.reload(mod)
|
|
|
|
import bpy
|
|
|
|
|
|
def register():
|
|
bpy.app.handlers.frame_change_post.append(update_text_strips)
|
|
bpy.app.handlers.render_pre.append(update_text_strips)
|
|
|
|
for module in modules:
|
|
module.register()
|
|
|
|
bpy.app.handlers.frame_change_post.append(set_active_strip)
|
|
|
|
prefs = get_addon_prefs()
|
|
#print('\n\n-------------------', prefs.config_path)
|
|
|
|
|
|
def unregister():
|
|
bpy.app.handlers.frame_change_post.remove(update_text_strips)
|
|
bpy.app.handlers.render_pre.remove(update_text_strips)
|
|
|
|
try:
|
|
bpy.utils.previews.remove(ASSET_PREVIEWS)
|
|
except Exception as e:
|
|
pass
|
|
|
|
bpy.app.handlers.frame_change_post.remove(set_active_strip)
|
|
for module in reversed(modules):
|
|
module.unregister()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
register()
|