a friend is working in a noesis script for god of war 3 , he found vertex and uv coords but he can't obtain faces.

also, he have other problems, the script only show the point cloud in r_harpy20.wad, all other models can be loaded perfectly but shows nothing.
this is the script
Code: Select all
from inc_noesis import *
import noesis
import rapi
def registerNoesisTypes():
handle = noesis.register("God of War 3 model", ".wad")
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.RPGOPT_TRIWINDBACKWARD, 1)
bs = NoeBitStream(data)
bs.setEndian(NOE_BIGENDIAN)
rapi.rpgSetOption(noesis.RPGOPT_BIGENDIAN, 1)
VtxCount = (252, 436, 232, 168, 1847, 1780, 2892, 600, 380)
VtxBytes = 24
VtxOffset = (0x16A470, 0x16C6F0, 0x170890, 0x172F60, 0x1783D0, 0x18AFF0, 0x19FE30, 0x1B8FF0, 0x1BEE10)
for i in range(0, 9):
bs.seek(VtxOffset[i], NOESEEK_ABS)
VtxBuff = bs.readBytes(VtxCount[i] * VtxBytes)
rapi.rpgBindPositionBufferOfs(VtxBuff, noesis.RPGEODATA_FLOAT, VtxBytes, 0)
rapi.rpgBindNormalBufferOfs(VtxBuff, noesis.RPGEODATA_FLOAT, VtxBytes, 12)
UVBuff = bs.readBytes(VtxCount[i] * 8)
rapi.rpgBindUV1BufferOfs(UVBuff, noesis.RPGEODATA_FLOAT, 8, 0)
rapi.rpgCommitTriangles(None, noesis.RPGEODATA_USHORT, VtxCount[i], noesis.RPGEO_POINTS, 1)
mdl = rapi.rpgConstructModel()
#mdl.setBones(Skeleton)
mdlList.append(mdl)
rapi.rpgClearBufferBinds()
return 1
probally the files use triangle strip, my friend need to add a algorythm or something in his noesis script for decode this data
here are some files, including R_harpy20.wad , the only model that works.
http://www.mediafire.com/download/8ncr8 ... PS3_BE.rar
anyone can take a look please ?
thanks!
(note: my friend can't create a account here)


