-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
52 lines (43 loc) · 1.22 KB
/
__init__.py
File metadata and controls
52 lines (43 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
bl_info = {
"name": "Script Manager",
"author": "LEDingQ",
"description": "",
"blender": (3, 4, 0),
"version": (0, 2, 0),
"location": "",
"warning": "",
"category": "Generic",
}
import bpy
import hashlib
from .utils import *
from . import operators
from . import ui
from . import property
from .i18n import translations_dict
def register():
try:
bpy.app.translations.register(__name__, translations_dict)
except:
pass
property.register()
operators.register()
ui.register()
# 注册文件加载完成后的处理函数
bpy.app.handlers.load_post.append(ScriptManager_load_post_handler)
# 在注册完成后恢复handlers(针对插件重新启用的情况)
def delayed_restore():
restore_handlers()
return None
bpy.app.timers.register(delayed_restore, first_interval=1.0)
def unregister():
try:
bpy.app.translations.unregister(__name__)
except:
pass
# 移除文件加载完成后的处理函数
if ScriptManager_load_post_handler in bpy.app.handlers.load_post:
bpy.app.handlers.load_post.remove(ScriptManager_load_post_handler)
property.unregister()
operators.unregister()
ui.unregister()