Here's the problem:
Code: Select all
from inc_noesis import *
import noesis
import rapi
def registerNoesisTypes():
handle = noesis.register("God of War Origins Collection", ".bin")
noesis.setHandlerTypeCheck(handle, noepyCheckType)
noesis.setHandlerLoadModel(handle, noepyLoadModel) #see also noepyLoadModelRPG
#noesis.setHandlerWriteModel(handle, noepyWriteModel)
#noesis.setHandlerWriteAnim(handle, noepyWriteAnim)
#noesis.logPopup()
#print("The log can be useful for catching debug prints from preview loads.\nBut don't leave it on when you release your script, or it will probably annoy people.")
return 1
NOEPY_HEADER = ""
#check if it's this type based on the data
def noepyCheckType(data):
return 1
#load the model
def noepyLoadModel(data, mdlList):
ctx = rapi.rpgCreateContext()
#rapi.rpgSetOption(noesis.TRIWINDBACKWARD, 1)
bs = NoeBitStream(data)
bs.setEndian(NOE_LITTLEENDIAN)
rapi.rpgSetOption(noesis.RPGOPT_BIGENDIAN, 1)
VtxBytes = 68
VtxCount = (2893,)
VtxOffset = (0x667D0,)
for i in range(0, 1):
bs.seek(VtxOffset[i], NOESEEK_ABS)
VtxBuff = bs.readBytes(VtxCount[i] * VtxBytes)
rapi.rpgBindPositionBufferOfs(VtxBuff, noesis.RPGEODATA_FLOAT, VtxBytes, 24)
rapi.rpgBindNormalBufferOfs(VtxBuff, noesis.RPGEODATA_FLOAT, VtxBytes, 12)
UVBuff = rapi.rpgBindUV1BufferOfs(VtxBuff, noesis.RPGEODATA_FLOAT, VtxBytes, 0)
rapi.rpgCommitTriangles(None, noesis.RPGEODATA_USHORT, VtxCount[i], noesis.RPGEO_TRIANGLE_STRIP, 1)
mdl = rapi.rpgConstructModel()
#mdl.setBones(Skeleton)
mdlList.append(mdl)
rapi.rpgClearBufferBinds()
return 1
I do not know how to read several different vertex block
Samples: https://yadi.sk/d/qCKilbT2kFiui
Thanks