READ THE RULES: Click here

Follow us on Facebook: https://www.facebook.com/xentax/ :)

3D Model Researcher - extract 3D models with Python

General game file tools that are useful for more than one game
jayn23
n00b
Posts: 15
Joined: Sun Jul 17, 2011 9:30 pm
Has thanked: 5 times
Been thanked: 4 times

Re: 3D Model Researcher - extract 3D models with Python

Post by jayn23 » Fri Jul 26, 2019 3:17 pm

Hi,

Mostly for debugging my code and i am just used to scripting in visual studio :)
And since i am new to python i checked online and it said that you should be able to import .pyd files.

Great tool by the way!

EDXZ23
n00b
Posts: 17
Joined: Tue May 07, 2019 7:49 pm
Has thanked: 11 times

Re: 3D Model Researcher - extract 3D models with Python

Post by EDXZ23 » Tue Jul 30, 2019 10:29 pm

Hi Lazov,

I'm having problems getting the faces of a model.

There's 8 submeshes but only a small part of the model renders and even that doesn't look right

Could you tell me what i'm doing wrong? i'm using 3D Model Researcher Pro

Thanks!!

P.S i'm loving the tool by the way, keep up the good work
1.png
You do not have the required permissions to view the files attached to this post.

Lazov
advanced
Posts: 51
Joined: Sat Oct 08, 2016 11:56 am
Has thanked: 16 times
Been thanked: 39 times

Re: 3D Model Researcher - extract 3D models with Python

Post by Lazov » Wed Jul 31, 2019 3:36 am

EDXZ23
It is necessary to watch the model itself, a screenshot does not give any information. Some models can not be opened using standard functionality. But with the help of scripts you can extract any models.

EDXZ23
n00b
Posts: 17
Joined: Tue May 07, 2019 7:49 pm
Has thanked: 11 times

Re: 3D Model Researcher - extract 3D models with Python

Post by EDXZ23 » Wed Jul 31, 2019 12:32 pm

Lazov wrote:
Wed Jul 31, 2019 3:36 am
EDXZ23
It is necessary to watch the model itself, a screenshot does not give any information. Some models can not be opened using standard functionality. But with the help of scripts you can extract any models.
Hi again Lazov, thanks for the reply!!

I've tried to use a script from a youtube video and the same thing happens. but this time i get an error message "MRError: Invalid data - cannot reshape array of size 1000 into shape (3)"

the hex values for a face is 00 00 01 00 02 and i use the first instance of these as my face offset
error.png
You do not have the required permissions to view the files attached to this post.

Lazov
advanced
Posts: 51
Joined: Sat Oct 08, 2016 11:56 am
Has thanked: 16 times
Been thanked: 39 times

Re: 3D Model Researcher - extract 3D models with Python

Post by Lazov » Wed Jul 31, 2019 5:04 pm

EDXZ23
The readByte function returns a single value, and a tuple is needed.
Try this:
fc = (f.readByte (), f.readByte (), f.readByte ())
faces.append (fc)

But it will not help to extract the model. Need to somehow convert the data.

EDXZ23
n00b
Posts: 17
Joined: Tue May 07, 2019 7:49 pm
Has thanked: 11 times

Re: 3D Model Researcher - extract 3D models with Python

Post by EDXZ23 » Wed Jul 31, 2019 7:51 pm

Lazov wrote:
Wed Jul 31, 2019 5:04 pm
EDXZ23
The readByte function returns a single value, and a tuple is needed.
Try this:
fc = (f.readByte (), f.readByte (), f.readByte ())
faces.append (fc)

But it will not help to extract the model. Need to somehow convert the data.
Hi Lazov thanks again for the help!!

your code worked the error message is no longer occurring! but you were right about it not helping extract the model.
You said i have to convert the data. any ideas how or to what? the file is currently in .dat extension

P.S i'm really new to all of this, sorry if all my questions are basic and annoying

