leotorrez / XXMITools

43 stars 6 forks source link

.vb name issue exporting when part is empty #2

Closed ray0sunshine closed 2 months ago

ray0sunshine commented 3 months ago

If I delete all vertices in a part (eg. GanyuDress) the export breaks saying it can't find GanyuDress.vb0 while in the filesystem there is a GanyuDress.vb:

Wrote 3338 vertices to C:\Users\Ray\Desktop\Genshin Mod\3dmigoto\Mods\Ganyu\GanyuHead.vb0
Wrote 12822 indices to C:\Users\Ray\Desktop\Genshin Mod\3dmigoto\Mods\Ganyu\GanyuHead.ib
Wrote 10972 vertices to C:\Users\Ray\Desktop\Genshin Mod\3dmigoto\Mods\Ganyu\GanyuBody.vb0
Wrote 34338 indices to C:\Users\Ray\Desktop\Genshin Mod\3dmigoto\Mods\Ganyu\GanyuBody.ib
Python: Traceback (most recent call last):
  File "C:\Users\Ray\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\XXMI-Tools\migoto\operators.py", line 811, in execute
    export_3dmigoto_xxmi(self, context, object_name, vb_path, ib_path, fmt_path, self.use_foldername, self.ignore_hidden, self.only_selected, self.no_ramps, self.delete_intermediate, self.credit, self.copy_textures, outline_properties, game)
  File "C:\Users\Ray\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\XXMI-Tools\migoto\datahandling.py", line 2509, in export_3dmigoto_xxmi
    generate_mod_folder(os.path.dirname(vb_path), object_name, no_ramps, delete_intermediate, credit, copy_textures, game)
  File "C:\Users\Ray\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\XXMI-Tools\migoto\datahandling.py", line 2650, in generate_mod_folder
    os.remove(os.path.join(path, f"{current_name}{current_object}.vb0"))
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:\\Users\\Ray\\Desktop\\Genshin Mod\\3dmigoto\\Mods\\Ganyu\\GanyuDress.vb0'

Workaround is to leave at least 1 vertex in the object.

leotorrez commented 3 months ago

seems like an oversight on the file generation when theres no vertex found. I should be able to patch it with ease

leotorrez commented 2 months ago

issue solved in the 1.2.4 version im about to release