vse_toolbox/__init__.py

66 lines
1.7 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
2023-05-02 20:46:45 +02:00
#sys.modules['vse_toolbox'] = sys.modules.pop(Path(__file__).parent.name)
2023-03-14 13:38:04 +01:00
2023-05-02 18:38:16 +02:00
from vse_toolbox import ui
2023-03-14 13:38:04 +01:00
from vse_toolbox import operators
2023-03-20 19:05:22 +01:00
from vse_toolbox.constants import ASSET_PREVIEWS
2023-04-14 18:55:00 +02:00
from vse_toolbox.sequencer_utils import set_active_strip, update_text_strips
2023-03-14 13:38:04 +01:00
2023-04-14 18:55:00 +02:00
modules = (
2023-03-14 13:38:04 +01:00
operators,
2023-05-02 18:38:16 +02:00
ui,
2023-03-14 13:38:04 +01:00
)
if 'bpy' in locals():
import importlib
2023-05-02 18:38:16 +02:00
for mod in modules:
importlib.reload(mod)
2023-03-14 13:38:04 +01:00
import bpy
def register():
2023-05-05 16:54:00 +02:00
bpy.app.handlers.frame_change_post.append(update_text_strips)
2023-05-19 11:51:05 +02:00
bpy.app.handlers.render_pre.append(update_text_strips)
2023-05-05 16:54:00 +02:00
2023-04-14 18:55:00 +02:00
for module in modules:
module.register()
2023-03-14 13:38:04 +01:00
2023-04-14 18:55:00 +02:00
bpy.app.handlers.frame_change_post.append(set_active_strip)
2023-05-05 16:54:00 +02:00
2023-03-17 20:03:38 +01:00
2023-03-20 19:05:22 +01:00
2023-05-02 18:38:16 +02:00
def unregister():
2023-05-05 16:54:00 +02:00
bpy.app.handlers.frame_change_post.remove(update_text_strips)
2023-05-19 11:51:05 +02:00
bpy.app.handlers.render_pre.remove(update_text_strips)
2023-05-05 16:54:00 +02: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-04-14 18:55:00 +02:00
bpy.app.handlers.frame_change_post.remove(set_active_strip)
for module in reversed(modules):
module.unregister()
2023-03-14 13:38:04 +01:00
if __name__ == "__main__":
register()