NocturnalRhys Posted April 6 Posted April 6 hi guys, someone knows how to extract textures from a3t format? in playstation 2 is called amt, but in playstation 3 is a3t, try to extract their textures with a .py script that made a user called nexus the modder credits to him for his program, but only extracts the textures of the characters only that, with another type of a3t file that is not character does not extract it, here the .py and sample files A3T Tools.rar
NocturnalRhys Posted April 6 Author Posted April 6 5 hours ago, ikskoks said: Some of them are DXT3: yes I was just checking recently, in the #a3t script it only supports dtx3 and that is used in the file characters, the other #a3t files apparently use another type of dtx, dtx3 is not used in some #amt files. 5 hours ago, ikskoks said: Some of them are DXT3: I wonder if the script can be improved, I tried but I couldn't do it.
Engineers h3x3r Posted April 7 Engineers Posted April 7 (edited) from inc_noesis import * import noesis import rapi import os def registerNoesisTypes(): handle = noesis.register("Dragon Ball Budokai 3 HD Collection(PS3) Textures", ".a3t") noesis.setHandlerTypeCheck(handle, noepyCheckType) noesis.setHandlerLoadRGBA(handle, noepyLoadRGBA) noesis.logPopup() return 1 def noepyCheckType(data): bs = NoeBitStream(data) if len(data) < 20: return 0 return 1 def noepyLoadRGBA(data, texList): bs = NoeBitStream(data,NOE_BIGENDIAN) BaseName = rapi.getExtensionlessName(rapi.getLocalFileName(rapi.getInputName())) Underline = "_" bs.readBytes(16) ImageCount = bs.readUInt() ImageTableOffset = bs.readUInt() bs.seek(ImageTableOffset, NOESEEK_ABS) for i in range(ImageCount): ImageInfoOffset = bs.readUInt() cPos = bs.tell() if ImageInfoOffset != 0: bs.seek(ImageInfoOffset, NOESEEK_ABS) ImageIndex = bs.readUInt() ImgIndex = str(ImageIndex) bs.read(16) ImageOffset = bs.readUInt() bs.seek(ImageOffset, NOESEEK_ABS) bs.read(4) ImageDataSize = bs.readUInt() bs.read(16) PixelFormat = bs.readUByte() print(PixelFormat) bs.read(7) ImageWidth = bs.readUShort() ImageHeight = bs.readUShort() bs.read(92) data = bs.readBytes(ImageDataSize) if PixelFormat == 135: texFmt = noesis.NOESISTEX_DXT3 elif PixelFormat == 133: data = rapi.imageFromMortonOrder(data, ImageWidth, ImageHeight, 4) #data = rapi.imageDecodeRaw(data, ImageWidth, ImageHeight, "r8g8b8a8") texFmt = noesis.NOESISTEX_RGBA32 texList.append(NoeTexture(BaseName + Underline + ImgIndex, ImageWidth, ImageHeight, data, texFmt)) bs.seek(cPos, NOESEEK_ABS) return 1 Edited April 8 by h3x3r
NocturnalRhys Posted April 7 Author Posted April 7 58 minutes ago, h3x3r said: from inc_noesis import * import noesis import rapi import os def registerNoesisTypes(): handle = noesis.register("Dragon Ball Budokai 3 HD Collection(PS3) Textures", ".a3t") noesis.setHandlerTypeCheck(handle, noepyCheckType) noesis.setHandlerLoadRGBA(handle, noepyLoadRGBA) noesis.logPopup() return 1 def noepyCheckType(data): bs = NoeBitStream(data) if len(data) < 20: return 0 return 1 def noepyLoadRGBA(data, texList): bs = NoeBitStream(data,NOE_BIGENDIAN) BaseName = rapi.getExtensionlessName(rapi.getLocalFileName(rapi.getInputName())) Underline = "_" bs.readBytes(16) ImageCount = bs.readUInt() ImageTableOffset = bs.readUInt() bs.seek(ImageTableOffset, NOESEEK_ABS) for i in range(ImageCount): ImageInfoOffset = bs.readUInt() cPos = bs.tell() bs.seek(ImageInfoOffset, NOESEEK_ABS) ImageIndex = bs.readUInt() ImgIndex = str(ImageIndex) bs.read(3) PixelFormat = bs.readUByte() ImageWidth = bs.readUShort() ImageHeight = bs.readUShort() bs.read(8) ImageOffset = bs.readUInt() bs.seek(ImageOffset, NOESEEK_ABS) bs.read(128) ImageDataSize = ImageWidth * ImageHeight data = bs.readBytes(ImageDataSize) texFmt = noesis.NOESISTEX_DXT3 texList.append(NoeTexture(BaseName + Underline + ImgIndex, ImageWidth, ImageHeight, data, texFmt)) bs.seek(cPos, NOESEEK_ABS) return 1 it's a very good script! but I still don't understand why you can't open other types of a3t, for example noesis won't let me view this a3t The good thing, is that I took the time to research the a3t file, I'll explain what's here: RED: Nº Textures in the file Yellow: Texture index offset Black: texture 1(includes bpp, dimensions etc in this area) Green: DDS Header this file contains only one texture mCSgny1.rar
Engineers h3x3r Posted April 7 Engineers Posted April 7 (edited) There is morton involved. Also width/height from table doesn't always match width/height from dds header. So script must be rewriten. It's hard to make a struct just from one sample. Post more samples. Edited April 7 by h3x3r
NocturnalRhys Posted April 7 Author Posted April 7 (edited) here you have more samples, I think each a3t has its own tempering .dds(header) is what I'm seeing in each a3t A3T Files Samples.rar Edited April 7 by NocturnalRhys
NocturnalRhys Posted April 9 Author Posted April 9 thanks mate! so far I have tried 5 files and it works too well, I'll keep you posted, maybe based on this script, I can make a reimporter and an improved extractor
NocturnalRhys Posted April 9 Author Posted April 9 On 4/8/2025 at 2:49 AM, h3x3r said: Updated script. Now it should work. i have tried to make a .py script to extract the textures without depending on noesis but i couldn't when you have some free time or you want to do it could you make a script?
Engineers h3x3r Posted April 10 Engineers Posted April 10 Sorry to tell you that but i am not good enough in that. You are on your own. Maybe someone else can help. Anyway you must deal with morton algo. 1
Moderators ikskoks Posted April 10 Moderators Posted April 10 22 hours ago, NocturnalRhys said: have tried to make a .py script to extract the textures without depending on noesis but i couldn't You can do that easily with ReverseBox dependency https://github.com/bartlomiejduda/ReverseBox Morton swizzle is supported.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now