vse_toolbox/__init__.py

69 lines
1.6 KiB
Python
Raw Normal View History

2023-03-14 13:38:04 +01:00
# 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 panels
from vse_toolbox import preferences
from vse_toolbox import properties
from vse_toolbox import operators
2023-03-20 19:05:22 +01:00
from vse_toolbox.constants import ASSET_PREVIEWS
2023-03-17 20:03:38 +01:00
from vse_toolbox.sequencer_utils import get_active_strip
2023-03-14 13:38:04 +01:00
mods = (
properties,
preferences,
operators,
2023-03-21 18:33:29 +01:00
panels,
2023-03-14 13:38:04 +01:00
)
if 'bpy' in locals():
import importlib
for mod in mods:
importlib.reload(mod)
import bpy
def register():
if bpy.app.background:
return
for mod in mods:
mod.register()
2023-03-17 20:03:38 +01:00
bpy.app.handlers.frame_change_post.append(get_active_strip)
2023-03-14 13:38:04 +01:00
def unregister():
2023-03-20 19:05:22 +01:00
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.")
2023-03-20 19:05:22 +01:00
2023-03-14 13:38:04 +01:00
if bpy.app.background:
return
2023-03-17 20:03:38 +01:00
bpy.app.handlers.frame_change_post.remove(get_active_strip)
2023-03-14 13:38:04 +01:00
for mod in reversed(mods):
mod.unregister()
if __name__ == "__main__":
register()