Start of Translations
- This is the start of the translations system, does not yet work as I can't seem to get it to swap languages, I too tired today to fix it but it's a start. - It also adds properties registration as well.
This commit is contained in:
+12
-15
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
if "bpy" not in locals():
|
||||
import bpy
|
||||
from . import ui
|
||||
@@ -7,28 +5,27 @@ if "bpy" not in locals():
|
||||
from . import functions
|
||||
from .core import register
|
||||
from .core.register import __bl_ordered_classes
|
||||
from .core import properties
|
||||
else:
|
||||
import importlib
|
||||
importlib.reload(ui)
|
||||
importlib.reload(core)
|
||||
importlib.reload(functions)
|
||||
|
||||
importlib.reload(properties)
|
||||
|
||||
def register():
|
||||
print("Registering Avatar Toolkit")
|
||||
# Order the classes before registration
|
||||
properties.register()
|
||||
core.register.order_classes()
|
||||
# Register the UI classes
|
||||
|
||||
# Iterate over the classes to register and register them
|
||||
for cls in __bl_ordered_classes:
|
||||
print("registering" + str(cls))
|
||||
bpy.utils.register_class(cls)
|
||||
core.register.register_properties()
|
||||
for cls in core.register.__bl_ordered_classes:
|
||||
print("registering " + str(cls))
|
||||
bpy.utils.register_class(cls)
|
||||
|
||||
def unregister():
|
||||
print("Unregistering Avatar Toolkit")
|
||||
# Unregister the UI classes
|
||||
|
||||
# Iterate over the classes to unregister in reverse order and unregister them
|
||||
for cls in reversed(list(__bl_ordered_classes)):
|
||||
for cls in reversed(core.register.__bl_ordered_classes):
|
||||
bpy.utils.unregister_class(cls)
|
||||
print("unregistering" + str(cls))
|
||||
print("unregistering " + str(cls))
|
||||
core.register.unregister_properties()
|
||||
properties.unregister()
|
||||
|
||||
Reference in New Issue
Block a user