Help us keep the site up! Got some change to spare? Why not donate a few bits and buy us a coffee. Image

Capcom Mod mesh question (RE5)

Post questions about game models here, or help out others!
Post Reply
User avatar
Bastien
advanced
Posts: 70
Joined: Sun Apr 15, 2012 1:08 am
Has thanked: 27 times
Been thanked: 13 times

Capcom Mod mesh question (RE5)

Post by Bastien »

Hi, I'm working on an importer for RE5 models. Everything looks good except some meshes, like mesh 01 in the example below.
I don't know why my approach differs from other importers (noesis, mod2obj), I can't find the pattern. It's probably related to different "stream" of vertices? Read something in many investigation threads from 2009, but couldn't get it to work.
The only available code I could look is this one by Mariokart, but he seem to be doing the same as me, printed a couple values to verify it, but in 3ds max the import looks correct

If Mr Adults/Surveyor/Revelations or anyone else read this and have some old code around to take a look, I'll appreciate it, I've been trying to figure this out for days :oops:

example pl0000.mod (resident evil 5\nativePC\Image\Archive\uPl00ChrisNormal.arc ---> pawn\pl\pl00\model\pl0000.mod )
Mesh 0: OK
mesh.Vertex_Offset = 0
mesh.Vertex_Position = 0
mesh.Vertex_Stride = 32
mesh.Vertex_Count = 272
mesh.Vertex_Buffer = 154300 to 163004

Mesh 01: Not OK Chris' Right Hand, LOD 1

OBJ generated by Noesis.
Image
My importer generates the hand vertices ok, but also 635 extra vertices at 0,0,0, and face indices point to to those, hence getting no faces in the real vertices

mesh.Vertex_Offset = 0
mesh.Vertex_Position = 272
mesh.Vertex_Stride = 32
mesh.Vertex_Count = 1270 ---> why other importers take this as 635? E.g, collada export from Noesis
mesh.Vertex_Buffer = 163004 to 203644 ---> Seems like first half of these vertex have null UVs, and vertices are all at around 0,0,0, if I use 183324 to 203644 I get right UVs and indices point to the right vertices

Every other mesh in LOD 1 looks ok, except for 3 which is the left hand, and has the same vertcount and issue.

btw, this is what I do to get each mesh vert "buffer"
Model.vertex_buffer_Offset = 154300 (informed in position 60 of the model, as uint32)
mesh.Rel_Vert_Buffer_Offset = mesh.Vertex_Offset + mesh.Vertex_Position * mesh.Vertex_Stride
mesh.Abs_Vert_Buffer_Offset = Model.Vertex_Buffer_Offset + mesh.Rel_Vert_Buffer_Offset
mesh.Vert_Buffer_Size = mesh.Vertex_Count * mesh.Vertex_Stride
Post Reply