Users browsing this thread: 3 Guest(s)
BFRES Ripper
#77
There's a tiny (unimportant) bug that it imports all vertices, even those of lower quality LoD models, and then (correctly) connects only the vertices of the highest (first) LoD Model.
That results in quite a bunch of unused unconnected vertices floating around.

There does not seem to be a direct way to get the number of vertices required for one LoD model, as the game probably doesn't care about it (always holds the whole vertex buffer in memory). It would be nice for a good import though (I always manually removed those loose vertices). In my Python add-on, I just took the highest index in the LoD models index buffer:
Code:
# Get the vertices and indices of the most detailled LoD model.
lod_model = fshp.lod_models[0]
vertices = fmdl.fvtx_array[fshp.header.buffer_index].get_vertices()
indices = lod_model.get_indices_for_visibility_group(0)
[...]
# Go through the vertices (starting at the given offset) and add them to the bmesh.
# This would also add the vertices of all other LoD models. As there is no direct way to get the number of
# vertices required for the current LoD model (the game does not need that), get the last indexed one with max.
last_vertex = max(indices)
for vertex in vertices[lod_model.skip_vertices:lod_model.skip_vertices + last_vertex + 1]:
   mesh.verts.new(vertex.p0)
# Connect the faces, they are organized as a triangle list.
for i in range(0, len(indices), 3):
   bm.faces.new(bm.verts[j] for j in indices[i:i + 3])
[...]

Here's an example with the unrequired vertices highlighted:
[Image: loosegeom.png]
Reply
Thanked by: iyenal


