Join also our Discord channel! Click here.

Extracting simple models

Read or post any tutorial related to file format analysis for modding purposes.
PaulBuryCZ
ultra-n00b
Posts: 5
Joined: Sun Aug 16, 2015 11:12 pm
Has thanked: 4 times
Been thanked: 1 time

Re: Extracting simple models

Post by PaulBuryCZ » Fri Mar 10, 2017 12:49 pm

Thank you again shakotay2, you are awesome.

SchnelleMeyer
n00b
Posts: 17
Joined: Sun Feb 26, 2017 10:28 pm
Has thanked: 6 times
Been thanked: 3 times

Re: Extracting simple models

Post by SchnelleMeyer » Fri Mar 10, 2017 5:16 pm

AceWell wrote:use "File>SaveAs mesh" when you are done, that will save out a working obj file with the settings you have in Hex2obj.
i should note that there is no shortall with Halffloat UV setting, so you have to save out 2 obj files with
both settings and combine the correct UVs (lines that start with "vt") with the correct mesh manually.
Yeah I save the mesh with shortall and UVs with Halffloat and both are good.
How would you combine the correct UVs with the mesh manually as you say? This is my issue that I cant solve.

Thanks.

EDIT: Nevermind my above question - I found a quick and easy way to do this in Blender. Edit no 2: That didnt work after all... Question still stands [roll]

User avatar
Acewell
VIP member
VIP member
Posts: 1328
Joined: Wed Nov 05, 2008 12:16 pm
Has thanked: 2677 times
Been thanked: 828 times

Re: Extracting simple models

Post by Acewell » Sat Mar 11, 2017 1:01 am

open the obj with correct mesh settings in Notepad++ and press ctrl+h and switch to the "Mark" tab
type "vt " in the "Find what:" field and tick "Bookmark line" and finally click on "Mark All"
now check to make sure only the lines that start with "vt" are bookmarked
now go to "Search > Bookmark > Remove Bookmarked lines"
this file is now ready for the correct UV data to be inserted
just leave it open in Notepad++

open the other obj with with the correct UV settings in Notepad++ and press ctrl+h and switch to the "Mark" tab
type "vt " in the "Find what:" field and tick "Bookmark line" and finally click on "Mark All"
now check to make sure only the lines that start with "vt" are bookmarked
now go to "Search > Bookmark > Remove Unmarked lines"
this should leave only the UV data in the file
ctrl+a to select all and ctrl+c to copy it

now paste it all (ctrl+v) between the vertex and face indices data in the first opened obj file and save it
it should now have all correct mesh and UV data
:D

TRDaz
mega-veteran
mega-veteran
Posts: 210
Joined: Sat Sep 24, 2011 7:06 pm
Has thanked: 75 times
Been thanked: 26 times

Re: Extracting simple models

Post by TRDaz » Sat Mar 11, 2017 1:03 pm

Hi, I've worked with hex2obj before and I can understand the basics but I have come across some files from Mirror's Edge Catalyst where I am unable to find the starts of the faces and the vertices, there seems to be multiple submeshes, I attempted to get it to work but it seems to just output a bunch of messed up triangles. Any chance someone could check it and give me advice? I've seen someone use hex2obj for meshes from this game so I know it is possible, and I believe all the data is in the file I uploaded. After getting the basic idea of one mesh I should be able to do it with other files. Thanks.
https://1drv.ms/u/s!AoEEkLgybKv7hEc9FXciAWt4qR3a

User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 3163
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 859 times
Been thanked: 1735 times

Re: Extracting simple models

Post by shakotay2 » Sat Mar 11, 2017 3:02 pm

TRDaz wrote:where I am unable to find the starts of the faces
WHAT? search for 0000 0100 0200 and you're done.

Why do I have the strange feeling that you're simply too lazy and want to let others do your work? :D
faith_prolo_upper_body.JPG
So I'll leave the uvs for you.
well, uv pos is 32.
You do not have the required permissions to view the files attached to this post.
Bigchillghost, Reverse Engineering a Game Model: viewtopic.php?f=29&t=17889
extracting simple models: viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip
"You quoted the whole thing, what a mess."

TRDaz
mega-veteran
mega-veteran
Posts: 210
Joined: Sat Sep 24, 2011 7:06 pm
Has thanked: 75 times
Been thanked: 26 times

Re: Extracting simple models

Post by TRDaz » Sat Mar 11, 2017 3:20 pm

Sorry, I wasn't being lazy and making others do the work, generally I scroll through and check for data like that but I think since there was multiple submeshes I got a bit confused, I haven't used this on models with many submeshes before. I just have to find the start of the next submesh now. Thank you anyway.

EDIT: Oh I actually saw the problem I had before, I didn't change it to HF_all and that caused the messed up triangles. Sorry for making you check it.

SchnelleMeyer
n00b
Posts: 17
Joined: Sun Feb 26, 2017 10:28 pm
Has thanked: 6 times
Been thanked: 3 times

Re: Extracting simple models

Post by SchnelleMeyer » Sun Mar 12, 2017 2:11 am

Thanks for those detailed instructions AceWell. Excactly what I needed :)

- Also finally had success with transfering UVs from the UVs.obj to the different subs of the main mesh. Problem was I had collapsed the UVs into a single object and that brought the UVs out of alignment with the mesh data.
I had the same problem initally with Notepad++ but it was easy to spot the error with the text and lines.

