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.
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 »

Thank you again shakotay2, you are awesome.
SchnelleMeyer
beginner
Posts: 27
Joined: Sun Feb 26, 2017 10:28 pm
Has thanked: 9 times
Been thanked: 4 times

Re: Extracting simple models

Post by SchnelleMeyer »

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]
Acewell
VIP member
VIP member
Posts: 1330
Joined: Wed Nov 05, 2008 12:16 pm
Has thanked: 2710 times
Been thanked: 884 times

Re: Extracting simple models

Post by Acewell »

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: 215
Joined: Sat Sep 24, 2011 7:06 pm
Has thanked: 78 times
Been thanked: 32 times

Re: Extracting simple models

Post by TRDaz »

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: 4291
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1151 times
Been thanked: 2244 times

Re: Extracting simple models

Post by shakotay2 »

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.
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?"
TRDaz
mega-veteran
mega-veteran
Posts: 215
Joined: Sat Sep 24, 2011 7:06 pm
Has thanked: 78 times
Been thanked: 32 times

Re: Extracting simple models

Post by TRDaz »

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
beginner
Posts: 27
Joined: Sun Feb 26, 2017 10:28 pm
Has thanked: 9 times
Been thanked: 4 times

Re: Extracting simple models

Post by SchnelleMeyer »

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.
Acewell
VIP member
VIP member
Posts: 1330
Joined: Wed Nov 05, 2008 12:16 pm
Has thanked: 2710 times
Been thanked: 884 times

Re: Extracting simple models

Post by Acewell »

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: 215
Joined: Sat Sep 24, 2011 7:06 pm
Has thanked: 78 times
Been thanked: 32 times

Re: Extracting simple models

Post by TRDaz »

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 »

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: 4291
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1151 times
Been thanked: 2244 times

Re: Extracting simple models

Post by shakotay2 »

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?
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?"
Acewell
VIP member
VIP member
Posts: 1330
Joined: Wed Nov 05, 2008 12:16 pm
Has thanked: 2710 times
Been thanked: 884 times

Re: Extracting simple models

Post by Acewell »

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 »

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: 4291
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1151 times
Been thanked: 2244 times

Re: Extracting simple models

Post by shakotay2 »

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.
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?"
Acewell
VIP member
VIP member
Posts: 1330
Joined: Wed Nov 05, 2008 12:16 pm
Has thanked: 2710 times
Been thanked: 884 times

Re: Extracting simple models

Post by Acewell »

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