Users browsing this thread: 31 Guest(s)
BFRES Ripper
#76
(02-03-2016, 08:00 PM)Irastris Wrote: Is anyone still working on a standalone/Python alternative? I remember Ray Koopa mentioning making a Python version, and then a thread by him about a .NET library with hopes to to make a standalone BFRES to OBJ/DAE converter, but I haven't seen anything else with him on the subject.

Sad

I havent worked on that so far anymore. My time is very limited, and I was a bit annoyed to find out some people know so much more about BFRES already but never documented it or want to give that information for the public so I can implement better support.

RTB, where did you get the additional vertex formats from? Some of them are not in the wiki. I translated them already into Python for Blender, but it would be nice to have them documented in a non-language-biased way, and wonder if you had better docs or if it was own research.
Reply
Thanked by:
#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
#78
There are some problems with any half-float (16-bit) values; they're not read correctly.

A coin should not look like this...
[Image: coinwrong.png]

but rather like this:
[Image: coincorrect.png]

I took NumPy's implementation of reading HalfFloats. It's basically what is described in Wikipedia; I couldn't check your code yet, but there seems to be a bug in it, as it happens with any such attribute formats.
Reply
Thanked by:
#79
The coin is SM3DW is very low poly...
Reply
Thanked by:
#80
This one is from MK8. Somehow the normal map looks inverted. It should be engraved, not extruded.
Reply
Thanked by:
#81
Is this still being worked on?  I've been having issues exporting from 3dsmax with Splatoon models, and I'm trying to make an Octoling's mod for Cafiine happen, but I can't get the models out of 3dsmax properly  (I did, however, get the sfx and Octosquid working.  You can get them on my YouTube channel if you want them. I'm a recognized hacker in the Splatoon Modding Hub)  If not, are there any alternatives that would work for what I'm going for?  Thanks in advance!  Big Grin
Reply
Thanked by:
#82
It looks like RTB is on a break on working on the script. At least I haven't gotten a reply yet to some of the things I asked him or bugs I reported here ='3
Reply
Thanked by:
#83
I dumped the shader code of the big main shader on my server (PM if interested, don't wanna post it directly here).
[Image: turbo_uber.png]

It contains parts about how bake textures are applied. Sooner or later (more much later) I might implement that in the Cycles Renderer of Blender. Maybe RTB can do this for 3ds Max too?
Reply
Thanked by:
#84
It's a GLSL shader ? For implement it in 3ds Max, we have to convert it to HLSL.
Reply
Thanked by:
#85
Is there a plugin like this for Blender? Actually 3dsmax doesn't run on my pc
Reply
Thanked by:
#86
If it' for performance reasons, I don't think your computer can handle millions of triangles and conversions from BFRES files.
Reply
Thanked by:
#87
I've done an update for the BFRES script now, fixing up a number of problems with it (one in particular being incredibly-long load times for maps).
https://mega.nz/#!atZ20IiZ!Ck4PX__CExrZc...7iFGeFFVo0
Code:
Added a UI to choose which BFMDL to import in a BFRES, and various little options.
LOD (Level of Detail) models can now be imported.
Fixed Version 0 BFRES bone structures so they're no longer broken (NSMBU, NintendoLand)
Fixed Version 3 BFRES bone structures so they actually load now (Wii Sports Resort)
Fixed MatrFlag-related importing so now it won't take AGES to load maps!
Fixed texture importing for certain Paper Mario: Color Splash models.
Fixed vertex colours which use full floats instead of half floats (LoZWWHD), thanks DSX8!
Added UV mapping support for type 516 (bytes), might be incorrect.
Not a fix, but UV mapping type 2056 is currently incorrect and will need to be looked into later.
Likewise, normals will be looked into for the next update.
Reply
Thanked by: Yunpol, iyenal
#88
Everything works great....Thanks

But after days of searching and trying many different "things" I cannot seem to figure out how to EXPORT back to a BFRES...

I can import just fine (3ds max), make any edits and modifications but how can I save my finished "product" back to a BFRES (in 3ds max) so I can repack to a szs (already got that part down)....?

Thanks for any assistance....
Reply
Thanked by:
#89
You can't. This is just a script to import a model.
Reply
Thanked by:
#90
(12-29-2016, 04:21 AM)Ray Koopa Wrote: You can't. This is just a script to import a model.

Correct.....But there is a way to export to BFRES or export to another "type" and convert to BFRES. I was just hoping someone could point me in the right direction....

Look here >>>https://gbatemp.net/threads/alpha-bfres-vertex-tool-aka-most-nintendo-models.443529/

But I can't seem to figure out the export in 3ds......*sigh
Thanks for your reply tho.

(10-10-2016, 02:23 AM)Makoto Wrote: Is there a plugin like this for Blender? Actually 3dsmax doesn't run on my pc

I'm a lot late...but, yes there is....
https://gbatemp.net/threads/alpha-bfres-...ls.443529/
Reply
Thanked by:


Forum Jump: