Created
October 10, 2021 15:32
-
-
Save Dragorn421/6d97b0f7864600dcda7e9ca04c01e915 to your computer and use it in GitHub Desktop.
List resources and attribute orders used in zapd xmls in oot decomp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xml.etree.ElementTree | |
import io | |
import os | |
resources_tags = set() | |
resources_attribs = dict() | |
et = None | |
try: | |
for root, dirs, files in os.walk("assets/xml"): | |
et = None | |
for name in files: | |
file = os.path.join(root, name) | |
et = xml.etree.ElementTree.parse(file) | |
for file_node in et.getroot(): | |
for resource in file_node: | |
resources_tags.add(resource.tag) | |
resource_attribs = resources_attribs.get(resource.tag) | |
if resource_attribs is None: | |
resource_attribs = dict() | |
resources_attribs[resource.tag] = resource_attribs | |
resource_attribs_list = tuple(resource.attrib.keys()) | |
resource_attribs[resource_attribs_list] = 1 + resource_attribs.get(resource_attribs_list, 0) | |
except: | |
print("Error!") | |
if et is None: | |
print("et is None") | |
else: | |
xml.etree.ElementTree.dump(et) | |
raise | |
print("Resource tags:", ", ".join(resources_tags)) | |
print("Attributes by resource:") | |
for resource_tag, resource_attribs in resources_attribs.items(): | |
print(resource_tag) | |
for resource_attribs_list, count in resource_attribs.items(): | |
print(f"\t{count: >4}\t", " ".join(resource_attribs_list)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Resource tags: Animation, Blob, CurveAnimation, Room, Limb, DList, Skeleton, Mtx, Symbol, LimbTable, LegacyAnimation, Collision, Scene, Path, Array, Cutscene, Texture, PlayerAnimation | |
Attributes by resource: | |
DList | |
3193 Name Offset | |
Texture | |
4079 Name OutName Format Width Height Offset | |
5 Name Offset OutName Format Width Height | |
202 Name OutName Format Width Height Offset TlutOffset | |
3 Name Format Width Height Offset TlutOffset | |
28 Name Format Width Height Offset | |
27 Name OutName Format TlutOffset Width Height Offset | |
35 Name OutName Format Width Height TlutOffset Offset | |
4 Name OutName Width Height Format Offset | |
9 Name OutName Format Height Width Offset | |
68 Name OutName Format Width Height | |
Array | |
47 Name Count Offset | |
Symbol | |
1 Name Type TypeSize Count Offset | |
Collision | |
193 Name Offset | |
Animation | |
1154 Name Offset | |
Blob | |
90 Name Size Offset | |
6 Name Offset Size | |
1 Name Size | |
Limb | |
2113 Name LimbType Offset | |
448 Name Type Offset | |
Skeleton | |
187 Name Type LimbType Offset | |
LegacyAnimation | |
12 Name Offset | |
LimbTable | |
1 Name LimbType Count Offset | |
Mtx | |
1 Name Offset | |
PlayerAnimation | |
573 Name Offset | |
CurveAnimation | |
3 Name SkelOffset Offset | |
Scene | |
110 Name Offset | |
Room | |
400 Name Offset | |
1 Name HackMode Offset | |
Cutscene | |
47 Name Offset | |
Path | |
16 Name Offset |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment