rewrite import_shots and cleanup

This commit is contained in:
ChristopheSeux
2024-04-10 16:15:57 +02:00
parent dae9d55494
commit 2960bab63d
15 changed files with 1068 additions and 269 deletions
+6 -5
View File
@@ -5,13 +5,11 @@ bl_info = {
"description": "In-House Video editing Tools",
"author": "Samuel Bernou, Clement Ducarteron, Christophe Seux",
"version": (0, 1, 0),
"blender": (3, 4, 1),
"blender": (4, 0, 2),
"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
@@ -21,6 +19,7 @@ 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 = (
@@ -35,6 +34,7 @@ if 'bpy' in locals():
import bpy
def register():
bpy.app.handlers.frame_change_post.append(update_text_strips)
bpy.app.handlers.render_pre.append(update_text_strips)
@@ -44,6 +44,8 @@ def register():
bpy.app.handlers.frame_change_post.append(set_active_strip)
prefs = get_addon_prefs()
#print('\n\n-------------------', prefs.config_path)
def unregister():
@@ -54,12 +56,11 @@ def unregister():
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.")
bpy.app.handlers.frame_change_post.remove(set_active_strip)
for module in reversed(modules):
module.unregister()
if __name__ == "__main__":
register()