Last 10 days has been great: Successfully ripping for the first time with Ninja ripper and learning to extract models with H2O.

User avatar
Acewell
VIP member
VIP member
Posts: 1328
Joined: Wed Nov 05, 2008 12:16 pm
Has thanked: 2677 times
Been thanked: 828 times

Re: Extracting simple models

Post by Acewell » Sun Mar 12, 2017 3:37 am

TRDaz wrote:I just have to find the start of the next submesh now.
2nd submesh :D
faith_prologue_upperbody_mesh_chunk.png
if you search for "00 00 01 00 02" you see 4 of these which is a good indication of the number of submeshes.
you will also now know the start address of each submesh face indices and the buffer size from one to the other.
you can input that data in Hex2obj and it will give you the vertex count for that submesh,
you can multiply the vertex count by the stride (40) to get the vertex buffer size and work your way through the vertex block.
but i think there must be a header file some where to go with this chunk file that has all the offsets you need.
You do not have the required permissions to view the files attached to this post.

TRDaz
mega-veteran
mega-veteran
Posts: 210
Joined: Sat Sep 24, 2011 7:06 pm
Has thanked: 75 times
Been thanked: 26 times

Re: Extracting simple models

Post by TRDaz » Sun Mar 12, 2017 12:27 pm

Thanks for the info! This has helped me a lot.

cornal
beginner
Posts: 39
Joined: Sat Oct 25, 2014 3:31 am
Has thanked: 3 times
Been thanked: 9 times

Re: Extracting simple models

Post by cornal » Fri Mar 17, 2017 7:14 pm

This .model from konami is a simple model to start to use H2O?
A004_Ojama_Yellow_b.pc.rar
You do not have the required permissions to view the files attached to this post.

User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 3163
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 859 times
Been thanked: 1735 times

Re: Extracting simple models

Post by shakotay2 » Fri Mar 17, 2017 9:03 pm

cornal wrote:This .model from konami is a simple model to start to use H2O?
A004_Ojama_Yellow_b.pc.rar
looks simple to me.
What did you try, where did you get stuck?
Bigchillghost, Reverse Engineering a Game Model: viewtopic.php?f=29&t=17889
extracting simple models: viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip
"You quoted the whole thing, what a mess."

User avatar
Acewell
VIP member
VIP member
Posts: 1328
Joined: Wed Nov 05, 2008 12:16 pm
Has thanked: 2677 times
Been thanked: 828 times

Re: Extracting simple models

Post by Acewell » Sat Mar 18, 2017 10:36 am

A004_Ojama_Yellow_b.pc.model :D
A004_Ojama_Yellow_b.pc_model.png
simple yes, but the vertex start address in that sample might throw you off

why do i feel like ive seen this same sample before...deja vu? (:
You do not have the required permissions to view the files attached to this post.

cornal
beginner
Posts: 39
Joined: Sat Oct 25, 2014 3:31 am
Has thanked: 3 times
Been thanked: 9 times

Re: Extracting simple models

Post by cornal » Sun Mar 19, 2017 6:26 am

AceWell wrote:A004_Ojama_Yellow_b.pc.model :D
A004_Ojama_Yellow_b.pc_model.png
simple yes, but the vertex start address in that sample might throw you off

why do i feel like ive seen this same sample before...deja vu? (:

I found the scrambled alphabet just like in the tutorial, but when i want find the beginning and the end of vertex address, I dont know what to do :( , maybe i need learn more of Hex signature

User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 3163
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 859 times
Been thanked: 1735 times

Re: Extracting simple models

Post by shakotay2 » Sun Mar 19, 2017 9:37 am

cornal wrote:but when i want find the beginning and the end of vertex address, I dont know what to do :( , maybe i need learn more of Hex signature
you surely do! :)

It's a matter of some basic understanding, finding patterns and simple math:

The face indices' (FIs) list is at 0x29160 - 0x2F276, words assumed (it's mostly words, sometimes DWords and, in very rare cases, bytes).
So the size is 0x6116 -> 24854 = 12427*2
Means we have 12427 FIs here.
Enter start and count of FIs in step "go1" and you get the vertex count (3604, lower left list box)

From the picture you can see the vertex stride is 44 so the size of the vertex block is 0x26B70.
(3604 * 44 = 158576 -> 0x26B70)
Ojama_Yellow_pattern.JPG
Subtract this size from the start of FIs' list and you get the vertex start address:
0x29160 - 26B70 = 0x25F0

btw: it's very important to understand that this proceeding and calculations doesn't apply always
because other 3D formats may have additional data between vertex block and face indices block.
AceWell wrote:simple yes, but the vertex start address in that sample might throw you off
why?
You do not have the required permissions to view the files attached to this post.
Bigchillghost, Reverse Engineering a Game Model: viewtopic.php?f=29&t=17889
extracting simple models: viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip
"You quoted the whole thing, what a mess."

User avatar
Acewell
VIP member
VIP member
Posts: 1328
Joined: Wed Nov 05, 2008 12:16 pm
Has thanked: 2677 times
Been thanked: 828 times

Re: Extracting simple models

Post by Acewell » Sun Mar 19, 2017 10:18 am

shakotay2 wrote:why?
because of where and how it starts, to the inexperienced this could be confusing.

Post Reply