-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path__init__.py
93 lines (77 loc) · 3.27 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
# Copyright © 2024 GDCorner
# This is licensed under the MIT license. See the LICENSE file for full details
# https://choosealicense.com/licenses/mit/
# <pep8 compliant>
import sys
import importlib
from . import rhvtinfo
bl_info = {
"name": "Rush Hour Unreal Vehicle Toolkit",
"description": "Provides utilities and functions to easily create, setup and export vehicles for Unreal Engine 5 and Rush Hour",
"author": "Philip Edwards (GDCorner) <[email protected]>",
"version": (1, 5, 2),
"blender": (3, 6, 0),
"supported_blender_versions": [(3, 6, 0), (4, 2, 0)],
"category": "Vehicles",
"doc_url": "https://www.gdcorner.com/products/RushHour.html",
}
modulesNames = [
'utils.math_helpers',
'utils.mesh_helpers',
'utils.message_helpers',
'utils.collection_helpers',
'utils.uv_helpers',
'utils.vehicle_checks',
'ui.ui_auto_uv_panel',
'ui.ui_rush_hour_panel',
'ui.ui_prep_warnings_panel',
'ui.ui_simple_vehicle_prep_panel',
'ui.ui_advanced_vehicle_prep_panel',
'operators.operator_check_vehicle',
'operators.operator_scale_UV_worldspace',
'operators.operator_tag_auto_uv',
'operators.operator_export_vehicle',
'operators.operator_set_scene_scale',
'operators.operator_center_vehicle',
'operators.operator_prepare_vehicle_for_unreal',
'operators.operator_create_vehicle_collections',
'operators.operator_rig_vehicle',
'operators.operator_show_object_bounds',
'operators.operator_simple_export',
'operators.operator_simple_prepare_scene',
'operators.operator_clear_parents',
'operators.operator_add_to_vehicle_sub_collection',
'ui.warning_details.ui_warn_file_not_saved_panel',
'ui.warning_details.ui_warn_exceed_nanite_materials_panel',
'ui.warning_details.ui_warn_wrong_facing_panel',
'ui.warning_details.ui_warn_negative_scales_panel',
'ui.warning_details.ui_warn_unexpected_length_panel',
'ui.warning_details.ui_warn_wheel_sizes_panel',
'ui.warning_details.ui_warn_blender_version_panel'
]
# Registration block from https://b3d.interplanety.org/en/creating-multifile-add-on-for-blender/
def generate_full_module_names():
full_names = {}
for curr_module_name in modulesNames:
full_names[curr_module_name] = ('{}.{}'.format(__name__, curr_module_name))
return full_names
module_full_names = generate_full_module_names()
for current_module_full_name in module_full_names.values():
if current_module_full_name in sys.modules:
importlib.reload(sys.modules[current_module_full_name])
else:
globals()[current_module_full_name] = importlib.import_module(current_module_full_name)
setattr(globals()[current_module_full_name], 'modulesNames', module_full_names)
def register():
for currentModuleName in module_full_names.values():
if currentModuleName in sys.modules:
if hasattr(sys.modules[currentModuleName], 'register'):
sys.modules[currentModuleName].register()
def unregister():
for currentModuleName in module_full_names.values():
if currentModuleName in sys.modules:
if hasattr(sys.modules[currentModuleName], 'unregister'):
sys.modules[currentModuleName].unregister()
rhvtinfo.addon_bl_info = bl_info
if __name__ == "__main__":
register()