Skip to content

Commit cae65d7

Browse files
author
MrClock
committed
Finalized module reloading (hopefully)
1 parent f748285 commit cae65d7

File tree

5 files changed

+142
-80
lines changed

5 files changed

+142
-80
lines changed

Arma3ObjectBuilder/__init__.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,16 @@
1515
import os
1616

1717
if "bpy" in locals():
18-
utilities.reload()
19-
io.reload()
20-
props.reload()
21-
ui.reload()
18+
from importlib import reload
19+
20+
if "utilities" in locals():
21+
reload(utilities)
22+
if "io" in locals():
23+
reload(io)
24+
if "props" in locals():
25+
reload(props)
26+
if "ui" in locals():
27+
reload(ui)
2228

2329
import bpy
2430

Arma3ObjectBuilder/io/__init__.py

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,44 @@
1+
if "binary_handler" in locals():
2+
from importlib import reload
3+
4+
if "binary_handler" in locals():
5+
reload(binary_handler)
6+
if "compression" in locals():
7+
reload(compression)
8+
if "data_asc" in locals():
9+
reload(data_asc)
10+
if "data_p3d" in locals():
11+
reload(data_p3d)
12+
if "data_rap" in locals():
13+
reload(data_rap)
14+
if "data_rtm" in locals():
15+
reload(data_rtm)
16+
if "data_tbcsv" in locals():
17+
reload(data_tbcsv)
18+
if "export_asc" in locals():
19+
reload(export_asc)
20+
if "export_mcfg" in locals():
21+
reload(export_mcfg)
22+
if "export_p3d" in locals():
23+
reload(export_p3d)
24+
if "export_rtm" in locals():
25+
reload(export_rtm)
26+
if "export_tbcsv" in locals():
27+
reload(export_tbcsv)
28+
if "import_armature" in locals():
29+
reload(import_armature)
30+
if "import_asc" in locals():
31+
reload(import_asc)
32+
if "import_mcfg" in locals():
33+
reload(import_mcfg)
34+
if "import_p3d" in locals():
35+
reload(import_p3d)
36+
if "import_rtm" in locals():
37+
reload(import_rtm)
38+
if "import_tbcsv" in locals():
39+
reload(import_tbcsv)
40+
41+
142
from . import binary_handler
243
from . import compression
344
from . import data_asc
@@ -16,26 +57,3 @@
1657
from . import import_p3d
1758
from . import import_rtm
1859
from . import import_tbcsv
19-
20-
21-
def reload():
22-
from importlib import reload
23-
24-
reload(binary_handler)
25-
reload(compression)
26-
reload(data_asc)
27-
reload(data_p3d)
28-
reload(data_rap)
29-
reload(data_rtm)
30-
reload(data_tbcsv)
31-
reload(export_asc)
32-
reload(export_mcfg)
33-
reload(export_p3d)
34-
reload(export_rtm)
35-
reload(export_tbcsv)
36-
reload(import_armature)
37-
reload(import_asc)
38-
reload(import_mcfg)
39-
reload(import_p3d)
40-
reload(import_rtm)
41-
reload(import_tbcsv)

Arma3ObjectBuilder/props/__init__.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1+
if "object" in locals():
2+
from importlib import reload
3+
4+
if "action" in locals():
5+
reload(action)
6+
if "material" in locals():
7+
reload(material)
8+
if "object" in locals():
9+
reload(object)
10+
if "scene" in locals():
11+
reload(scene)
12+
13+
114
from . import action
215
from . import material
316
from . import object
417
from . import scene
5-
6-
7-
def reload():
8-
from importlib import reload
9-
10-
reload(action)
11-
reload(material)
12-
reload(object)
13-
reload(scene)

Arma3ObjectBuilder/ui/__init__.py

