Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Extracting simple models

Read or post any tutorial related to file format analysis for modding purposes.
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4286
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1147 times
Been thanked: 2242 times

Re: Extracting simple models

Post by shakotay2 »

guess, you mean "block mode" (such as vx,vy,vz, nx,ny,nz, tx,ty) because in hex2obj's "mixed mode" UVpos is 99 per definition
and the uvs are in a separate block

but 'yes', it's a known problem with hex2obj and there's an ugly workaround using the "mixed" instead of "block" mode:
set UVpos to 99, set start UVblock (UVB) to start of vertices - 4 and 'size of UVB' to FVFsize.
In step 3 choose HF_UV.

--------------------------
btw: using a negative UVpos in "block mode" wouldn't solve the problem, because the next vertex address to handle
after having read 3 vertex floats
is calculated by addr += UVpos -12
and after having read the uvs -> addr += bytesToSkip
where bytesToSkip= VBsize-12 ; bytesToSkip -= (UVpos-12 + 4) // 4: size of 2 half floats

Guess, an additional variable vertex position will be required for a proper solution and there are
6 functions to be handled (since it makes no sense to have that feature for float/HFloat only):

VertexBlock(), VertexBlock_UV_HF(), VertexBlock_allHF()
VertexBlock_UVs_Word(), VertexBlock_all_Word(), VertexBlock_VShort_UVs_Word()

This would end up in a more or less complete rewrite of code.
Last edited by shakotay2 on Sun May 01, 2016 9:09 pm, edited 1 time in total.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
daemon1
MEGAVETERAN
MEGAVETERAN
Posts: 2647
Joined: Tue Mar 24, 2015 8:12 pm
Has thanked: 65 times
Been thanked: 2870 times

Re: Extracting simple models

Post by daemon1 »

shakotay2 wrote:there's an ugly workaround using the "mixed" instead of "block" mode
Thanks for the reply. How could I not think about it? :)

This workaround is not that ugly actually.
User avatar
OriginOfWaves
beginner
Posts: 38
Joined: Wed Jun 08, 2011 1:58 pm
Location: Nish, Serbia
Has thanked: 25 times
Been thanked: 11 times
Contact:

Re: Extracting simple models

Post by OriginOfWaves »

thanks a bunch man, you are a gem. could you explain how you got the FVF size? i would like to know for future reference. i think you're right and that there is just one submesh and those extra Fls are for other LODs. Anyways i found the UVs at pos 52 and HF_UV, they do however need to be flipped and readjusted.

Image Image

so these are the numbers for anyone else trying to extract meshes form Mirror's Edge Catalyst Beta
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4286
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1147 times
Been thanked: 2242 times

Re: Extracting simple models

Post by shakotay2 »

OriginOfWaves wrote:could you explain how you got the FVF size?
it's a matter of patterns in most cases - here 3C 02 03 01
for example, which is repeated after 56 bytes
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
daemon1
MEGAVETERAN
MEGAVETERAN
Posts: 2647
Joined: Tue Mar 24, 2015 8:12 pm
Has thanked: 65 times
Been thanked: 2870 times

Re: Extracting simple models

Post by daemon1 »

OriginOfWaves wrote:could you explain how you got the FVF size?
After you get faceindices, you have number of vertices. Just divide the full size of vertex/UV block by that, and you get FVF size.
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4286
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1147 times
Been thanked: 2242 times

Re: Extracting simple models

Post by shakotay2 »

daemon1 wrote:Just divide the full size of vertex/UV block by that, and you get FVF size.
yep, but in this special case that won't help. Look at 0x2C610 (3246x56) in magrope_skin.chunk and you'll see that you're "at the edge of nowhere".

How should anyone know that this is the "full size"?
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
daemon1
MEGAVETERAN
MEGAVETERAN
Posts: 2647
Joined: Tue Mar 24, 2015 8:12 pm
Has thanked: 65 times
Been thanked: 2870 times

Re: Extracting simple models

Post by daemon1 »

shakotay2 wrote:yep, but in this special case that won't help.
Sorry, I didn't look into the file. Really strange. Two vertex blocks one after another. And the second one is not LOD1 model, it has 2666 vertices and 14560 faces, FVFsize 28. Model looks exactly the same, but I can't see any UV's there.
User avatar
OriginOfWaves
beginner
Posts: 38
Joined: Wed Jun 08, 2011 1:58 pm
Location: Nish, Serbia
Has thanked: 25 times
Been thanked: 11 times
Contact:

Re: Extracting simple models

Post by OriginOfWaves »

shakotay2 wrote:
daemon1 wrote:Just divide the full size of vertex/UV block by that, and you get FVF size.
yep, but in this special case that won't help. Look at 0x2C610 (3246x56) in magrope_skin.chunk and you'll see that you're "at the edge of nowhere".

How should anyone know that this is the "full size"?
well aren't i lucky to run into files that are special and bend the rules [roll]

anyways, i seem to have come upon a weird issue while digging through a certain file. and while i can find the face indices and vertices and display the mesh easily and quickly for both LOD0 and LOD1 versions of the model, i can only seem to find the UVs for the second (LOD1) lower resolution mesh. no mater what settings i try for the first (LOD0) mesh i can't find the UVs in the block. i even tried the mixed mode by setting the UV pos to 99 changing the UV size and pointing to the start of where i thought the UVs are, but still no luck. i think i read through this file in the HEX Editor so many times that everything blurs back together now :?

