Page 1 of 4

Cars 2 model exporting problems- please help

Posted: Tue Aug 11, 2020 1:13 am
by xpunkrockyugox
So as stated in the title, I've been trying to extract the character models from the Cars 2 game (version from Steam) to convert for SFM, Gmod and things like that. I've done something similar in the past where I used QuickBMS and NifSkope along with Blender to rip the stages from Wizard101 for use in MMD, but this is proving to be way, way harder than the Wizard101 stages thing.
For starters, the character model and texture are in a .oct file. I followed the links for the programs from the Cars 2 game modding Wiki page (https://modcars.fandom.com/wiki/Cars_2), but unfortunately it's basically dead over there. Doing more research I found out that Disney Infinity character models are in the same format, so I used the Disney Infinity Model Extractor (viewtopic.php?t=11187) on the Axelrod.vbuf file like it said, and exported it as a .obj file. It wouldn't open in Blender, just giving me an error, and when I double clicked it the default 3D viewer thing showed me this crazy looking paperwad thing.
I'm super new to hacking/decoding and 3D modeling in general, so I'm super lost and would be extremely grateful if someone could help me figure out what's happening here and how I can get the model to open- without turning into a paperwad, that is- and save as a normal format. If needed I can provide a Google Drive link to the game folder in question or share more screenshots, just let me know any information that might be useful. Thanks! :D

Re: Cars 2 model exporting problems- please help

Posted: Tue Aug 11, 2020 5:32 am
by reh
It would be nice to have some sample files.

Re: Cars 2 model exporting problems- please help

Posted: Tue Aug 11, 2020 2:37 pm
by xpunkrockyugox
reh wrote:
Tue Aug 11, 2020 5:32 am
It would be nice to have some sample files.
Absolutely, here's the zipped version of the original folder directly from the game: https://drive.google.com/file/d/18vppy1 ... sp=sharing
And here's the folder with my attempts at conversion: https://drive.google.com/file/d/13MPlV_ ... sp=sharing
The version of Blender I'm running is 2.83.4- the latest version as of when I downloaded it.
Just let me know if you'd like any other files :)

Re: Cars 2 model exporting problems- please help

Posted: Tue Aug 11, 2020 10:21 pm
by shakotay2
Format appears to be rather simple - only hurdle using hex2obj (view link in my sig) is the fact that vertices follow after uvs.

Load axelrod_0.bin into hex2obj.
Then you've to modify the flat "mesh" .obj created using axelrod_0_uv.h2o by replacing "v " by "vt " lines and copy/paste them into the obj created using axelrod_0_mesh.h2o. (Be sure to have
g submesh_0
f 1/1 2/2 3/3
f 3/3 2/2 4/4
f 2/2 9/9 4/4
f 4/4 9/9 10/10
f 9/9 11/11 10/10
...
in that obj.)
axelrod_0_0.zip
(In case you fail just use the contained obj file. :D )

Re: Cars 2 model exporting problems- please help

Posted: Wed Aug 12, 2020 5:48 pm
by xpunkrockyugox
Thank you so much!! I do have a few problems though...
- I don't really understand the thing with the numbers and .bins, I'm not very tech savvy when it comes to this kind of behind the scenes stuff >.< So I have to convert the .oct to a .bin somehow then open it in this Hex2OBJ program and plug in those numbers, if I'm understanding you correctly?
- The link to the program wasn't working, it just took me to a website with a bunch of fake download things and wouldn't actually give me the zip file.

Re: Cars 2 model exporting problems- please help

Posted: Wed Aug 12, 2020 6:19 pm
by shakotay2
xpunkrockyugox wrote:
Wed Aug 12, 2020 5:48 pm
So I have to convert the .oct to a .bin somehow
No - the bin is the binary copy of .vbuf+ .ibuf file(s). If you can't use hex2obj you'll have to wait for someone coding a (python) script.
.
axelrod.png
- The link to the program wasn't working, ...
Trust me, it is. Look at the bottom of that site:
File to download: hex2o__0.24e3.zip(842.36 Kb)

