Lego Star Wars Skywalker Saga PC .TEXTURE and TSH files

Textures, recreate headers, conversions, algorithms and parsing of image files
Puterboy1
Posts: 382
Joined: Wed Sep 12, 2018 2:22 am

Lego Star Wars Skywalker Saga PC .TEXTURE and TSH files

Post by Puterboy1 »

I would like to convert these to PNGs.
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: Lego Star Wars Skywalker Saga PC .TEXTURE and TSH files

Post by spiritovod »

Here is script for converting TEXTURE and NXG_TEXTURES files into respective dds. Currently only DXT1/5 and BC6/7 textures can be converted.

Update: Script is updated to support BC6 textures. Also some fixes are applied for better handling of already supported formats.
Update 2: Script is updated to support extraction of separate textures from NXG_TEXTURES files. You can modify the script according to included comments to strip full internal paths and leave filenames only or use original extension for textures (they are referenced as "nut", even though they're plain dds).
Update 3: Small fixes for particular texture types added.
Update 4: Script is updated to support ATI1 textures. Also script should now produce proper error for unsupported texture types.
Update 5: Script is updated for proper handling of some NXG_TEXTURES files (now with additional fix).
Last edited by spiritovod on Fri Jun 24, 2022 12:37 am, edited 11 times in total.
Puterboy1
Posts: 382
Joined: Wed Sep 12, 2018 2:22 am

Re: Lego Star Wars Skywalker Saga PC .TEXTURE and TSH files

Post by Puterboy1 »

More samples to study:
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: Lego Star Wars Skywalker Saga PC .TEXTURE and TSH files

Post by spiritovod »

Script is now updated. It should handle existing formats much better.

================================

Script is updated to support extraction from NXG_TEXTURES files.
KL3W
Posts: 41
Joined: Sun Jan 02, 2022 1:19 pm

Re: Lego Star Wars Skywalker Saga PC .TEXTURE and TSH files

Post by KL3W »

spiritovod wrote:Script is now updated. It should handle existing formats much better.

================================

Script is updated to support extraction from NXG_TEXTURES files.


Hey!

So I tested your script, and it works for some textures, but some give weird results. I added a sample of files with what I got from the script. Maybe it can help.

Thank you for the work.
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: Lego Star Wars Skywalker Saga PC .TEXTURE and TSH files

Post by spiritovod »

@KL3W: I've updated the script, it now handle this type of textures as well.
KL3W
Posts: 41
Joined: Sun Jan 02, 2022 1:19 pm

Re: Lego Star Wars Skywalker Saga PC .TEXTURE and TSH files

Post by KL3W »

spiritovod wrote:@KL3W: I've updated the script, it now handle this type of textures as well.


Thanks it works for more files, but still some aren't working it seems. Is there a fix for these files too?
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: Lego Star Wars Skywalker Saga PC .TEXTURE and TSH files

Post by spiritovod »

@KL3W: One more update is rolled out. Also script should now produce proper error for unsupported types.
KL3W
Posts: 41
Joined: Sun Jan 02, 2022 1:19 pm

Re: Lego Star Wars Skywalker Saga PC .TEXTURE and TSH files

Post by KL3W »

spiritovod wrote:@KL3W: One more update is rolled out. Also script should now produce proper error for unsupported types.


Very nice work. I guess the goal would be to have a script working for all .TEXTURE and .TSH files, so I have found some files that don't work with the script for now. Can you do magic again?
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: Lego Star Wars Skywalker Saga PC .TEXTURE and TSH files

Post by spiritovod »

@KL3W: Script is updated with ATI1 textures support. DXT3 and ATI2 are still missing, but I'm not sure the game is using them at all, as well as any kind of uncompressed textures.
KL3W
Posts: 41
Joined: Sun Jan 02, 2022 1:19 pm

Re: Lego Star Wars Skywalker Saga PC .TEXTURE and TSH files

Post by KL3W »

spiritovod wrote:@KL3W: Script is updated with ATI1 textures support. DXT3 and ATI2 are still missing, but I'm not sure the game is using them at all, as well as any kind of uncompressed textures.


Thank you very much. So no support for the .TSH files I sent? I was looking into it with HxD and it looks like there are a lot of .png files in it. Is it really .png files that could be extracted or am I wrong?
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: Lego Star Wars Skywalker Saga PC .TEXTURE and TSH files

Post by spiritovod »

@KL3W: TSH are materials, there is no textures data in them. And textures are addressed in materials by their original names (either png or tga). Each TEXTURE file can be either standalone texture, in this case original name will be addressed in the texture itself, or part of material, in this case the material will be addressed instead of original name and respective material contains original names. I suppose the difference is that texture can be addressed directly by an object (like mesh) or only as part of respective material.
KL3W
Posts: 41
Joined: Sun Jan 02, 2022 1:19 pm

Re: Lego Star Wars Skywalker Saga PC .TEXTURE and TSH files

Post by KL3W »

Alright thx for the explanation! Still, I have found some .TEXTURE files that can't be opened with the script...
Can you do something @spiritovod?
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: Lego Star Wars Skywalker Saga PC .TEXTURE and TSH files

Post by spiritovod »

@KL3W: Script is updated, it should now work with that texture type as well.
KL3W
Posts: 41
Joined: Sun Jan 02, 2022 1:19 pm

Re: Lego Star Wars Skywalker Saga PC .TEXTURE and TSH files

Post by KL3W »

spiritovod wrote:@KL3W: Script is updated, it should now work with that texture type as well.


Thx again! I have found others... Sorry if it feels like a never-ending process for you...
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: Lego Star Wars Skywalker Saga PC .TEXTURE and TSH files

Post by spiritovod »

@KL3W: Those textures are totally fine. I suppose your software doesn't support dds with BC6/7 data properly.
KL3W
Posts: 41
Joined: Sun Jan 02, 2022 1:19 pm

Re: Lego Star Wars Skywalker Saga PC .TEXTURE and TSH files

Post by KL3W »

@spiritovod I have GIMP 2.10.30, isn't it supposed to open dds files?
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: Lego Star Wars Skywalker Saga PC .TEXTURE and TSH files

Post by spiritovod »

@KL3W: Apparently it doesn't support BC7 out of the box. I can only suggest to google for solutions or use other tools, like XnView MP or Paint.NET.
Tythesly
Posts: 5
Joined: Sat Apr 09, 2022 6:10 am

Re: Lego Star Wars Skywalker Saga PC .TEXTURE and TSH files

Post by Tythesly »

Hey Spirit,

Any chance you can get that script to unpack all files in the dat files? Like how the usual TTgames.bms script does for all the other lego games?
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: Lego Star Wars Skywalker Saga PC .TEXTURE and TSH files

Post by spiritovod »

@Tythesly: There is already fixed version of original aluigi's script in this topic.