Skip to content

Commit a47eb69

Browse files
committed
More work for the tag upgrader
1 parent f0b8e3f commit a47eb69

18 files changed

Lines changed: 664 additions & 323 deletions

File tree

io_scene_halo/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Steven Garcia
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

io_scene_halo/README.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Halo-Asset-Blender-Development-Toolset
2+
3+
## Toolset Description
4+
The Halo Asset Blender Development Toolset is a Blender addon developed in python to aid with creating assets for multiple Halo titles. This addon requires that you have Blender 4.0.0 or above on your system to function.
5+
6+
Please consider supporting me on KoFi at the following link.
7+
8+
https://ko-fi.com/general101
9+
10+
## Supported Titles and Features
11+
The following games are or will be supported by this script:
12+
13+
* Halo Custom Edition
14+
* Halo 2 Vista
15+
* Halo Combat Evolved Anniversary MCC - Classic
16+
* Halo 2 Anniversary MCC - Classic
17+
* Halo 3 MCC
18+
* Halo 3 ODST MCC
19+
* Halo Reach MCC (Cinematic cameras specifically Use Foundry if you want levels and meshes.)
20+
* Halo 4 MCC (Cinematic cameras specifically. Use Foundry if you want levels and meshes.)
21+
22+
Script supports the following features:
23+
24+
Feature | Halo Custom Edition/Halo Combat Evolved Anniversary MCC - Classic | Halo 2 Vista/Halo 2 Anniversary MCC - Classic | Halo 3 MCC/ Halo 3 ODST MCC | Halo Reach MCC | Halo 4 MCC
25+
--------------------------- | ----------------------------------------------------------------- | ---------------------------------------------- | ------------------------------- | ---------------------- | ----------------------
26+
Levels (ASS) | N/A | Full Support | Partial Support[^1] | N/A | N/A
27+
GBXmodel (JMS) | Full Support | N/A | N/A | N/A | N/A
28+
Render Model (JMS) | Full Support | Full Support | Full Support | Full Support | N/A
29+
Collision Geometry (JMS) | Full Support | Full Support | Full Support | Full Support | N/A
30+
Physics Models (JMS) | Full Support | Partial Support[^2] | Partial Support[^2] | N/A | N/A
31+
Animations (JMA) | Full Support | Full Support | Full Support | Full Support | N/A
32+
Cinematics(QUA) | N/A | N/A | Partial Support (WIP) | Partial Support (WIP) | Partial Support (WIP)
33+
JMI Exporting | Full Support | Full Support | Full Support | Full Support | N/A
34+
WRL Importing | Full Support | Full Support | Full Support | N/A | N/A
35+
JMS Importing | Partial Support[^3] | Partial Support[^2][^3] | Partial Support[^2][^3] | Full Support | N/A
36+
JMA Importing | Full Support | Full Support | Full Support | Full Support | N/A
37+
ASS Importing | N/A | Partial Support[^3] | Partial Support[^3][^1] | N/A | N/A
38+
QUA Importing | N/A | N/A | Partial Support | Partial Support (WIP) | Partial Support (WIP)
39+
Structure_BSP Tag Importing | Partial Support | Partial Support | No Support | N/A | N/A
40+
GBXModel Tag Importing | Full Support | N/A | N/A | N/A | N/A
41+
Model Tag Importing | Full Support | Full Support | No Support | N/A | N/A
42+
Collision Tag Importing | Full Support | Full Support | No Support | N/A | N/A
43+
Animation Tag Importing | Partial Support[^4] | No Support | No Support | N/A | N/A
44+
Camera Track Tag Importing | Full Support | Full Support | No Support | N/A | N/A
45+
46+
[^1]: Toolset is currently missing support for importing or exporting certain Halo 3 JMS/ASS features such as the W coordinate in UVW.
47+
[^2]: Car wheel and prismatic constraints are not exported or imported properly. WIP
48+
[^3]: JMS/ASS files imported into Blender do not have their triangles connected properly. This means that imported models are improper due to the exporter using vertex normals instead of loop normals.
49+
[^4]: Imported animations tags currently do not have fixed overlay animations.
50+
51+
## Documentation
52+
See the following links for information on exporting or importing assets from these tools:
53+
54+
[C20 Docs](https://c20.reclaimers.net/)
55+
56+
[H2Codez Docs](https://num0005.github.io/h2codez_docs/w/home.html)
57+
58+
## Credits
59+
60+
* Cyboryxmen
61+
* For making the original JMS script known as WaltzStreet that was used as a reference.
62+
* [WaltzStreet](http://forum.halomaps.org/index.cfm?page=topic&topicID=42486)
63+
64+
* Discord user Aerial Dave#2236
65+
* For making the original ASS script known as blend2halo2 that was used as a reference.
66+
* [Blend2Halo2](http://forum.halomaps.org/index.cfm?page=topic&topicID=48139)
67+
68+
* Discord user conscars
69+
* For testing, suggestions, a bug fix, and the WRL import code that is being used for this project.
70+
* [WRL to OBJ](https://github.com/csauve/mek/blob/wrl-to-obj-colors/tools_misc/wrl_to_obj.py)
71+
72+
* Discord user MercyMoon#3864
73+
* For developing the Halo materials tool Helper scripts in the toolset.
74+
75+
* Discord user Fulsy#1228
76+
* For some modifications done to the WaltzStreet version the script was based on.
77+
78+
* Discord user mosesofegypt
79+
* For some modifications done to the WaltzStreet version the script was based on, Stubbs related tooling, and advice on animation data.
80+
81+
* Discord user num0005
82+
* For help with code reviews and several features.
83+
84+
* 343 Industries/Discord user kornman00
85+
* Thanks to Kornman for aiding the development of the toolset by answering questions and 343 Industries/Microsoft for allowing this to happen in the first place.
86+
87+
* The Sigmmma crew
88+
* For some tips on importing assets and for MEK defs along with some math used in the Halo 1 tag importing code.
89+
* [Sigmmma](https://github.com/Sigmmma)
90+
91+
* Discord user chiefster_4014
92+
* For contributing to the Halo 1 shader nodes used in this project.
93+
94+
* Discord user dogbrainludus
95+
* For contributing to the Halo 1 shader nodes used in this project.
96+
97+
* Discord user meowsandstuff
98+
* For contributing to the Halo 2 shader nodes used in this project.
99+
100+
* Discord user JackOfChaos
101+
* For contributing to the Halo 1 and Halo 2 shader nodes used in this project.
102+
103+
* Discord user general_101
104+
* Getting the ball rolling I guess?

io_scene_halo/file_ass/build_scene.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,14 @@ def build_scene(context, filepath, report):
112112
if game_title == "halo1":
113113
output_dir = os.path.join(os.path.dirname(tag_common.h1_defs_directory), "h1_merged_output")
114114
tag_groups = tag_common.h1_tag_groups
115-
engine_tag = tag_interface.EngineTag.H1Latest.value
115+
engine_tag = tag_common.EngineTag.H1Latest.value
116116
merged_defs = h1.generate_defs(tag_common.h1_defs_directory, output_dir)
117117
tag_directory = bpy.context.preferences.addons["io_scene_halo"].preferences.halo_1_tag_path
118118

119119
elif game_title == "halo2":
120120
output_dir = os.path.join(os.path.dirname(tag_common.h1_defs_directory), "h2_merged_output")
121121
tag_groups = tag_common.h2_tag_groups
122-
engine_tag = tag_interface.EngineTag.H2Latest.value
122+
engine_tag = tag_common.EngineTag.H2Latest.value
123123
merged_defs = h2.generate_defs(tag_common.h2_defs_directory, output_dir)
124124
tag_directory = bpy.context.preferences.addons["io_scene_halo"].preferences.halo_2_tag_path
125125
else:

io_scene_halo/file_jma/build_scene.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def build_scene(context, JMA, JMS_A, JMS_B, filepath, game_version, fix_parents,
332332
output_dir = os.path.join(os.path.dirname(tag_common.h1_defs_directory), "h1_merged_output")
333333
tag_groups = tag_common.h1_tag_groups
334334
tag_extensions = tag_common.h1_tag_extensions
335-
engine_tag = tag_interface.EngineTag.H1Latest.value
335+
engine_tag = tag_common.EngineTag.H1Latest.value
336336
merged_defs = h1.generate_defs(tag_common.h1_defs_directory, output_dir)
337337
tags_directory = bpy.context.preferences.addons["io_scene_halo"].preferences.halo_1_tag_path
338338
data_directory = bpy.context.preferences.addons["io_scene_halo"].preferences.halo_1_data_path

io_scene_halo/file_tag/build_scene/build_animations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def build_scene(context, tag_ref, asset_cache, game_title, fix_rotations, empty_
106106
output_dir = os.path.join(os.path.dirname(tag_common.h1_defs_directory), "h1_merged_output")
107107
tag_groups = tag_common.h1_tag_groups
108108
tag_extensions = tag_common.h1_tag_extensions
109-
engine_tag = tag_interface.EngineTag.H1Latest.value
109+
engine_tag = tag_common.EngineTag.H1Latest.value
110110
merged_defs = h1.generate_defs(tag_common.h1_defs_directory, output_dir)
111111
tags_directory = bpy.context.preferences.addons["io_scene_halo"].preferences.halo_1_tag_path
112112

io_scene_halo/file_tag/export_tag.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ def write_file(context, file_path, report):
4646
output_dir = os.path.join(os.path.dirname(tag_common.h1_defs_directory), "h1_merged_output")
4747
tag_groups = tag_common.h1_tag_groups
4848
tag_extensions = tag_common.h1_tag_extensions
49-
engine_tag = tag_interface.EngineTag.H1Latest.value
49+
engine_tag = tag_common.EngineTag.H1Latest.value
5050
merged_defs = h1.generate_defs(tag_common.h1_defs_directory, output_dir)
5151
tags_directory = bpy.context.preferences.addons["io_scene_halo"].preferences.halo_1_tag_path
5252

5353
elif game_title == "halo2":
5454
output_dir = os.path.join(os.path.dirname(tag_common.h1_defs_directory), "h2_merged_output")
5555
tag_groups = tag_common.h2_tag_groups
5656
tag_extensions = tag_common.h2_tag_extensions
57-
engine_tag = tag_interface.EngineTag.H2Latest.value
57+
engine_tag = tag_common.EngineTag.H2Latest.value
5858
merged_defs = h2.generate_defs(tag_common.h2_defs_directory, output_dir)
5959
tags_directory = bpy.context.preferences.addons["io_scene_halo"].preferences.halo_2_tag_path
6060
else:

io_scene_halo/file_tag/import_tag.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ def load_file(context, file_path, game_title, fix_rotations, empty_markers, repo
6363
output_dir = os.path.join(os.path.dirname(tag_common.h1_defs_directory), "h1_merged_output")
6464
tag_groups = tag_common.h1_tag_groups
6565
tag_extensions = tag_common.h1_tag_extensions
66-
engine_tag = tag_interface.EngineTag.H1Latest.value
66+
engine_tag = tag_common.EngineTag.H1Latest.value
6767
merged_defs = h1.generate_defs(tag_common.h1_defs_directory, output_dir)
6868
tags_directory = bpy.context.preferences.addons["io_scene_halo"].preferences.halo_1_tag_path
6969

7070
elif game_title == "halo2":
7171
output_dir = os.path.join(os.path.dirname(tag_common.h1_defs_directory), "h2_merged_output")
7272
tag_groups = tag_common.h2_tag_groups
7373
tag_extensions = tag_common.h2_tag_extensions
74-
engine_tag = tag_interface.EngineTag.H2Latest.value
74+
engine_tag = tag_common.EngineTag.H2Latest.value
7575
merged_defs = h2.generate_defs(tag_common.h2_defs_directory, output_dir)
7676
tags_directory = bpy.context.preferences.addons["io_scene_halo"].preferences.halo_2_tag_path
7777
else:

io_scene_halo/file_tag/tag_interface/tag_interface.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1924,10 +1924,9 @@ def write_file(merged_defs, tag_dict, obfuscation_buffer, file_path="", engine_t
19241924
if tag_header is not None:
19251925
tag_group = tag_header["tag group"]
19261926
tag_extension = tag_groups.get(tag_group)
1927-
1928-
19291927
upgrade_function = upgrade_functions.get(tag_group)
1930-
if tag_header["engine tag"] == "blam" and engine_tag is not tag_common.EngineTag.H1Latest.value:
1928+
1929+
if tag_header["engine tag"] == "blam" and engine_tag is not tag_common.EngineTag.H1Latest.value and upgrade_function is not None:
19311930
tag_dict = upgrade_function(tag_dict, tag_common.EngineTag)
19321931
tag_header = tag_dict.get("Header")
19331932

@@ -2105,8 +2104,8 @@ def h2_single_tag():
21052104
output_dir = os.path.join(os.path.dirname(tag_common.h2_defs_directory), "h2_merged_output")
21062105
merged_defs = h2.generate_defs(tag_common.h2_defs_directory, output_dir)
21072106

2108-
read_path = r"E:\Program Files (x86)\Steam\steamapps\common\Halo MCCEK\Halo Assets\2\Vanilla\tags\tag1.biped"
2109-
output_path = r"E:\Program Files (x86)\Steam\steamapps\common\Halo MCCEK\Halo Assets\2\Vanilla\tags\tag2.biped"
2107+
read_path = r"E:\Program Files (x86)\Steam\steamapps\common\Halo MCCEK\Halo Assets\2\Vanilla\tags\tag1.decal"
2108+
output_path = r"E:\Program Files (x86)\Steam\steamapps\common\Halo MCCEK\Halo Assets\2\Vanilla\tags\tag2.decal"
21102109
tag_directory = r"E:\Program Files (x86)\Steam\steamapps\common\Halo MCCEK\Halo Assets\2\Vanilla\tags"
21112110

21122111
tag_dict = read_file(merged_defs, tag_directory, read_path)

io_scene_halo/file_tag/tag_interface/tag_upgrading/h1.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,25 @@
2525
# ##### END MIT LICENSE BLOCK #####
2626

2727
from .h1_functions.biped import upgrade_biped
28+
from .h1_functions.bitmap import upgrade_bitmap
29+
from .h1_functions.contrail import upgrade_contrail
30+
from .h1_functions.damage_effect import upgrade_damage_effect
31+
from .h1_functions.decal import upgrade_decal
2832

2933
upgrade_functions = {
3034
"actr": None,
3135
"actv": None,
3236
"ant!": None,
3337
"antr": None,
3438
"bipd": upgrade_biped,
35-
"bitm": None,
39+
"bitm": upgrade_bitmap,
3640
"boom": None,
3741
"cdmg": None,
3842
"coll": None,
3943
"colo": None,
40-
"cont": None,
44+
"cont": upgrade_contrail,
4145
"ctrl": None,
42-
"deca": None,
46+
"deca": upgrade_decal,
4347
"DeLa": None,
4448
"devc": None,
4549
"devi": None,
@@ -59,7 +63,7 @@
5963
"hudg": None,
6064
"item": None,
6165
"itmc": None,
62-
"jpt!": None,
66+
"jpt!": upgrade_damage_effect,
6367
"lens": None,
6468
"lifi": None,
6569
"ligh": None,

io_scene_halo/file_tag/tag_interface/tag_upgrading/h1_functions/biped.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def upgrade_biped(h1_biped_asset, EngineTag):
236236
"name": "",
237237
"tag group": "bipd",
238238
"checksum": 0,
239-
"data offset": 0,
239+
"data offset": 64,
240240
"data length": 0,
241241
"unk2": 0,
242242
"version": 3,

0 commit comments

Comments
 (0)