(161 downloads of that version so far)

Re: Cars 2 model exporting problems- please help

Posted: Wed Aug 12, 2020 8:15 pm
by xpunkrockyugox
This is amazing!! Sorry for not really understanding the hex2obj thing right off, I'm... kind of a noob to anything involving hexadecimals or raw data editing. I really do want to learn how to use it though, and do this myself for the other models. I don't think I need a Python script that'll do it for me in Blender- I actually tried to get one and it didn't work.
Edit: The main things I'm confused about are the .bin thing (specifically, how to turn the .vbuf and .ibuf files into one .bin) and the v by vt thing- I'm not quite sure if you're telling me to add a "t" after every lone v I see or to delete any line that starts with v or vt. Again, really sorry for being kind of a dummy, this is my very first reverse engineering feat.

Re: Cars 2 model exporting problems- please help

Posted: Wed Aug 12, 2020 11:51 pm
by shakotay2
xpunkrockyugox wrote:
Wed Aug 12, 2020 8:15 pm
Edit: The main things I'm confused about are the .bin thing (specifically, how to turn the .vbuf and .ibuf files into one .bin)
Create a .txt file (rename to .cmd finally) with this single line:
copy /b axelrod_0.vbuf + axelrod_0.ibuf axelrod_0.bin
and execute it in the folder where vbuf/ibuf files reside.
and the v by vt thing- I'm not quite sure if you're telling me to add a "t" after every lone v I see or to delete any line that starts with v or vt.
That's basic office knowledge (notepad, menu edit/replace). :wink:
Open .obj file in your preferred texteditor then replace (without the quotes): "v " by "vt "

btw: that's not the usual approach when using hex2obj, it's just required because for this 3D format uv (texture) coordinates come before vertices. (For many if not most formats the order is like such: vertices normals uvs)

Re: Cars 2 model exporting problems- please help

Posted: Thu Aug 13, 2020 12:45 am
by xpunkrockyugox
I apologize for continuing to ask stupid questions, but when I opened the axelrod.bin file in Hex2OBJ, it just gave me an error message when I tried to save it as an H20 file. I'm really confused about this and feel bad for being so confused... :cry: So am I supposed to open the .bin in a hex editor and get the vertex and face ranges or whatever the tutorial said?
Like I said, I'm totally over my head right now, but as confused as I am, that's also how eager I am to learn it so I won't be confused anymore! :)

Re: Cars 2 model exporting problems- please help

Posted: Thu Aug 13, 2020 9:21 am
by shakotay2
xpunkrockyugox wrote:
Thu Aug 13, 2020 12:45 am
, but when I opened the axelrod.bin file in Hex2OBJ, it just gave me an error message when I tried to save it as an H20 file.
The .bin file is NOT saved as H2O file, the params (addresses, counts) are.
Rename or delete existing H2O files to save another one.
So am I supposed to open the .bin in a hex editor and get the vertex and face ranges or whatever the tutorial said?
That's the idea. (In this case the H2O files exist already.)

Re: Cars 2 model exporting problems- please help

Posted: Thu Aug 13, 2020 12:39 pm
by Bigchillghost
shakotay2 wrote:
Wed Aug 12, 2020 11:51 pm
it's just required because for this 3D format uv (texture) coordinates come before vertices.
Isn't it possible to use the absolute addresses for positions and uvs?
xpunkrockyugox wrote:
Wed Aug 12, 2020 8:15 pm
The main things I'm confused about are the .bin thing (specifically, how to turn the .vbuf and .ibuf files into one .bin) and the v by vt thing- I'm not quite sure if you're telling me to add a "t" after every lone v I see or to delete any line that starts with v or vt.
You don't have to do any of that actually. This is where AMR will come in handy. :D
axelrod_0.png

