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),
|
2024-04-10 16:15:57 +02:00
|
|
|
"blender": (4, 0, 2),
|
2023-03-14 13:38:04 +01:00
|
|
|
"location": "Sequencer",
|
|
|
|
"warning": "",
|
|
|
|
"category": "Sequencer",
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
2024-04-10 16:15:57 +02:00
|
|
|
from vse_toolbox.bl_utils import get_addon_prefs
|
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
|
|
|
|
|
2024-04-10 16:15:57 +02:00
|
|
|
|
2023-03-14 13:38:04 +01:00
|
|
|
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
|
|
|
|
2024-04-10 16:15:57 +02:00
|
|
|
prefs = get_addon_prefs()
|
|
|
|
#print('\n\n-------------------', prefs.config_path)
|
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
|
|
|
|
2023-03-24 11:04:47 +01:00
|
|
|
try:
|
|
|
|
bpy.utils.previews.remove(ASSET_PREVIEWS)
|
|
|
|
except Exception as e:
|
|
|
|
pass
|
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
|
|
|
|
2024-04-10 16:15:57 +02:00
|
|
|
|
2023-03-14 13:38:04 +01:00
|
|
|
if __name__ == "__main__":
|
|
|
|
register()
|