From b4ab031a715f9aa787674b4da714cf00b328dafa Mon Sep 17 00:00:00 2001 From: Olexander Date: Mon, 11 Aug 2025 10:45:05 +0300 Subject: [PATCH 01/19] more context for templates --- migoto/exporter.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/migoto/exporter.py b/migoto/exporter.py index 31b246a..756a9ab 100644 --- a/migoto/exporter.py +++ b/migoto/exporter.py @@ -485,6 +485,11 @@ def generate_ini( credit=self.credit, game=self.game, character_name=self.mod_name, + apply_modifiers=self.apply_modifiers, + copy_textures=self.copy_textures, + ignore_duplicate_textures=self.copy_textures and self.ignore_duplicate_textures, + no_ramps=self.no_ramps, + write_buffers=self.write_buffers ) ) ini_file.clean_up_indentation() From b5107163f604f28287feab47993c700bd52d7848 Mon Sep 17 00:00:00 2001 From: Olexander Date: Mon, 11 Aug 2025 10:51:35 +0300 Subject: [PATCH 02/19] direct pass of value --- migoto/exporter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migoto/exporter.py b/migoto/exporter.py index 756a9ab..7f0cf67 100644 --- a/migoto/exporter.py +++ b/migoto/exporter.py @@ -487,7 +487,7 @@ def generate_ini( character_name=self.mod_name, apply_modifiers=self.apply_modifiers, copy_textures=self.copy_textures, - ignore_duplicate_textures=self.copy_textures and self.ignore_duplicate_textures, + ignore_duplicate_textures=self.ignore_duplicate_textures, no_ramps=self.no_ramps, write_buffers=self.write_buffers ) From 9cf63996686c0a5ed3722beb85ffafe88c7a85df Mon Sep 17 00:00:00 2001 From: Olexander Date: Mon, 11 Aug 2025 13:42:51 +0300 Subject: [PATCH 03/19] index_count --- migoto/exporter.py | 1 + 1 file changed, 1 insertion(+) diff --git a/migoto/exporter.py b/migoto/exporter.py index 7f0cf67..7448a45 100644 --- a/migoto/exporter.py +++ b/migoto/exporter.py @@ -51,6 +51,7 @@ class Part: objects: list[SubObj] textures: list[TextureData] first_index: int + index_count: int = 0 vertex_count: int = 0 From 23e6043eaa02d72266858d55495bccf53bf734ec Mon Sep 17 00:00:00 2001 From: Olexander Date: Mon, 11 Aug 2025 13:46:38 +0300 Subject: [PATCH 04/19] index_count --- migoto/exporter.py | 1 + 1 file changed, 1 insertion(+) diff --git a/migoto/exporter.py b/migoto/exporter.py index 7448a45..814ef68 100644 --- a/migoto/exporter.py +++ b/migoto/exporter.py @@ -236,6 +236,7 @@ def __post_init__(self) -> None: objects=objects, textures=textures, first_index=component["object_indexes"][j], + index_count=component["object_index_counts"][j] ) ) self.mod_file.components.append(component_entry) From e4de9be1d2c2bd26106373a81639f5543742a839 Mon Sep 17 00:00:00 2001 From: Olexander Date: Mon, 11 Aug 2025 14:03:50 +0300 Subject: [PATCH 05/19] out of range fallback --- migoto/exporter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migoto/exporter.py b/migoto/exporter.py index 814ef68..d5d9a7b 100644 --- a/migoto/exporter.py +++ b/migoto/exporter.py @@ -236,7 +236,7 @@ def __post_init__(self) -> None: objects=objects, textures=textures, first_index=component["object_indexes"][j], - index_count=component["object_index_counts"][j] + index_count=component["object_index_counts"][j] if "object_index_counts" in component else 0 ) ) self.mod_file.components.append(component_entry) From 335ae885ca3d6f51cdeda6f24443e51e935abeee Mon Sep 17 00:00:00 2001 From: Olexander Date: Mon, 11 Aug 2025 14:14:26 +0300 Subject: [PATCH 06/19] zzz template --- templates/Zenless Zone Zero.ini.j2 | 68 ++++++++++++++++++------------ 1 file changed, 42 insertions(+), 26 deletions(-) diff --git a/templates/Zenless Zone Zero.ini.j2 b/templates/Zenless Zone Zero.ini.j2 index 87b6afc..425c765 100644 --- a/templates/Zenless Zone Zero.ini.j2 +++ b/templates/Zenless Zone Zero.ini.j2 @@ -34,18 +34,18 @@ {% block overridesbuffers %} {% for component in mod_file.components if component.draw_vb != "" and component.blend_vb != "" and component.vertex_count > 0 %} - [TextureOverride{{ component.fullname }}Blend] - hash = {{ component.blend_vb }} - handling = skip - vb2 = Resource{{ component.fullname }}Blend - if DRAW_TYPE == 1 - vb0 = Resource{{ component.fullname }}Position - draw = {{ component.vertex_count }}, 0 - {% if credit != "" %} - - $active = 1 - {% endif %} - endif + [TextureOverride{{ component.fullname }}Blend] + hash = {{ component.blend_vb }} + handling = skip + vb2 = Resource{{ component.fullname }}Blend + if DRAW_TYPE == 1 + vb0 = Resource{{ component.fullname }}Position + draw = {{ component.vertex_count }}, 0 + {% if credit != "" %} + + $active = 1 + {% endif %} + endif [TextureOverride{{ component.fullname }}Texcoord] hash = {{ component.texcoord_vb }} @@ -69,7 +69,7 @@ {% endblock %} {% block overridesibs %} - {% for component in mod_file.components if component.draw_vb != "" %} + {% for component in mod_file.components if component.draw_vb != "" %} [TextureOverride{{component.fullname}}IB] hash = {{ component.ib }} handling = skip @@ -78,11 +78,16 @@ [TextureOverride{{ part.fullname }}] hash = {{ component.ib }} match_first_index = {{ part.first_index }} + {% if part.index_count > 0 %} + match_index_count = {{part.index_count}} + {% endif %} ib = Resource{{ part.fullname }}IB - {% for texture in part.textures %} - Resource\ZZMI\{{ texture.name }} = ref Resource{{ part.fullname }}{{ texture.name }} - {% endfor %} - run = CommandList\ZZMI\SetTextures + {% if part.textures|length > 0%} + {% for texture in part.textures %} + Resource\ZZMI\{{ texture.name }} = ref Resource{{ part.fullname }}{{ texture.name }} + {% endfor %} + run = CommandList\ZZMI\SetTextures + {% endif %} {% for entry in part.objects if entry.vertex_count > 0 %} {% if loop.previtem and loop.previtem.collection_name != entry.collection_name %} ; {{ entry.collection_name }} @@ -93,14 +98,25 @@ {% endfor %} {% endfor %} - {% for component in mod_file.components if component.draw_vb == "" %} - {% for part in component.parts %} - {% for texture in part.textures %} - [TextureOverride{{part.fullname}}{{ texture.name }}] - hash = {{ texture.hash }} - this = Resource{{part.fullname}}{{ texture.name }} - {% endfor %} + {% for data in mod_file.hash_data if data.draw_vb == "" and data.position_vb == "" and copy_textures%} + {% set i = 0 %} + {% for textures in data.texture_hashes %} + {% if textures|length > 0 %} + {% set i = loop.index0 %} + [TextureOverride{{character_name}}{{data.component_name}}{{data.object_classifications[i]}}] + hash = {{data.ib}} + match_first_index = {{data.object_indexes[i]}} + {% set index_counts = data.get("object_index_counts", []) %} + {% if index_counts|length > 0%} + match_index_count = {{index_counts[i]}} + {% endif %} + {% for texture in textures if texture|length > 0 %} + Resource\ZZMI\{{texture[0]}} = ref Resource{{character_name}}{{data.component_name}}{{data.object_classifications[i]}}{{texture[0]}} + {% endfor %} + run = CommandList\ZZMI\SetTextures + + {%endif%} {% endfor %} {% endfor %} {% endblock %} @@ -123,7 +139,7 @@ stride = {{ component.strides.texcoord }} filename = {{ component.fullname }}Texcoord.buf {% endif %} - + {% for part in component.parts %} [Resource{{ part.fullname }}IB] type = Buffer @@ -139,7 +155,7 @@ stride = {{ component.strides.position }} filename = {{ component.fullname }}.buf {% endif %} - + {% for part in component.parts %} [Resource{{ part.fullname }}IB] type = Buffer From 2e1748bf371120fb2d52173f73ed503a77dde581 Mon Sep 17 00:00:00 2001 From: "oleksandr.fedotov" Date: Tue, 19 Aug 2025 11:57:05 +0300 Subject: [PATCH 07/19] .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index be87d6a..8016114 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ pyproject.toml uv.lock .python-version TODO.md +.idea/ \ No newline at end of file From 5a2a714645fe082453aafecfc83279a692009397 Mon Sep 17 00:00:00 2001 From: "oleksandr.fedotov" Date: Tue, 19 Aug 2025 11:57:16 +0300 Subject: [PATCH 08/19] zzz template update --- templates/Zenless Zone Zero.ini.j2 | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/templates/Zenless Zone Zero.ini.j2 b/templates/Zenless Zone Zero.ini.j2 index 425c765..590cbb4 100644 --- a/templates/Zenless Zone Zero.ini.j2 +++ b/templates/Zenless Zone Zero.ini.j2 @@ -98,21 +98,17 @@ {% endfor %} {% endfor %} - - {% for data in mod_file.hash_data if data.draw_vb == "" and data.position_vb == "" and copy_textures%} - {% set i = 0 %} - {% for textures in data.texture_hashes %} - {% if textures|length > 0 %} - {% set i = loop.index0 %} - [TextureOverride{{character_name}}{{data.component_name}}{{data.object_classifications[i]}}] - hash = {{data.ib}} - match_first_index = {{data.object_indexes[i]}} - {% set index_counts = data.get("object_index_counts", []) %} - {% if index_counts|length > 0%} - match_index_count = {{index_counts[i]}} + {% for component in mod_file.components if component.draw_vb == "" and component.position_vb == "" %} + {% for part in component.parts %} + {% if part.textures|length > 0 %} + [TextureOverride{{ part.fullname }}] + hash = {{component.ib}} + match_first_index = {{ part.first_index }} + {% if part.index_count > 0 %} + match_index_count = {{part.index_count}} {% endif %} - {% for texture in textures if texture|length > 0 %} - Resource\ZZMI\{{texture[0]}} = ref Resource{{character_name}}{{data.component_name}}{{data.object_classifications[i]}}{{texture[0]}} + {% for texture in part.textures %} + Resource\ZZMI\{{ texture.name }} = ref Resource{{ part.fullname }}{{ texture.name }} {% endfor %} run = CommandList\ZZMI\SetTextures @@ -195,4 +191,4 @@ {{- self.resourcebuffers() -}} {{- self.resourcetextures() -}} {{- self.resourcecredit() -}} -{% endblock %} +{% endblock %} \ No newline at end of file From 3ba6343fc0b16420bbb55522dd0970280f674f91 Mon Sep 17 00:00:00 2001 From: "oleksandr.fedotov" Date: Tue, 19 Aug 2025 16:08:05 +0300 Subject: [PATCH 09/19] zzz template update --- templates/Zenless Zone Zero.ini.j2 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/templates/Zenless Zone Zero.ini.j2 b/templates/Zenless Zone Zero.ini.j2 index 590cbb4..275f023 100644 --- a/templates/Zenless Zone Zero.ini.j2 +++ b/templates/Zenless Zone Zero.ini.j2 @@ -99,13 +99,16 @@ {% endfor %} {% endfor %} {% for component in mod_file.components if component.draw_vb == "" and component.position_vb == "" %} + {% set count = component.parts | selectattr('textures') | list | length %} {% for part in component.parts %} {% if part.textures|length > 0 %} [TextureOverride{{ part.fullname }}] hash = {{component.ib}} - match_first_index = {{ part.first_index }} - {% if part.index_count > 0 %} - match_index_count = {{part.index_count}} + {% if count > 1 %} + match_first_index = {{ part.first_index }} + {% if part.index_count > 0 %} + match_index_count = {{part.index_count}} + {% endif %} {% endif %} {% for texture in part.textures %} Resource\ZZMI\{{ texture.name }} = ref Resource{{ part.fullname }}{{ texture.name }} From 03ec0e0dfd5db60dcc594f74d3d9a9cca4f42f4d Mon Sep 17 00:00:00 2001 From: "oleksandr.fedotov" Date: Tue, 19 Aug 2025 16:08:45 +0300 Subject: [PATCH 10/19] ADD: VertexCount & IndexCount to custom properties --- migoto/import_ops.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/migoto/import_ops.py b/migoto/import_ops.py index b1c218a..43eb3e4 100644 --- a/migoto/import_ops.py +++ b/migoto/import_ops.py @@ -527,6 +527,7 @@ def import_3dmigoto_vb_ib( obj["3DMigoto:Topology"] = vb.topology for raw_vb in vb.vbs: obj["3DMigoto:VB%iStride" % raw_vb.idx] = raw_vb.stride + obj["3DMigoto:VertexCount"] = vb.vertex_count obj["3DMigoto:FirstVertex"] = vb.first # Record these import options so the exporter can set them to match by # default. Might also consider adding them to the .fmt file so reimporting @@ -547,6 +548,7 @@ def import_3dmigoto_vb_ib( # Attach the index buffer layout to the object for later exporting. obj["3DMigoto:IBFormat"] = ib.format obj["3DMigoto:FirstIndex"] = ib.first + obj["3DMigoto:IndexCount"] = ib.index_count elif vb.topology == "trianglelist": import_faces_from_vb_trianglelist(mesh, vb, flip_winding) elif vb.topology == "trianglestrip": From 56d9aca6eb3012bfdf26cba97453f61398ffa9ae Mon Sep 17 00:00:00 2001 From: "oleksandr.fedotov" Date: Tue, 19 Aug 2025 16:09:24 +0300 Subject: [PATCH 11/19] main update --- migoto/exporter.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/migoto/exporter.py b/migoto/exporter.py index d5d9a7b..1119408 100644 --- a/migoto/exporter.py +++ b/migoto/exporter.py @@ -181,7 +181,7 @@ def __post_init__(self) -> None: comp_matching_objs: list[Object] = [ obj for obj in candidate_objs if obj.name.startswith(current_name) ] - if len(comp_matching_objs) == 0: + if len(comp_matching_objs) == 0 and component["draw_vb"] != "": continue for j, part in enumerate(component["object_classifications"]): part_name: str = current_name + part @@ -304,6 +304,15 @@ def generate_buffers(self) -> None: self.files_to_write = {} self.files_to_copy = {} for component in self.mod_file.components: + if component.draw_vb == "": + for part in component.parts: + print(f"Processing {part.fullname} " + "-" * 10) + for t in part.textures: + tex_name = part.fullname + t.name + t.extension + self.files_to_copy[self.dump_path / tex_name] = ( + self.destination / tex_name + ) + continue data_model: DataModelXXMI = DataModelXXMI.from_obj( component.parts[0].objects[0].obj, game=self.game, @@ -705,4 +714,4 @@ def load_hashes(self, path: Path) -> list[dict]: with open(path, "r") as f: char_hashes = json.load(f) # TODO: Check for hash.json integrity - return char_hashes + return char_hashes \ No newline at end of file From ec85a8614e5113a5dba4370ebed530551f1f4b3f Mon Sep 17 00:00:00 2001 From: "oleksandr.fedotov" Date: Tue, 19 Aug 2025 16:10:12 +0300 Subject: [PATCH 12/19] IndexCount from custom properties for template --- migoto/exporter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migoto/exporter.py b/migoto/exporter.py index 1119408..5159eac 100644 --- a/migoto/exporter.py +++ b/migoto/exporter.py @@ -236,7 +236,7 @@ def __post_init__(self) -> None: objects=objects, textures=textures, first_index=component["object_indexes"][j], - index_count=component["object_index_counts"][j] if "object_index_counts" in component else 0 + index_count=objects[0].obj.get("3DMigoto:IndexCount", 0) if len(objects) > 0 else 0, ) ) self.mod_file.components.append(component_entry) From 4863ea80b3deba94a53e1cb507082d1394a2a0c8 Mon Sep 17 00:00:00 2001 From: "oleksandr.fedotov" Date: Wed, 20 Aug 2025 10:20:36 +0300 Subject: [PATCH 13/19] getting index_counts from hash.json --- migoto/exporter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migoto/exporter.py b/migoto/exporter.py index 5159eac..86918bd 100644 --- a/migoto/exporter.py +++ b/migoto/exporter.py @@ -236,7 +236,7 @@ def __post_init__(self) -> None: objects=objects, textures=textures, first_index=component["object_indexes"][j], - index_count=objects[0].obj.get("3DMigoto:IndexCount", 0) if len(objects) > 0 else 0, + index_count=component["object_index_counts"][j] if "object_index_counts" in component and component["object_index_counts"][j] > 0 else (objects[0].obj.get("3DMigoto:IndexCount", 0) if len(objects) > 0 else 0), ) ) self.mod_file.components.append(component_entry) From b0f6f78537b2a7c3fcaacc86c9d13f2036446fe3 Mon Sep 17 00:00:00 2001 From: "oleksandr.fedotov" Date: Wed, 20 Aug 2025 10:21:13 +0300 Subject: [PATCH 14/19] exposing names parts for templates --- migoto/exporter.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/migoto/exporter.py b/migoto/exporter.py index 86918bd..42b2791 100644 --- a/migoto/exporter.py +++ b/migoto/exporter.py @@ -48,6 +48,8 @@ class TextureData: @dataclass class Part: fullname: str + name: str + classification: str objects: list[SubObj] textures: list[TextureData] first_index: int @@ -58,6 +60,7 @@ class Part: @dataclass class Component: fullname: str + name: str parts: list[Part] root_vs: str draw_vb: str @@ -169,6 +172,7 @@ def __post_init__(self) -> None: current_name: str = f"{self.mod_name}{component['component_name']}" component_entry: Component = Component( fullname=current_name, + name=component['component_name'], parts=[], root_vs=component.get("root_vs", ""), draw_vb=component.get("draw_vb", ""), @@ -233,6 +237,8 @@ def __post_init__(self) -> None: component_entry.parts.append( Part( fullname=part_name, + name=current_name, + classification=part, objects=objects, textures=textures, first_index=component["object_indexes"][j], From a59a0b86922755fc5e4758e678ee86c45685c686 Mon Sep 17 00:00:00 2001 From: "oleksandr.fedotov" Date: Mon, 25 Aug 2025 09:30:04 +0300 Subject: [PATCH 15/19] REFINE: Update Part and Component dataclasses to include fullname and improve index_count handling --- migoto/exporter.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/migoto/exporter.py b/migoto/exporter.py index 42b2791..d74d31c 100644 --- a/migoto/exporter.py +++ b/migoto/exporter.py @@ -47,20 +47,19 @@ class TextureData: @dataclass class Part: - fullname: str name: str - classification: str + fullname: str objects: list[SubObj] textures: list[TextureData] first_index: int - index_count: int = 0 vertex_count: int = 0 + index_count: int = 0 @dataclass class Component: - fullname: str name: str + fullname: str parts: list[Part] root_vs: str draw_vb: str @@ -171,8 +170,8 @@ def __post_init__(self) -> None: for component in self.hash_data: current_name: str = f"{self.mod_name}{component['component_name']}" component_entry: Component = Component( - fullname=current_name, name=component['component_name'], + fullname=current_name, parts=[], root_vs=component.get("root_vs", ""), draw_vb=component.get("draw_vb", ""), @@ -234,15 +233,25 @@ def __post_init__(self) -> None: self.obj_from_col(obj, None, objects) else: self.obj_from_col(obj, collection[0], objects) + index_count: int = 0 + if len(objects) > 0: + index_count = objects[0].obj.get("3DMigoto:IndexCount", 0) + else: + try: + index_count = component["object_index_counts"][j] if "object_index_counts" in component else 0 + except IndexError: + self.operator.report( + {"WARNING"}, + f"Index count for part {part_name} not found in hash.json. Defaulting to 0.", + ) component_entry.parts.append( Part( fullname=part_name, name=current_name, - classification=part, objects=objects, textures=textures, first_index=component["object_indexes"][j], - index_count=component["object_index_counts"][j] if "object_index_counts" in component and component["object_index_counts"][j] > 0 else (objects[0].obj.get("3DMigoto:IndexCount", 0) if len(objects) > 0 else 0), + index_count=index_count, ) ) self.mod_file.components.append(component_entry) From 1ea7a288f6f170c7d9dca48898f9f942821640f8 Mon Sep 17 00:00:00 2001 From: "oleksandr.fedotov" Date: Mon, 25 Aug 2025 10:00:09 +0300 Subject: [PATCH 16/19] REFINE: Update Part instantiation to use 'part' variable for name --- migoto/exporter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migoto/exporter.py b/migoto/exporter.py index d74d31c..b51b1a7 100644 --- a/migoto/exporter.py +++ b/migoto/exporter.py @@ -247,7 +247,7 @@ def __post_init__(self) -> None: component_entry.parts.append( Part( fullname=part_name, - name=current_name, + name=part, objects=objects, textures=textures, first_index=component["object_indexes"][j], From d0c89128645110bfcbf445a828fdb1c56b940ffa Mon Sep 17 00:00:00 2001 From: "oleksandr.fedotov" Date: Wed, 29 Oct 2025 11:06:29 +0200 Subject: [PATCH 17/19] REFINE: Simplify TextureOverride handling and improve part condition checks --- templates/Zenless Zone Zero.ini.j2 | 33 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/templates/Zenless Zone Zero.ini.j2 b/templates/Zenless Zone Zero.ini.j2 index 275f023..4c400fd 100644 --- a/templates/Zenless Zone Zero.ini.j2 +++ b/templates/Zenless Zone Zero.ini.j2 @@ -70,31 +70,30 @@ {% block overridesibs %} {% for component in mod_file.components if component.draw_vb != "" %} - [TextureOverride{{component.fullname}}IB] - hash = {{ component.ib }} - handling = skip - - {% for part in component.parts if part.vertex_count > 0 %} + {% for part in component.parts %} [TextureOverride{{ part.fullname }}] hash = {{ component.ib }} match_first_index = {{ part.first_index }} {% if part.index_count > 0 %} match_index_count = {{part.index_count}} {% endif %} - ib = Resource{{ part.fullname }}IB - {% if part.textures|length > 0%} - {% for texture in part.textures %} - Resource\ZZMI\{{ texture.name }} = ref Resource{{ part.fullname }}{{ texture.name }} + handling = skip + {% if part.vertex_count > 0 %} + ib = Resource{{ part.fullname }}IB + {% if part.textures|length > 0%} + {% for texture in part.textures %} + Resource\ZZMI\{{ texture.name }} = ref Resource{{ part.fullname }}{{ texture.name }} + {% endfor %} + run = CommandList\ZZMI\SetTextures + {% endif %} + {% for entry in part.objects if entry.vertex_count > 0 %} + {% if loop.previtem and loop.previtem.collection_name != entry.collection_name %} + ; {{ entry.collection_name }} + {% endif %} + ; {{ entry.name }} ({{ entry.vertex_count }}) + drawindexed = {{ entry.index_count}}, {{ entry.index_offset }}, 0 {% endfor %} - run = CommandList\ZZMI\SetTextures {% endif %} - {% for entry in part.objects if entry.vertex_count > 0 %} - {% if loop.previtem and loop.previtem.collection_name != entry.collection_name %} - ; {{ entry.collection_name }} - {% endif %} - ; {{ entry.name }} ({{ entry.vertex_count }}) - drawindexed = {{ entry.index_count}}, {{ entry.index_offset }}, 0 - {% endfor %} {% endfor %} {% endfor %} From e16dface729fcdd8e977e5765ee3e738b4f9a466 Mon Sep 17 00:00:00 2001 From: Olexander Date: Wed, 26 Nov 2025 10:45:34 +0200 Subject: [PATCH 18/19] Skip texture files for handling skipped parts Filter parts based on vertex count and draw_vb condition. --- templates/Zenless Zone Zero.ini.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/Zenless Zone Zero.ini.j2 b/templates/Zenless Zone Zero.ini.j2 index 4c400fd..83ea662 100644 --- a/templates/Zenless Zone Zero.ini.j2 +++ b/templates/Zenless Zone Zero.ini.j2 @@ -166,7 +166,7 @@ {% block resourcetextures %} {% for component in mod_file.components %} - {% for part in component.parts %} + {% for part in component.parts if (component.draw_vb != "" and part.vertex_count > 0) or (component.draw_vb == "" and component.position_vb == "") %} {% for texture in part.textures %} [Resource{{ part.fullname }}{{ texture.name }}] filename = {{ part.fullname }}{{ texture.name }}{{ texture.extension }} @@ -193,4 +193,4 @@ {{- self.resourcebuffers() -}} {{- self.resourcetextures() -}} {{- self.resourcecredit() -}} -{% endblock %} \ No newline at end of file +{% endblock %} From 942762f05be06c6683f1b6333f201c1c11873f66 Mon Sep 17 00:00:00 2001 From: Olexander Date: Thu, 27 Nov 2025 09:07:34 +0200 Subject: [PATCH 19/19] skip files creation for empty objects --- migoto/exporter.py | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/migoto/exporter.py b/migoto/exporter.py index b51b1a7..f337338 100644 --- a/migoto/exporter.py +++ b/migoto/exporter.py @@ -353,11 +353,12 @@ def generate_buffers(self) -> None: layout=data_model.buffers_format["IB"] ) ib_offset: int = 0 - for t in part.textures: - tex_name = part.fullname + t.name + t.extension - self.files_to_copy[self.dump_path / tex_name] = ( - self.destination / tex_name - ) + if (component.draw_vb != "" and part.vertex_count > 0) or (component.draw_vb == "" and component.position_vb == ""): + for t in part.textures: + tex_name = part.fullname + t.name + t.extension + self.files_to_copy[self.dump_path / tex_name] = ( + self.destination / tex_name + ) if component.draw_vb == "": continue for entry in part.objects: @@ -403,20 +404,21 @@ def generate_buffers(self) -> None: if self.outline_optimization: self.optimize_outlines(out_buffers, component_ib) if component.blend_vb != "": - self.files_to_write[ - self.destination / (component.fullname + "Position.buf") - ] = out_buffers["Position"].data - self.files_to_write[ - self.destination / (component.fullname + "Blend.buf") - ] = out_buffers["Blend"].data - self.files_to_write[ - self.destination / (component.fullname + "Texcoord.buf") - ] = out_buffers["TexCoord"].data - component.strides = { - k.lower(): v.stride - for k, v in data_model.buffers_format.items() - if k != "IB" - } + if any([part.vertex_count for part in component.parts]): + self.files_to_write[ + self.destination / (component.fullname + "Position.buf") + ] = out_buffers["Position"].data + self.files_to_write[ + self.destination / (component.fullname + "Blend.buf") + ] = out_buffers["Blend"].data + self.files_to_write[ + self.destination / (component.fullname + "Texcoord.buf") + ] = out_buffers["TexCoord"].data + component.strides = { + k.lower(): v.stride + for k, v in data_model.buffers_format.items() + if k != "IB" + } continue self.files_to_write[self.destination / (component.fullname + ".buf")] = ( out_buffers["Position"].data @@ -729,4 +731,4 @@ def load_hashes(self, path: Path) -> list[dict]: with open(path, "r") as f: char_hashes = json.load(f) # TODO: Check for hash.json integrity - return char_hashes \ No newline at end of file + return char_hashes