Seems this script works perfectly only with those samples. When I split other textures from different archives, their names and the solutions of the script are actually contrary. For example, some textures named with _d are dxt5 format instead, while some named with _n are dxt1. Also, there're a lot of other textures that have no _d or _n postfix. So I guess there must be a field inside the header of those files for identifing which format each texture uses. And I've worked it out: if the four bytes at 0x4C equals 0x 00 00 00 00, then it uses dxt1 format, if it's larger than 0 (currently known values include 0x1, 0x2 and 0x5), than it is dxt5 format. Good news is that this method works for 99% textures from Ben 10 Omniverse, Ben 10 Omniverse 2, and Ben 10 Galactic Racing for XBox360, which have the same archive format. Maybe there're more dxt formats represented by the values greater than 0. But those exceptions that method doesn't support are all environment, vfx or scene maps, which are not so important.AceWell wrote: it looks like you got this under control but here is a Noesis python script to open those samples
Here is the improved script changing the extension to .v2t:
Code: Select all
#Supports Ben 10 Omniverse, Ben 10 Omniverse 2 and Ben 10 Galactic Racing for XBox360
from inc_noesis import *
def registerNoesisTypes():
handle = noesis.register("Vicious Engine 2 Ben 10 Series Games Textures", ".v2t")
noesis.setHandlerTypeCheck(handle, noepyCheckType)
noesis.setHandlerLoadRGBA(handle, noepyLoadRGBA)
return 1
def noepyCheckType(data):
bs = NoeBitStream(data)
Magic = bs.readBytes(4)
if Magic != b'\x00\x00\x00\x01':
return 0
return 1
#check if it's this type based on the data
def noepyLoadRGBA(data, texList):
datasize = len(data) - 0x6D
bs = NoeBitStream(data, NOE_BIGENDIAN)
bs.seek(0x3E, NOESEEK_ABS)
imgWidth = bs.readUShort()
imgHeight = bs.readUShort()
bs.seek(0x4C, NOESEEK_ABS)
DxtValue = bs.readUInt()
bs.seek(0x6D, NOESEEK_ABS)
data = bs.readBytes(datasize)
if DxtValue == 0:
data = rapi.imageUntile360DXT(rapi.swapEndianArray(data, 2), imgWidth, imgHeight, 8)
texFmt = noesis.NOESISTEX_DXT1
elif DxtValue > 0:
data = rapi.imageUntile360DXT(rapi.swapEndianArray(data, 2), imgWidth, imgHeight, 16)
texFmt = noesis.NOESISTEX_DXT5
texList.append(NoeTexture(rapi.getInputName(), imgWidth, imgHeight, data, texFmt))
return 1