So if anyone smarter and more focused than me has the time to look at the file i uploaded and let me know what i'm missing, i'd greatly appreciate it. just when i thought i figured these models out, they throw a curve at me :(

anyways here is the file (.mesh and .h2o) http://www.mediafire.com/download/cl3ru ... ample1.zip
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4286
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1147 times
Been thanked: 2242 times

Re: Extracting simple models

Post by shakotay2 »

OriginOfWaves wrote:
shakotay2 wrote:, i can only seem to find the UVs for the second (LOD1) lower resolution mesh.
but it's not in the H2O in your zip, is it?

Anyway, creating some kind of address map for that .mesh would help, I guess.
Here's what I found so far:
faith_1.jpg
(maybe it's the uvs you found already, dunno)
OriginOfWaves wrote:well aren't i lucky to run into files that are special and bend the rules [roll]
if you mean the "rules" from the hex2obj tutorial: they were defined for simple model formats, for special ones you'll need experience, as you may know (now :D )
You do not have the required permissions to view the files attached to this post.
Last edited by shakotay2 on Wed May 04, 2016 7:03 pm, edited 1 time in total.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
User avatar
OriginOfWaves
beginner
Posts: 38
Joined: Wed Jun 08, 2011 1:58 pm
Location: Nish, Serbia
Has thanked: 25 times
Been thanked: 11 times
Contact:

Re: Extracting simple models

Post by OriginOfWaves »

but it's not in the H2O in your zip, is it?

Anyway, creating some kind of address map for that .mesh would help, I guess.
Here's what I found so far:
faith_1.jpg
(maybe it's the uvs you found already, dunno)
thanks for the help again man.

those are the uvs for the high resolution mesh that you have found, that's what i was missing. looks like i was wrong about the start of the vertices, like by a lot. i really thought that they would be at the beginning of the file because that is the first mesh. if i was wrong about the start of the vertices how was i able to display the mesh correctly? how did you find the start of the vertices anyways? did you use the equation from your tutorial?
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4286
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1147 times
Been thanked: 2242 times

Re: Extracting simple models

Post by shakotay2 »

I scanned the file in steps of 4897*24 bytes, at no avail.
Then I went backwards from 0x1D5B40, but from the data I saw that the FVFsize was different.

I can't give general rules for such, it's creativity or something like that based on simple rules.

For files with a size of 2 MB it could help to write down some kind of address mapping, steps of 4897*24 bytes, here, for example.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4286
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1147 times
Been thanked: 2242 times

Re: Extracting simple models

Post by shakotay2 »

well, 2000 downloads of hex2obj so far (and maybe 5 regular users? :D )

Time for a new feature: autogenerated face indices. You might try it out with the
policeman model from this thread: http://forum.xentax.com/viewtopic.php?f ... es#p114317
-------------------------------------------------------------------------------------------------------------
btw: Secure Age APEX says the zipped exe here has a virus - I have no idea, why.
So if you don't trust it don't use it - as simple as this.
-------------------------------------------------------------------------------------------------------------
Hex2obj_024d.zip
(exe only - dlls see zip file in link below)
Latest version to be found here:
shakotay2 wrote: Tue Oct 22, 2013 3:06 pm
Since autocreated face indices don't fit very well in most cases you're free to create your own
FIs.txt file which should look like this:

#comment line, required!
f 1/1 2/2 3/3
f 4/4 5/5 6/6
f 3/3 5/5 7/7
f . . .
Should reside in the model file's folder with Fake selected.

If you need the test.obj only for testing (without uvs) you can reduce FIs.txt like this:

#comment line, required!
f 1 2 3
f 4 5 6
f 3 5 7
f . . .

Attention: maximum face index may not exceed vertex count!
You do not have the required permissions to view the files attached to this post.
Last edited by shakotay2 on Sat Nov 06, 2021 11:03 pm, edited 3 times in total.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
cmr14
n00b
Posts: 14
Joined: Mon Jun 20, 2016 9:17 pm
Been thanked: 1 time

Re: Extracting simple models

Post by cmr14 »

shakotay2 wrote:well, 2000 downloads of hex2obj so far (and maybe 5 regular users? :D )
Hi master, I have a problem with a file of Valentino Rossi the game (2016) of milestone.
I tried import myself a file model 3d of a helmet, but it has not worked for me.. I follow the tutorial but something dont work.. (im spanish, my english is very bad)
In vertices count the number is 65281 and the file is 217kb.. something its wrong :(
Can you help me? Here is the file :

http://www.mediafire.com/download/y05fa ... ET_020.BIN

I dont know if someone (or you) can export the model, but I want to learn the metod of edit the file and import in blender for editing.
Please help me, thanks in advance master!
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4286
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1147 times
Been thanked: 2242 times

Re: Extracting simple models

Post by shakotay2 »

cmr14 wrote:Hi master,
Just to keep you informed, “There is no Master but the Master,”
and in this forum he's called MrAdults. :D
I tried import myself a file model 3d of a helmet, but it has not worked for me.. I follow the tutorial but something dont work..
the vertices are half floats - those are not so easy to identify for beginners.

I myself didn't get it within the magic 15 minutes, to be honest. (Took me nearly an hour - but I was distracted a little bit watching soccer in tv.)
helmet_020-bin.jpg
You do not have the required permissions to view the files attached to this post.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
cmr14
n00b
Posts: 14
Joined: Mon Jun 20, 2016 9:17 pm
Been thanked: 1 time

Re: Extracting simple models

Post by cmr14 »

shakotay2 wrote:I myself didn't get it within the magic 15 minutes, to be honest. (Took me nearly an hour - but I was distracted a little bit watching soccer in tv.)
Mmm well, finally the error its mine haha
Can you tell me some tips for work on this files? only for this game.
I know this is very difficult, but I really interesting in editing this game.. Can you help me?
Thanks for you reply and thanks for your work!!!
Post Reply