Messages In This Thread
BFRES Ripper - by ItsEasyActually - 02-18-2015, 07:40 PM
RE: BFRES Ripper - by Random Talking Bush - 02-18-2015, 08:04 PM
RE: BFRES Ripper - by Mystie - 02-18-2015, 08:58 PM
RE: BFRES Ripper - by Random Talking Bush - 02-18-2015, 09:19 PM
RE: BFRES Ripper - by Mystie - 02-18-2015, 09:32 PM
RE: BFRES Ripper - by Random Talking Bush - 02-19-2015, 12:50 AM
RE: BFRES Ripper - by Mystie - 02-19-2015, 01:12 AM
RE: BFRES Ripper - by Kold-Virus - 02-19-2015, 01:15 AM
RE: BFRES Ripper - by RatchetMario - 02-19-2015, 08:05 AM
RE: BFRES Ripper - by Farlavor - 02-20-2015, 07:41 AM
RE: BFRES Ripper - by RatchetMario - 02-20-2015, 11:32 AM
RE: BFRES Ripper - by Hiccup - 02-20-2015, 03:00 PM
RE: BFRES Ripper - by Carpaccio - 02-20-2015, 03:26 PM
RE: BFRES Ripper - by ItsEasyActually - 02-21-2015, 03:19 PM
RE: BFRES Ripper - by Carpaccio - 02-21-2015, 10:57 PM
RE: BFRES Ripper - by Demonslayerx8 - 02-25-2015, 07:01 AM
RE: BFRES Ripper - by Random Talking Bush - 02-25-2015, 10:29 AM
RE: BFRES Ripper - by TGE - 02-25-2015, 11:48 AM
RE: BFRES Ripper - by mustafa - 02-28-2015, 09:00 AM
RE: BFRES Ripper - by TGE - 02-28-2015, 09:38 AM
RE: BFRES Ripper - by Random Talking Bush - 03-01-2015, 12:19 AM
RE: BFRES Ripper - by TGE - 03-01-2015, 07:27 AM
RE: BFRES Ripper - by Chief - 03-14-2015, 03:10 AM
RE: BFRES Ripper - by Random Talking Bush - 03-14-2015, 03:11 AM
RE: BFRES Ripper - by Chief - 03-14-2015, 02:30 PM
RE: BFRES Ripper - by Kold-Virus - 04-14-2015, 08:48 PM
RE: BFRES Ripper - by Glasos - 04-17-2015, 11:12 AM
RE: BFRES Ripper - by Random Talking Bush - 04-17-2015, 04:19 PM
RE: BFRES Ripper - by Glasos - 04-17-2015, 04:51 PM
RE: BFRES Ripper - by SWS90 - 05-27-2015, 12:38 AM
RE: BFRES Ripper - by iyenal - 06-22-2015, 10:43 AM
RE: BFRES Ripper - by Random Talking Bush - 06-22-2015, 04:20 PM
RE: BFRES Ripper - by Random Talking Bush - 06-22-2015, 11:21 PM
RE: BFRES Ripper - by Struggleton! - 06-22-2015, 11:47 PM
RE: BFRES Ripper - by Random Talking Bush - 06-23-2015, 12:57 AM
RE: BFRES Ripper - by Demonslayerx8 - 06-23-2015, 04:27 AM
RE: BFRES Ripper - by Random Talking Bush - 06-23-2015, 02:20 PM
RE: BFRES Ripper - by Demonslayerx8 - 06-23-2015, 05:14 PM
RE: BFRES Ripper - by iyenal - 06-23-2015, 08:19 AM
RE: BFRES Ripper - by Hiccup - 06-23-2015, 01:03 PM
RE: BFRES Ripper - by OS-PRIME - 06-23-2015, 01:19 PM
RE: BFRES Ripper - by Random Talking Bush - 06-23-2015, 05:19 PM
RE: BFRES Ripper - by Demonslayerx8 - 06-23-2015, 05:27 PM
RE: BFRES Ripper - by TGE - 06-23-2015, 09:26 PM
RE: BFRES Ripper - by Cynderusz - 07-11-2015, 09:19 PM
RE: BFRES Ripper - by ItsHelias94 - 07-19-2015, 03:24 PM
RE: BFRES Ripper - by NWPlayer123 - 07-23-2015, 04:27 AM
RE: BFRES Ripper - by ItsHelias94 - 07-24-2015, 08:23 AM
RE: BFRES Ripper - by Dial - 09-23-2015, 07:24 AM
RE: BFRES Ripper - by Irastris - 09-22-2015, 06:04 PM
RE: BFRES Ripper - by Ray Koopa - 09-22-2015, 06:11 PM
RE: BFRES Ripper - by Struggleton! - 09-23-2015, 02:16 PM
RE: BFRES Ripper - by Random Talking Bush - 09-23-2015, 03:00 PM
RE: BFRES Ripper - by Ray Koopa - 10-18-2015, 02:47 PM
RE: BFRES Ripper - by TGE - 10-18-2015, 03:06 PM
RE: BFRES Ripper - by Ray Koopa - 10-18-2015, 03:13 PM
RE: BFRES Ripper - by iyenal - 10-29-2015, 06:38 AM
RE: BFRES Ripper - by Irastris - 10-29-2015, 01:42 PM
RE: BFRES Ripper - by Yarcaz - 11-18-2015, 09:19 AM
RE: BFRES Ripper - by Random Talking Bush - 11-22-2015, 07:21 PM
RE: BFRES Ripper - by Demonslayerx8 - 11-22-2015, 07:28 PM
RE: BFRES Ripper - by Random Talking Bush - 11-22-2015, 07:46 PM
RE: BFRES Ripper - by Demonslayerx8 - 11-22-2015, 10:05 PM
RE: BFRES Ripper - by Random Talking Bush - 11-23-2015, 01:55 AM
RE: BFRES Ripper - by Demonslayerx8 - 11-23-2015, 02:05 AM
RE: BFRES Ripper - by Random Talking Bush - 11-23-2015, 02:11 AM
RE: BFRES Ripper - by Demonslayerx8 - 11-23-2015, 02:22 AM
RE: BFRES Ripper - by iyenal - 11-24-2015, 05:59 AM
RE: BFRES Ripper - by Demonslayerx8 - 11-24-2015, 07:44 AM
RE: BFRES Ripper - by turqouise - 01-01-2016, 07:17 PM
RE: BFRES Ripper - by iyenal - 01-30-2016, 09:49 AM
RE: BFRES Ripper - by Irastris - 02-03-2016, 08:00 PM
RE: BFRES Ripper - by iyenal - 02-04-2016, 02:55 AM
RE: BFRES Ripper - by Irastris - 02-04-2016, 03:57 AM
RE: BFRES Ripper - by Ray Koopa - 05-16-2016, 10:15 AM
RE: BFRES Ripper - by Ray Koopa - 05-29-2016, 11:06 AM
RE: BFRES Ripper - by Ray Koopa - 05-31-2016, 12:35 PM
RE: BFRES Ripper - by iyenal - 05-31-2016, 01:02 PM
RE: BFRES Ripper - by Ray Koopa - 05-31-2016, 02:09 PM
RE: BFRES Ripper - by BKOOL999 - 06-04-2016, 12:59 PM
RE: BFRES Ripper - by Ray Koopa - 06-14-2016, 11:40 AM
RE: BFRES Ripper - by Ray Koopa - 06-30-2016, 04:26 PM
RE: BFRES Ripper - by iyenal - 07-01-2016, 03:58 AM
RE: BFRES Ripper - by Makoto - 10-10-2016, 02:23 AM
RE: BFRES Ripper - by iyenal - 10-15-2016, 02:20 AM
RE: BFRES Ripper - by Random Talking Bush - 10-15-2016, 03:50 PM
RE: BFRES Ripper - by JingleBells - 12-29-2016, 03:50 AM
RE: BFRES Ripper - by Ray Koopa - 12-29-2016, 04:21 AM
RE: BFRES Ripper - by JingleBells - 12-29-2016, 06:40 AM
RE: BFRES Ripper - by iyenal - 12-29-2016, 07:35 AM
RE: BFRES Ripper - by JingleBells - 12-29-2016, 01:08 PM
RE: BFRES Ripper - by iyenal - 12-29-2016, 01:13 PM
RE: BFRES Ripper - by JingleBells - 12-29-2016, 02:35 PM
RE: BFRES Ripper - by iyenal - 12-30-2016, 09:03 AM
RE: BFRES Ripper - by dlfon99 - 08-28-2017, 12:13 AM
RE: BFRES Ripper - by Random Talking Bush - 08-28-2017, 12:58 AM
RE: BFRES Ripper - by JetTheFox96 - 04-25-2021, 07:18 PM

Forum Jump: