-
Notifications
You must be signed in to change notification settings - Fork 3
/
__init__.py
135 lines (123 loc) · 5.13 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
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 20 02:42:39 2020
@author: AsteriskAmpersand
"""
import bpy
import importlib
import addon_utils
from bpy.types import AddonPreferences
from bpy.props import StringProperty, IntProperty, BoolProperty, EnumProperty
from .struct import freedomUniteAnim
from .blender.nodetree import freeHKTree,freeHKSockets,freeHKNodes,freeHKNodeTools
from .blender.nodetree import freeHKActionNodes,freeHKDataNodes,freeHKFileNodes
from .blender import timl_controller
from .blender import lmt_tools
from .blender import lmt_operators
from .blender import binary_tools
from .blender import binary_inputs
from .blender import pl_tools
from .operators import timl_io,timl_ops,lmt_io,export_ops
from .operators import lmt_rig_ops
#from .operators import freedomUnite_io
from .error_handling.errorLists import errorItems,errorTextLevel,errorDisplayLevel
try:
from .app_license.license import licenseProperty,licenseUI
licensed = True
except:
licenseProperty = ''
licensed = False
def licenseUI(self,layout):
pass
content=bytes("","UTF-8")
bl_info = {
"name": "Free Hyper-Kinetics",
"description": "Monster Hunter Animations and Timelines Import Export Tools",
"category": "Import-Export",
"author": "AsteriskAmpersand",
"version": (1,1,0),
#1,0,0 - Alpha, Feature Complete to Original Spec
#1,1,0 - Alpha, Feature Complete to Transfer Requirements
"blender": (2,79,0),
"location":"Dopesheet > ActionEditor, NodeEditor > FreeHKNodeTree, File > Import",
"wiki_url":"https://github.com/Ezekial711/MonsterHunterWorldModding/wiki/Free-Hyperkinetics-and-Independent-TIML-Works-Overview",
"tracker_url":"https://github.com/AsteriskAmpersand/MHW-Free-HyperKinetics/issues" ,
}
class FreeHKAddonPreferences(AddonPreferences):
# this must match the add-on name, use '__package__'
# when defining this in a submodule of a python package.
bl_idname = __name__
implicit_tether = BoolProperty(
name="Implicit Tethering",
description="Performs bone function to animation linking implicitly",
default=True,
)
dumb_efx_timl = BoolProperty(
name="Retrograde EFX Mode",
description="Dumbs down the EFX importing mode to only use explicit timl declarations",
default=False,
)
graph_error = EnumProperty(name = "Graph Error Handling",items = errorItems,default = "Fix")
action_error = EnumProperty(name = "Action Error Handling",items = errorItems,default = "Fix")
fcurve_error = EnumProperty(name = "FCurve Error Handling",items = errorItems,default = "Fix")
error_text_level = EnumProperty(name = "Error Descriptiveness Level",items = errorTextLevel,default = "Verbose")
error_log_level = EnumProperty(name = "Filter Errors Output",items = errorDisplayLevel,default = "All")
export_hidden = BoolProperty(name = "Export Muted F-Curves", default = True, description = "Include Muted F-Curves on Export")
output_log = BoolProperty(name = "Log Export Info",default = True,description = "Write Export Process Information to a Log File")
output_log_folder = StringProperty(name = "Export Output Log Directory",subtype = 'DIR_PATH')
enable_wrong = BoolProperty(name = "Enable Freedom Unite Features", default = False, description = "Enables Freedom Unite Animation Tools")
if licensed:exec(licenseProperty)
def draw(self, context):
layout = self.layout
row = layout.row(align=True)
row.prop(self,"implicit_tether")
row.prop(self,"dumb_efx_timl")
row = layout.row(align = True)
row.prop(self,"output_log")
if self.output_log:
row.prop(self,"output_log_folder")
if licensed:
licenseUI(self,layout)
col = layout.column(align=True)
col.prop(self,"graph_error")
col.prop(self,"action_error")
col.prop(self,"fcurve_error")
col = layout.column(align=True)
col.prop(self,"error_text_level")
col.prop(self,"error_log_level")
col = layout.column(align=True)
col.prop(self,"export_hidden")
col.prop(self,"enable_wrong")
modules = [timl_controller,lmt_tools,
freeHKTree,freeHKSockets,freeHKNodes,freeHKNodeTools,
freeHKActionNodes,freeHKDataNodes,freeHKFileNodes,
timl_io,timl_ops,lmt_io,lmt_operators,export_ops,
lmt_rig_ops,binary_tools,binary_inputs,freedomUniteAnim,
pl_tools
#freedomUnite_io
]
classes = []
importFunctions = []
exportFunctions = []
def register():
bpy.utils.register_class(FreeHKAddonPreferences)
for cl in classes:
bpy.utils.register_class(cl)
for iF in exportFunctions:
bpy.types.INFO_MT_file_export.append(iF)
for r in modules:
r.register()
def unregister():
bpy.utils.unregister_class(FreeHKAddonPreferences)
for cl in classes:
bpy.utils.unregister_class(cl)
for iF in exportFunctions:
bpy.types.INFO_MT_file_export.remove(iF)
for u in modules:
u.unregister()
if __name__ == "__main__":
try:
unregister()
except:
pass
register()