-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path__init__.py
138 lines (128 loc) · 4.45 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#Author: NSA Cloud
bl_info = {
"name": "RE Toolbox",
"author": "NSA Cloud",
"version": (3, 0),
"blender": (2, 93, 0),
"location": "View3D > Tool Shelf > RE Toolbox",
"description": "Extra utilities to make working with RE Engine files easier",
"warning": "",
"wiki_url": "https://github.com/NSACloud/RE-Toolbox",
"tracker_url": "https://github.com/NSACloud/RE-Toolbox/issues",
"category": "3D View"}
import bpy
from . import addon_updater_ops
import os
from bpy.types import AddonPreferences
from .modules.re_toolbox_propertyGroups import ExportEntryPropertyGroup,MESH_UL_BatchExportList,REToolboxPanelPropertyGroup
from .modules.ui_re_toolbox_panels import OBJECT_PT_REToolsMeshToolsPanel,OBJECT_PT_REToolsVisibilityPanel,OBJECT_PT_REToolsQuickExportPanel
from .modules.re_toolbox_operators import (WM_OT_AddItemOperator,
WM_OT_RemoveItemOperator,
WM_OT_ReorderItemOperator,
WM_OT_AddBoneNumbers,
WM_OT_RemoveBoneNumbers,
WM_OT_SeparateChainBones,
WM_OT_TriangulateMeshes,
WM_OT_SolveRepeatedUVs,
WM_OT_SplitSharpEdges,
#WM_OT_SolveRepeatedUVsNew,
WM_OT_DeleteLoose,
WM_OT_RenameMeshToREFormat,
#WM_OT_RenameMHWToMHR,
#WM_OT_RenameMHRToMHW,
WM_OT_RemoveZeroWeightVertexGroups,
#WM_OT_TransferWeightsFromActive,
WM_OT_LimitTotalNormalizeAll,
WM_OT_QuickExport,
WM_OT_SetBatchExportOptions,
WM_OT_CreateMeshCollection,
)
class REToolboxPreferences(AddonPreferences):
bl_idname = __name__
# addon updater preferences
auto_check_update: bpy.props.BoolProperty(
name = "Auto-check for Update",
description = "If enabled, auto-check for updates using an interval",
default = False,
)
updater_interval_months: bpy.props.IntProperty(
name='Months',
description = "Number of months between checking for updates",
default=0,
min=0
)
updater_interval_days: bpy.props.IntProperty(
name='Days',
description = "Number of days between checking for updates",
default=7,
min=0,
)
updater_interval_hours: bpy.props.IntProperty(
name='Hours',
description = "Number of hours between checking for updates",
default=0,
min=0,
max=23
)
updater_interval_minutes: bpy.props.IntProperty(
name='Minutes',
description = "Number of minutes between checking for updates",
default=0,
min=0,
max=59
)
def draw(self, context):
layout = self.layout
split = layout.split(factor = .3)
col1 = split.column()
col2 = split.column()
col3 = split.column()
op = col2.operator(
'wm.url_open',
text='Donate on Ko-fi',
icon='FUND'
)
op.url = 'https://ko-fi.com/nsacloud'
addon_updater_ops.update_settings_ui(self,context)
os.system("color")#Enable console colors
# Registration
classes = [
REToolboxPreferences,
ExportEntryPropertyGroup,
MESH_UL_BatchExportList,
REToolboxPanelPropertyGroup,
OBJECT_PT_REToolsMeshToolsPanel,
OBJECT_PT_REToolsVisibilityPanel,
OBJECT_PT_REToolsQuickExportPanel,
WM_OT_AddItemOperator,
WM_OT_RemoveItemOperator,
WM_OT_ReorderItemOperator,
WM_OT_SetBatchExportOptions,
WM_OT_AddBoneNumbers,
WM_OT_RemoveBoneNumbers,
WM_OT_SeparateChainBones,
WM_OT_TriangulateMeshes,
WM_OT_SolveRepeatedUVs,
#WM_OT_SolveRepeatedUVsNew,
WM_OT_SplitSharpEdges,
WM_OT_DeleteLoose,
WM_OT_RenameMeshToREFormat,
#WM_OT_RenameMHWToMHR,
#WM_OT_RenameMHRToMHW,
WM_OT_RemoveZeroWeightVertexGroups,
#WM_OT_TransferWeightsFromActive,
WM_OT_LimitTotalNormalizeAll,
WM_OT_QuickExport,
WM_OT_CreateMeshCollection,
]
def register():
addon_updater_ops.register(bl_info)
for classEntry in classes:
bpy.utils.register_class(classEntry)
bpy.types.Scene.re_toolbox_toolpanel = bpy.props.PointerProperty(type=REToolboxPanelPropertyGroup)
def unregister():
addon_updater_ops.unregister()
for classEntry in classes:
bpy.utils.unregister_class(classEntry)
if __name__ == '__main__':
register()