RESOLVED
I'm not too interested in particles.
String-parsing seems rather tricky.
I've noticed something strange when taking a single model with multiple meshes and trying to load them as separate meshes so that you can cycle through them.
I parse the file and store the vertex and index buffers in a list.
Then after parsing is done, for each set of vert and index buffers, I clear buffer binds to clean anything the previous iteration, bind the vertex buffers and commit the triangles, then constructModel, apply materials, and append it to the mdlList.
Code: Select all
def noepyLoadModel(data, mdlList):
'''Build the model, set materials, bones, and animations. You do not
need all of them as long as they are empty lists (they are by default)'''
ctx = rapi.rpgCreateContext()
parser = SanaeParser(data)
parser.parse_file()
for i in range(len(parser.vertBuffs)):
vertBuff, numVerts = parser.vertBuffs[i]
idxBuff, numIdx, matNum = parser.idxBuffs[i]
matName = parser.matList[matNum].name
rapi.rpgClearBufferBinds()
rapi.rpgBindPositionBufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, 32, 0)
rapi.rpgBindNormalBufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, 32, 12)
rapi.rpgBindUV1BufferOfs(vertBuff, noesis.RPGEODATA_FLOAT, 32, 24)
rapi.rpgSetMaterial(matName)
rapi.rpgCommitTriangles(idxBuff, noesis.RPGEODATA_USHORT, numIdx, noesis.RPGEO_TRIANGLE, 1)
mdl = rapi.rpgConstructModel()
mdl.setModelMaterials(NoeModelMaterials(parser.texList, parser.matList))
#mdl.setBones(parser.boneList)
#mdl.setAnims(parser.animList)
mdlList.append(mdl)
return 1
When I look at the data viewer, I see the first model has the mesh 0 as expected.
The second model has the mesh 0 and mesh 1
The third model has mesh 0, mesh 1, and mesh 2.
The code looks like it should be loading one mesh per model.
What am I doing wrong?
Also, I'd like default UI shortcuts. I think it's more user-friendly, especially when I move around to different machines and stuff. Then I don't have to set up what I usually have, which are just window defaults for things like closing the current instance, opening a file, etc.