ross-g / io_pdx_mesh

Import/Export files for the Clausewitz game engine
GNU General Public License v3.0
88 stars 11 forks source link

Saving of PDX meshes (even if nothing was changed) leads to missing textures after reopening the saved file #51

Closed Ajeyyy closed 3 years ago

Ajeyyy commented 3 years ago

Hi first of all: great tool and thank you for providing it!

So i am kinda new to blender and using this tool, so sorry if i missed something obvious but after installing your plugin i am able to open Stellaris PDX mesh files and rework them and save them successfully after opening Stellaris mesh files for the first time and then they are getting loaded correctly in game. so far so good.

but unfortunately when i try to open any of those previously via Blender + your plugin saved mesh files again with blender then the "rendering" does not work anymore (shows pink color) and when i ignore this and save them again then the 3D model looks black without any texturing in game. this is > not < only the case when i actually reworked/edited any Stellaris mesh file but also happens if i just did nothing apart from

  1. opening stellaris mesh file (texture/rendering works)
  2. immediately saving stellaris mesh file with blender + your plugin - nothing has been changed here (texture/rendering works)
  3. reopening the same mesh file blender + your plugin (texture/rendering does not work)

the only workaround i found was that i had to recreate all work-steps again when i wanted to edit a mesh file that i previously worked on and saved for the first time but this is getting annoying and not reasonable for me since i want to be able to work on mesh files more than one time and save/reload the progress. so can anybody maybe tell me what i am doing wrong? or if this is a bug of the plugin?

PS: using Windows 10, Blender 2.92.0 and your most current plugin + Stellaris

Ajeyyy commented 3 years ago

some modders told me what's causing the issue (i.e. saving mesh files into different folders where the textures are not located). so after saving the textures into the same folder it's working fine. this can be closed/deleted. thanks again for providing your great tool!

ross-g commented 3 years ago

Yep you found the reason there - basically the mesh file only stores the assigned textures filename within it, there's no folder path etc. So when you import stuff with the tool it will only check for textures in the same folder that you are importing from.

This was reported before (see #2 ) so at some point I'd like to make the import better at searching for textures in neighbouring folders.