DarkStarSword / 3d-fixes

Stereoscopic 3D fixes using Helix mod & 3DMigoto
105 stars 126 forks source link

3dmigoto-blender Export Error #29

Open 53nemu opened 8 months ago

53nemu commented 8 months ago

Hi, I'm sorry to bother you again.

When I use an older version plugin (created by you rather than modified by others), I encounter the following error when attempting to output the model I aimed to delete the skirt from "polySurface6085_10" and remove the top while keeping the tie. So, I imported the 3DMigoto raw buffers (only importing "polySurface6085_10.ib" and "polySurface6085_10.vb"). Essentially, my objective is to unpack the original models within the game, make modifications, and repack them for the game to read.

However, afterwards, Blender prompts the following error:

Python: Traceback (most recent call last): File "C:\Users\ROG\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\blender_3dmigoto (2).py", line 1399, in execute export_3dmigoto(self, context, vb_path, ib_path, fmt_path) File "C:\Users\ROG\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\blender_3dmigoto (2).py", line 1044, in export_3dmigoto stride = obj['3DMigoto:VBStride'] KeyError: 'bpy_struct[key]: key "3DMigoto:VBStride" not found'

I have uploaded the older version of the plugin I used, and I would greatly appreciate it if you could take the time to help me identify where the issue might be occurring. Thank you very much for your assistance.

Also, my English is not very good, which might make it difficult for you to read. I'm really sorry. original model&old version plugin&modified model(blender file).zip

DarkStarSword commented 8 months ago

Right, the script stores a bunch of info in the custom properties attached to the object: image

"3DMigoto:VBStride" became "3DMigoto:VB0Stride" in the update that added support for multiple vertex buffers - the new script can load .blend files with the old name for backwards compatibility, but the old script doesn't know about the new name hence that error. You should be able to rename the property in the custom properties panel if you need to.

53nemu commented 8 months ago

Right, the script stores a bunch of info in the custom properties attached to the object: image

"3DMigoto:VBStride" became "3DMigoto:VB0Stride" in the update that added support for multiple vertex buffers - the new script can load .blend files with the old name for backwards compatibility, but the old script doesn't know about the new name hence that error. You should be able to rename the property in the custom properties panel if you need to.

Thank you very much for your response. I have indeed tried the new version, but encountered some other issues. I would greatly appreciate it if you could help me with those as well.

I have downloaded the latest version you released.

When attempting to export the model, Blender defaults to using the .vb0 extension, resulting in four files with extensions .vb, .vb0, .fmt, and .vgmap. When I try to re-import a previously exported model (using the original .ib file with the .vb file having the .vb0 extension), Blender prompts me to provide the .fmt file. Regardless of whether I provide the original .fmt file from the unpacked data or the .fmt file generated during the export of the new model, I encounter the following error

Python: Traceback (most recent call last): File "C:\Users\ROG\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\blender_3dmigoto.py", line 2561, in execute import_3dmigoto_raw_buffers(self, context, vb_fmt_path, ib_fmt_path, migoto_raw_import_options) File "C:\Users\ROG\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\blender_3dmigoto.py", line 2441, in import_3dmigoto_raw_buffers obj = import_3dmigoto(operator, context, paths, merge_meshes=False, kwargs) File "C:\Users\ROG\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\blender_3dmigoto.py", line 1305, in import_3dmigoto obj.append(import_3dmigoto_vb_ib(operator, context, [p], **kwargs)) File "C:\Users\ROG\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\blender_3dmigoto.py", line 1368, in import_3dmigoto_vb_ib (blend_indices, blend_weights, texcoords, vertex_layers, use_normals) = import_vertices(mesh, obj, vb, operator, semantic_translations, flip_normal) File "C:\Users\ROG\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\blender_3dmigoto.py", line 1277, in import_vertices import_normals_step1(mesh, data, vertex_layers, operator, translate_normal) File "C:\Users\ROG\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\blender_3dmigoto.py", line 1010, in import_normals_step1 l.normal[:] = normals[l.vertex_index] IndexError: list index out of range

When using the newly generated .vb file along with the original .ib file, it directly triggers an error. This issue might arise due to compatibility problems between the newly exported .vb file and the original .ib file.

Could you please confirm? first second polySurface6085_10.zip

in zip there are the original .ib file and export file by the lastest plugin (the .vb0 file has been renamed)

53nemu commented 8 months ago

Right, the script stores a bunch of info in the custom properties attached to the object: image

"3DMigoto:VBStride" became "3DMigoto:VB0Stride" in the update that added support for multiple vertex buffers - the new script can load .blend files with the old name for backwards compatibility, but the old script doesn't know about the new name hence that error. You should be able to rename the property in the custom properties panel if you need to.

Oh, my goodness! I was able to export and re-import successfully after changing 3DMigoto:VBStride in the settings. Thank you! This is my first time creating a mod for the legend of heroes: hajimari no kiseki, and also my first time modifying 3D mods. I'm so grateful for your help.