EDXZ23
n00b
Posts: 17
Joined: Tue May 07, 2019 7:49 pm
Has thanked: 11 times

Re: 3D Model Researcher - extract 3D models with Python

Post by EDXZ23 » Mon Aug 05, 2019 3:27 am

Lazov wrote:
Wed Jul 31, 2019 5:04 pm
EDXZ23
The readByte function returns a single value, and a tuple is needed.
Try this:
fc = (f.readByte (), f.readByte (), f.readByte ())
faces.append (fc)

But it will not help to extract the model. Need to somehow convert the data.

could you elaborate on convert data?

Lazov
advanced
Posts: 51
Joined: Sat Oct 08, 2016 11:56 am
Has thanked: 16 times
Been thanked: 39 times

Re: 3D Model Researcher - extract 3D models with Python

Post by Lazov » Mon Aug 05, 2019 2:16 pm

EDXZ23
Unfortunately, there is nothing I can help. I almost do not extract models. But there are people who know this subject very well. Try to ask a question on the forum:
viewforum.php?f=16

GHFear
advanced
Posts: 44
Joined: Tue Dec 04, 2018 9:29 am
Has thanked: 3 times
Been thanked: 7 times

Re: 3D Model Researcher - extract 3D models with Python

Post by GHFear » Wed Aug 07, 2019 11:42 am

Lazov wrote:
Mon Aug 05, 2019 2:16 pm
EDXZ23
Unfortunately, there is nothing I can help. I almost do not extract models. But there are people who know this subject very well. Try to ask a question on the forum:
viewforum.php?f=16
Hello Lazov,
What do you do in the backend to calculate the UVs from Signed and Unsigned Short?

EDXZ23
n00b
Posts: 17
Joined: Tue May 07, 2019 7:49 pm
Has thanked: 11 times

Re: 3D Model Researcher - extract 3D models with Python

Post by EDXZ23 » Wed Aug 07, 2019 1:19 pm

GHFear wrote:
Wed Aug 07, 2019 11:42 am
Lazov wrote:
Mon Aug 05, 2019 2:16 pm
EDXZ23
Unfortunately, there is nothing I can help. I almost do not extract models. But there are people who know this subject very well. Try to ask a question on the forum:
viewforum.php?f=16
Hello Lazov,
What do you do in the backend to calculate the UVs from Signed and Unsigned Short?
Hi GHFear,

Your skate extraction videos is what I've been using as a guide.

I've been told that the faces in my file can't be read as a single array and that there may be many start and stop offsets

I've successfully found the first one, but how do I find the others? the file has a similar structure to .rax files in SWBF3 by Free Radical
progress.png
You do not have the required permissions to view the files attached to this post.

GHFear
advanced
Posts: 44
Joined: Tue Dec 04, 2018 9:29 am
Has thanked: 3 times
Been thanked: 7 times

Re: 3D Model Researcher - extract 3D models with Python

Post by GHFear » Fri Aug 09, 2019 8:17 am

EDXZ23 wrote:
Wed Aug 07, 2019 1:19 pm
GHFear wrote:
Wed Aug 07, 2019 11:42 am
Lazov wrote:
Mon Aug 05, 2019 2:16 pm
EDXZ23
Unfortunately, there is nothing I can help. I almost do not extract models. But there are people who know this subject very well. Try to ask a question on the forum:
viewforum.php?f=16
Hello Lazov,
What do you do in the backend to calculate the UVs from Signed and Unsigned Short?
Hi GHFear,

Your skate extraction videos is what I've been using as a guide.

I've been told that the faces in my file can't be read as a single array and that there may be many start and stop offsets

I've successfully found the first one, but how do I find the others? the file has a similar structure to .rax files in SWBF3 by Free Radical
progress.png
Hello
You would have to upload the file so I can look at it.

/GHFear

