This repository has been archived by the owner on Aug 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path__init__.py
92 lines (70 loc) · 2.7 KB
/
__init__.py
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import bpy.props
# Nico: The __init__.py only designed to register and unregister ,so as a simple control for the whole plugin,
# keep it clean and don't add too many code,code should be in other files and import it here.
# we use .utils instead of utils because blender can't locate where utils is
# Blender can only locate panel.py only when you add a . before it.
from .mmt_panel.panel_ui import *
from .mmt_rightclick_menu.mesh_operator import *
from .mmt_animation.animation_operator import *
bl_info = {
"name": "MMT",
"description": "MMT-Community's Blender Plugin",
"blender": (3, 6, 0),
"version": (1, 0, 5, 8),
"location": "View3D",
"warning": "Only support Blender 3.6 LTS",
"category": "Generic"
}
register_classes = (
# migoto
MMTPathProperties,
MMTPathOperator,
MMTPanel,
Import3DMigotoFrameAnalysis,
Import3DMigotoRaw,
Import3DMigotoReferenceInputFormat,
Export3DMigoto,
# mesh_operator 右键菜单栏
RemoveUnusedVertexGroupOperator,
MergeVertexGroupsWithSameNumber,
FillVertexGroupGaps,
AddBoneFromVertexGroup,
RemoveNotNumberVertexGroup,
ConvertToFragmentOperator,
MMTDeleteLoose,
MMTResetRotation,
MigotoRightClickMenu,
MMTCancelAutoSmooth,
MMTShowIndexedVertices,
MMTSetAutoSmooth89,
SplitMeshByCommonVertexGroup,
# MMT的一键导入导出
MMTImportAllTextModel,
MMTExportAllIBVBModel,
# MMD类型动画Mod支持
MMDModIniGenerator
)
def register():
for cls in register_classes:
# make_annotations(cls)
bpy.utils.register_class(cls)
# 新建一个属性用来专门装MMT的路径
bpy.types.Scene.mmt_props = bpy.props.PointerProperty(type=MMTPathProperties)
# mesh_operator
bpy.types.VIEW3D_MT_object_context_menu.append(menu_func_migoto_right_click)
# 在Blender退出前保存选择的MMT的路径
bpy.app.handlers.depsgraph_update_post.append(save_mmt_path)
# MMT数值保存的变量
bpy.types.Scene.mmt_mmd_animation_mod_start_frame = bpy.props.IntProperty(name="Start Frame")
bpy.types.Scene.mmt_mmd_animation_mod_end_frame = bpy.props.IntProperty(name="End Frame")
bpy.types.Scene.mmt_mmd_animation_mod_play_speed = bpy.props.FloatProperty(name="Play Speed")
def unregister():
for cls in reversed(register_classes):
bpy.utils.unregister_class(cls)
del bpy.types.Scene.mmt_props
# mesh_operator
bpy.types.VIEW3D_MT_object_context_menu.remove(menu_func_migoto_right_click)
# 退出注册时删除MMT的MMD变量
del bpy.types.Scene.mmt_mmd_animation_mod_start_frame
del bpy.types.Scene.mmt_mmd_animation_mod_end_frame
del bpy.types.Scene.mmt_mmd_animation_mod_play_speed