adragonballs wrote: ↑Sun Mar 29, 2020 2:20 amthis guy is missing in l_romd_d.ps3
There's about 2035 *.obj files created from
l_romd_d.ps3. Did you import/check them all?
reh wrote: ↑Sun Mar 29, 2020 6:26 am
If that helps, it seems that to find the other models, just search for "00 02 01 1B". In this block, you can also see the vertex count and the face count.
Here's a Noesis script for the first submesh. You may expand it with a loop to get all submeshes:
.
Code: Select all
from inc_noesis import *
import noesis
import rapi
def registerNoesisTypes():
handle = noesis.register("GetBen10-UA-CDM",".xbx")
noesis.setHandlerTypeCheck(handle, noepyCheckType)
noesis.setHandlerLoadModel(handle, noepyLoadModel)
return 1
NOEPY_HEADER = "vap"
def noepyCheckType(data):
bs = NoeBitStream(data)
if len(data) < 3:
return 0
if bs.readBytes(3).decode("ASCII") != NOEPY_HEADER:
print("'vaps' not found!")
return 0
return 1
def noepyLoadModel(data, mdlList):
ctx = rapi.rpgCreateContext()
bs = NoeBitStream(data)
bs.setEndian(NOE_BIGENDIAN)
rapi.rpgSetOption(noesis.RPGOPT_BIGENDIAN, 1)
addr=bs.tell()
fileBuff = bs.data[addr:bs.dataSize]
addr1= fileBuff.find(b'\x00\x02\x01\x1B')
addr += addr1
bs.seek(addr)
bs.seek(4, NOESEEK_REL)# skip signature
# counts
vCnt = bs.readUInt()
du = bs.readUInt()#dummy
fCnt = bs.readUInt()
bs.seek(22*16+4, NOESEEK_REL)# this offset maybe different for other model files
print("vCnt, fCnt", vCnt,fCnt)
FVFsize = int(44)
offset= bs.tell()
VBSize = vCnt * FVFsize
print("verts at:", hex(offset), VBSize)
VBuff = bs.readBytes(VBSize)
rapi.rpgBindPositionBufferOfs(VBuff, noesis.RPGEODATA_FLOAT, FVFsize, 0)
rapi.rpgBindUV1BufferOfs(VBuff, noesis.RPGEODATA_FLOAT, FVFsize, 36)
bs.seek(16, NOESEEK_REL)
offset= bs.tell()
print("FIs at:", hex(offset))
FBuff = bs.readBytes(fCnt*2)
rapi.rpgCommitTriangles(FBuff, noesis.RPGEODATA_USHORT, fCnt, noesis.RPGEO_TRIANGLE, 1)
mdl = rapi.rpgConstructModel()
mdlList.append(mdl)
rapi.rpgClearBufferBinds()
return 1
btw: most important line for the bigendian thingie: rapi.rpgSetOption(noesis.RPGOPT_BIGENDIAN, 1)
Obviously using bs.
setEndian(NOE_BIGENDIAN) is
not sufficient -
rapi.rpgCommit
Triangles() must be "told" how to interpret the FBuff data by adding this line:
rapi.rpgSetOption(noesis.RPGOPT_BIGENDIAN, 1)
(This seems a little bit confusing to me since the script even works in case you place
rapi.rpgSetOption(noesis.RPGOPT_BIGENDIAN, 1) AFTER
rapi.rpgBindPosition
BufferOfs(VBuff, noesis.RPGEODATA_FLOAT, FVFsize, 0).
So rapi.rpgBindPositionBufferOfs() "relies" on bs.
setEndian(NOE_BIGENDIAN)!?)
.
l_bell_d-xbx.png
You do not have the required permissions to view the files attached to this post.