EDXZ23
n00b
Posts: 17
Joined: Tue May 07, 2019 7:49 pm
Has thanked: 11 times

Re: 3D Model Researcher - extract 3D models with Python

Post by EDXZ23 » Fri Aug 09, 2019 10:37 am

GHFear wrote:
Fri Aug 09, 2019 8:17 am
EDXZ23 wrote:
Wed Aug 07, 2019 1:19 pm
GHFear wrote:
Wed Aug 07, 2019 11:42 am


Hello Lazov,
What do you do in the backend to calculate the UVs from Signed and Unsigned Short?
Hi GHFear,

Your skate extraction videos is what I've been using as a guide.

I've been told that the faces in my file can't be read as a single array and that there may be many start and stop offsets

I've successfully found the first one, but how do I find the others? the file has a similar structure to .rax files in SWBF3 by Free Radical
progress.png
Hello
You would have to upload the file so I can look at it.

/GHFear

heres the file dude!
6118.zip
the file was extracted to .dat but i know now that its a .rax file
You do not have the required permissions to view the files attached to this post.

GHFear
advanced
Posts: 44
Joined: Tue Dec 04, 2018 9:29 am
Has thanked: 3 times
Been thanked: 7 times

Re: 3D Model Researcher - extract 3D models with Python

Post by GHFear » Fri Aug 09, 2019 1:13 pm

EDXZ23 wrote:
Fri Aug 09, 2019 10:37 am
GHFear wrote:
Fri Aug 09, 2019 8:17 am
EDXZ23 wrote:
Wed Aug 07, 2019 1:19 pm


Hi GHFear,

Your skate extraction videos is what I've been using as a guide.

I've been told that the faces in my file can't be read as a single array and that there may be many start and stop offsets

I've successfully found the first one, but how do I find the others? the file has a similar structure to .rax files in SWBF3 by Free Radical
progress.png
Hello
You would have to upload the file so I can look at it.

/GHFear

heres the file dude!
6118.zip

the file was extracted to .dat but i know now that its a .rax file
I can not for the life of me figure this format out.
sorry.

Lazov
advanced
Posts: 51
Joined: Sat Oct 08, 2016 11:56 am
Has thanked: 16 times
Been thanked: 39 times

Re: 3D Model Researcher - extract 3D models with Python

Post by Lazov » Fri Aug 09, 2019 9:00 pm

GHFear
All coordinates are divided by 0xffff.

EDXZ23
Try using meshes. If it turned out to build part of the model, this is already good.
By the way, I can not open the archive with your model.

GHFear
advanced
Posts: 44
Joined: Tue Dec 04, 2018 9:29 am
Has thanked: 3 times
Been thanked: 7 times

Re: 3D Model Researcher - extract 3D models with Python

Post by GHFear » Sat Aug 10, 2019 3:41 am

Lazov wrote:
Fri Aug 09, 2019 9:00 pm
GHFear
All coordinates are divided by 0xffff.

EDXZ23
Try using meshes. If it turned out to build part of the model, this is already good.
By the way, I can not open the archive with your model.
Hi Lazov.

Thanks for the answer.

The UV coordinates are in hexadecimal: 0x107 and 0x20A8 Big Endian.
The value shown in the .OBJ file is 0.0083 and 0.2568.

Dividing 0x107 (263) by 0xffff (65535) = 0,00401312275883115892271305409323
Dividing 0x20A8 (8360) by 0xffff (65535) = 0,12756542305638208590829327840085‬

So there must be something else being done to the coordinates to get 0.0083 and 0.2568.
Or maybe I am completely missing something.


Edit (Solution): If anyone has the same problem converting short / 16bit Int UVs to floats,
my solution is this:

If you're using python and rounding,

rounded UVs Multiplier:

short U / 31869
short V / 32553

If you don't want to round and just accept some tiny variance:

raw UVs Multiplier:

short U / 31868
short V / 32555

/GHFear

Post Reply