Re: Cars 2 model exporting problems- please help

Posted: Thu Aug 13, 2020 8:13 pm
by xpunkrockyugox
shakotay2 wrote:
Thu Aug 13, 2020 9:21 am
xpunkrockyugox wrote:
Thu Aug 13, 2020 12:45 am
, but when I opened the axelrod.bin file in Hex2OBJ, it just gave me an error message when I tried to save it as an H20 file.
The .bin file is NOT saved as H2O file, the params (addresses, counts) are.
Rename or delete existing H2O files to save another one.
So am I supposed to open the .bin in a hex editor and get the vertex and face ranges or whatever the tutorial said?
That's the idea. (In this case the H2O files exist already.)
Ohhh, so if I'm understanding, you made the H2O file and I can use that on the other models/bins I want to export? (I'm just trying to find out how to do it myself because I have at least 8 other characters I'm interested in exporting. I just used Axelrod as my guinea pig because he was one of the first ones in the characters folder. I'm not gonna bug anybody for help with the others, just trying to get a process down here. ^^)

Re: Cars 2 model exporting problems- please help

Posted: Thu Aug 13, 2020 8:26 pm
by xpunkrockyugox
Bigchillghost wrote:
Thu Aug 13, 2020 12:39 pm
shakotay2 wrote:
Wed Aug 12, 2020 11:51 pm
it's just required because for this 3D format uv (texture) coordinates come before vertices.
Isn't it possible to use the absolute addresses for positions and uvs?
xpunkrockyugox wrote:
Wed Aug 12, 2020 8:15 pm
The main things I'm confused about are the .bin thing (specifically, how to turn the .vbuf and .ibuf files into one .bin) and the v by vt thing- I'm not quite sure if you're telling me to add a "t" after every lone v I see or to delete any line that starts with v or vt.
You don't have to do any of that actually. This is where AMR will come in handy. :D
axelrod_0.png
That's amazing!! Thank you so much. I'm curious though- where do you get the numbers for the polygon indices and stuff? Do I use a hex editor there?

Re: Cars 2 model exporting problems- please help

Posted: Fri Aug 14, 2020 1:02 am
by Bigchillghost
xpunkrockyugox wrote:
Thu Aug 13, 2020 8:26 pm
Do I use a hex editor there?
Surely you do.
xpunkrockyugox wrote:
Thu Aug 13, 2020 8:26 pm
I'm curious though- where do you get the numbers for the polygon indices and stuff?
For polygon indices, the count equals the size of the ibuf file divided by 2. You can get the vertex count by clicking the Calculated button after interpreting the indices. The normals are at a separate chunk right after the one that combines the uvs and the positions. You can get this value by copying the end address from the digest message box after interpreting the uvs. For the rest of the params, just use the same ones shown in the screenshot.

P.S.: a little advice, edit your quotes next time to remove the unnecessary parts.

Re: Cars 2 model exporting problems- please help

Posted: Sat Aug 15, 2020 4:02 am
by xpunkrockyugox
Bigchillghost wrote:
Fri Aug 14, 2020 1:02 am
For polygon indices, the count equals the size of the ibuf file divided by 2. You can get the vertex count by clicking the Calculated button after interpreting the indices. The normals are at a separate chunk right after the one that combines the uvs and the positions. You can get this value by copying the end address from the digest message box after interpreting the uvs. For the rest of the params, just use the same ones shown in the screenshot.

P.S.: a little advice, edit your quotes next time to remove the unnecessary parts.
Thanks! Sorry about the long quotes earlier, I'm new to this site lol
Thank you so much for the formula stuff! I couldn't have made this progress without all of y'all's help, very grateful for the advice and instructions :D
As for the textures, I got inconsistent results using the TextureRipper tool from MarvelMods. Does AMR have an option to get textures out? I just used the TextureRipper on the .oct file twice and got two slightly different looking textures. I want to make sure to get the textures looking just right so that I can apply the UV correctly.