Lines changed: 43 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,46 @@
1+
if "props_object_mesh" in locals():
2+
from importlib import reload
3+
4+
if "import_export_armature" in locals():
5+
reload(import_export_armature)
6+
if "import_export_asc" in locals():
7+
reload(import_export_asc)
8+
if "import_export_mcfg" in locals():
9+
reload(import_export_mcfg)
10+
if "import_export_p3d" in locals():
11+
reload(import_export_p3d)
12+
if "import_export_rtm" in locals():
13+
reload(import_export_rtm)
14+
if "import_export_tbcsv" in locals():
15+
reload(import_export_tbcsv)
16+
if "props_action" in locals():
17+
reload(props_action)
18+
if "props_material" in locals():
19+
reload(props_material)
20+
if "props_object_mesh" in locals():
21+
reload(props_object_mesh)
22+
if "tool_outliner" in locals():
23+
reload(tool_outliner)
24+
if "tool_hitpoint" in locals():
25+
reload(tool_hitpoint)
26+
if "tool_mass" in locals():
27+
reload(tool_mass)
28+
if "tool_materials" in locals():
29+
reload(tool_materials)
30+
if "tool_paths" in locals():
31+
reload(tool_paths)
32+
if "tool_proxies" in locals():
33+
reload(tool_proxies)
34+
if "tool_rigging" in locals():
35+
reload(tool_rigging)
36+
if "tool_scripts" in locals():
37+
reload(tool_scripts)
38+
if "tool_utilities" in locals():
39+
reload(tool_utilities)
40+
if "tool_validation" in locals():
41+
reload(tool_validation)
42+
43+
144
from . import import_export_armature
245
from . import import_export_asc
346
from . import import_export_mcfg
@@ -17,27 +60,3 @@
1760
from . import tool_scripts
1861
from . import tool_utilities
1962
from . import tool_validation
20-
21-
22-
def reload():
23-
from importlib import reload
24-
25-
reload(import_export_armature)
26-
reload(import_export_asc)
27-
reload(import_export_mcfg)
28-
reload(import_export_p3d)
29-
reload(import_export_rtm)
30-
reload(import_export_tbcsv)
31-
reload(props_action)
32-
reload(props_material)
33-
reload(props_object_mesh)
34-
reload(tool_outliner)
35-
reload(tool_hitpoint)
36-
reload(tool_mass)
37-
reload(tool_materials)
38-
reload(tool_paths)
39-
reload(tool_proxies)
40-
reload(tool_rigging)
41-
reload(tool_scripts)
42-
reload(tool_utilities)
43-
reload(tool_validation)

Arma3ObjectBuilder/utilities/__init__.py

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,38 @@
1+
if "data" in locals():
2+
from importlib import reload
3+
4+
if "data" in locals():
5+
reload(data)
6+
if "logger" in locals():
7+
reload(logger)
8+
if "compat" in locals():
9+
reload(compat)
10+
if "clouds" in locals():
11+
reload(clouds)
12+
if "colors" in locals():
13+
reload(colors)
14+
if "proxy" in locals():
15+
reload(proxy)
16+
if "renaming" in locals():
17+
reload(renaming)
18+
if "generic" in locals():
19+
reload(generic)
20+
if "validator" in locals():
21+
reload(validator)
22+
if "flags" in locals():
23+
reload(flags)
24+
if "lod" in locals():
25+
reload(lod)
26+
if "masses" in locals():
27+
reload(masses)
28+
if "outliner" in locals():
29+
reload(outliner)
30+
if "rigging" in locals():
31+
reload(rigging)
32+
if "structure" in locals():
33+
reload(structure)
34+
35+
136
# In order of dependency
237
from . import data
338
from . import logger
@@ -14,23 +49,3 @@
1449
from . import outliner
1550
from . import rigging
1651
from . import structure
17-
18-
19-
def reload():
20-
from importlib import reload
21-
22-
reload(data)
23-
reload(logger)
24-
reload(compat)
25-
reload(clouds)
26-
reload(colors)
27-
reload(proxy)
28-
reload(renaming)
29-
reload(generic)
30-
reload(validator)
31-
reload(flags)
32-
reload(lod)
33-
reload(masses)
34-
reload(outliner)
35-
reload(rigging)
36-
reload(structure)

0 commit comments

Comments
 (0)