71 lines
1.7 KiB
Python
71 lines
1.7 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": (3, 4, 1),
|
|
"location": "Sequencer",
|
|
"warning": "",
|
|
"category": "Sequencer",
|
|
}
|
|
# "doc_url": "https://github.com/Pullusb/REPONAME",
|
|
# "tracker_url": "https://github.com/Pullusb/REPONAME/issues",
|
|
|
|
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
|
|
|
|
|
|
modules = (
|
|
operators,
|
|
ui,
|
|
)
|
|
|
|
if 'bpy' in locals():
|
|
import importlib
|
|
for mod in modules:
|
|
importlib.reload(mod)
|
|
|
|
import bpy
|
|
|
|
def register():
|
|
print('Register update script handler')
|
|
bpy.app.handlers.frame_change_post.append(update_text_strips)
|
|
|
|
if bpy.app.background:
|
|
return
|
|
|
|
for module in modules:
|
|
module.register()
|
|
|
|
bpy.app.handlers.frame_change_post.append(set_active_strip)
|
|
|
|
|
|
|
|
def unregister():
|
|
bpy.app.handlers.frame_change_post.remove(update_text_strips)
|
|
|
|
try:
|
|
bpy.utils.previews.remove(ASSET_PREVIEWS)
|
|
except Exception as e:
|
|
pass
|
|
# print(f"!-- {e} --!")
|
|
# print(f"No preview collection found. {ASSET_PREVIEWS} can't be remove.")
|
|
|
|
if bpy.app.background:
|
|
return
|
|
|
|
bpy.app.handlers.frame_change_post.remove(set_active_strip)
|
|
for module in reversed(modules):
|
|
module.unregister()
|
|
|
|
if __name__ == "__main__":
|
|
register()
|