Page 3 of 4

Re: Dead Space 2 Suit Models Help Please

Posted: Sun Feb 13, 2011 8:19 am
by nightFlarer
Phew, ok, I am done. So it's the same deal guys with maxscripts.
Copy the code below, open up 3DS Max, Maxscript Menu>New Script, then paste, save, Maxscript Menu>Run Script, select the script you saved.

Now it's going to ask for the mesh file, so open up a .geo in the "Mesh" folder eg. 0144_torsoupper.geo
Then it's going to ask for the UV file which is also a .geo file, but should be in the "MeshVolatile" folder eg. 0145_torsoupper.geo
Notice that the number is different, lower is the mesh and greater is the UV.

14/02/11 Edit: Fixed the code so it didn't suck...

23/02/11 Edit 2: The .geo format is really inconsistent, so I've added an "if statement" for more compatibility.

6/03/11 Edit 3: Found another face count, should fix problems with files that have multiple meshes

Code: Select all

fname = getOpenFileName \
caption:"Open .geo from Mesh folder" \
types:"Dead Space 2 Mesh(*.geo)|*.geo" \
historyCategory:"DeadSpace2ObjectPresets"
f = fopen fname "rb"
gname = getOpenFileName \
caption:"Open .geo from MeshVolatile folder" \
types:"Dead Space 2 UV(*.geo)|*.geo" \
historyCategory:"DeadSpace2ObjectPresets"
g = fopen gname "rb"
clearlistener()
fscale=100
indices = 0

Face_array=#()
Vert_array=#()
UV_array=#()

fseek f 0x50 #seek_set
infoOff1=readlong f
r=readlong f
r=readlong f
r=readlong f
r=readlong f
r=readlong f
infoOff2=readlong f

fseek f infoOff1 #seek_set
fseek f 48 #seek_cur
Print ("Last Read @ 0x"+((bit.intAsHex(ftell f))as string))
faceInd=readlong f
fseek f 76 #seek_cur
unk01=readlong f
vertOff=readlong f
faceOff=readlong f


fseek f infoOff2 #seek_set
Print ("Last Read @ 0x"+((bit.intAsHex(ftell f))as string))
unk1=readlong f
vertcount=readlong f
unk2=readlong f
null1=readlong f
unk3=readlong f
vertcount=readlong f
unk4=readlong f
unk5=readlong f
unk6=readlong f
face=readlong f
Print ("Last Read @ 0x"+((bit.intAsHex(ftell f))as string))
unk7=readlong f
unk8=readlong f
unk9=readlong f
unk10=readlong f
unk11=readlong f
unk12=readlong f
unk13=readlong f
face2=readlong f
Print ("face2 @ 0x"+((bit.intAsHex(ftell f))as string))

fseek f vertOff #seek_set
Print ("Last Read @ 0x"+((bit.intAsHex(ftell f))as string))

   
for x = 1 to vertcount do(

vx=readfloat f
vy=readfloat f
vz=readfloat f
p=readfloat f
p=readfloat f
p=readfloat f
p=readfloat f
p=readfloat f
append Vert_array([vx,vy,vz] * fscale)
)

for u = 1 to vertcount do(
tu=readfloat g
tv=readfloat g
append UV_array[tu,tv,0]
)

fseek f faceoff #seek_set
Print ("Last Read @ 0x"+((bit.intAsHex(ftell f))as string))

if (face2 > faceInd) then (
indices = face2
)else(
indices = faceInd)

if (faceInd > face) then (
indices = faceInd
)else(
indices = face)

for x = 1 to indices/3 do(
fa=readshort f #unsigned+1
fb=readshort f #unsigned+1
fc=readshort f #unsigned+1
append Face_array[fa,fb,fc]
)
Print ("Last Read @ 0x"+((bit.intAsHex(ftell f))as string))

msh = mesh vertices:Vert_array faces:Face_array
msh.numTVerts = UV_array.count
buildTVFaces msh
for j = 1 to UV_array.count do setTVert msh j UV_array[j]
for j = 1 to Face_array.count do setTVFace msh j Face_array[j]

Print ("Last Read @ 0x"+((bit.intAsHex(ftell f))as string))
gc()
fclose f
fclose g

Re: Dead Space 2 Suit Models Help Please

Posted: Sun Feb 13, 2011 2:13 pm
by chrrox
you know that wont work for all meshes the offset and vertex declarations change alot.

Re: Dead Space 2 Suit Models Help Please

Posted: Sun Feb 13, 2011 2:59 pm
by renato
I'm only able to open dismembered parts using this script

The program gives this error when I try to open 0136_playeradvancedhelmet and 0137_playeradvancedhelmet

Image

and this when I try to open 0138_right_leg1 and 0139_right_leg1

Image


by google translate

Re: Dead Space 2 Suit Models Help Please

Posted: Sun Feb 13, 2011 10:52 pm
by nightFlarer
chrrox wrote:you know that wont work for all meshes the offset and vertex declarations change alot.
Oh really? :( I only tried two meshes and it worked so I thought it would of been the same.
Well I'm at uni at the moment so I'll fix it when I get home.

@renato - I'll fix it soon. Also could you upload those files?

Re: Dead Space 2 Suit Models Help Please

Posted: Sun Feb 13, 2011 11:13 pm
by renato

Re: Dead Space 2 Suit Models Help Please

Posted: Mon Feb 14, 2011 12:56 am
by nightFlarer
Image

Ok, I quickly did this at uni lol. So I've updated the script above, It should be fixed now.

Re: Dead Space 2 Suit Models Help Please

Posted: Mon Feb 14, 2011 1:48 am
by renato
perfect man

thx thx thx thx

edit:

While I was exploring the files I found a strange thing:
Image

the files:
0131_mesh_rarm00_dism.geo
0132_mesh_rarm00_dism.geo

Re: Dead Space 2 Suit Models Help Please

Posted: Mon Feb 14, 2011 4:12 am
by Nexus Elite ns
The contents of this post was deleted because of possible forum rules violation.

Re: Dead Space 2 Suit Models Help Please

Posted: Mon Feb 14, 2011 5:46 am
by nightFlarer
@Nexus Elite ns and renato
Whoa, those files are different, from the others.

The vertices don't seem to follow the same pattern. This will probably take awhile, sooo..back to drawing board again.

Re: Dead Space 2 Suit Models Help Please

Posted: Mon Feb 14, 2011 6:39 am
by Nexus Elite ns
nightFlarer wrote:@Nexus Elite ns and renato
Whoa, those files are different, from the others.

The vertices don't seem to follow the same pattern. This will probably take awhile, sooo..back to drawing board again.
Well you're doing your best at least. Thanks for doing the script for the community.

Though, it strange that there some missing GEO files for the mesh and UV, is anyone else missing few parts from geo? I think the STR unpacker isn't fully working.

Re: Dead Space 2 Suit Models Help Please

Posted: Mon Feb 14, 2011 5:34 pm
by Aliensoldier
Just a quick question:

When you export the GEOs into 3Ds Max and open the Material Editor you can see that the textures are already applied to the mesh.
Are the texture coordinates correct?
And does somebody know how to convert the TG4D textures?
Thanks!

Re: Dead Space 2 Suit Models Help Please

Posted: Mon Feb 14, 2011 10:49 pm
by nightFlarer
Well it could be possible that the texture UVs are flipped, but we can't be sure until the textures are properly ripped. Rick has a slightly working converter, but I don't think the results are perfect yet.

Re: Dead Space 2 Suit Models Help Please

Posted: Tue Feb 15, 2011 9:29 pm
by AceAngel
Hey, sorry for the extremely stupid question I'm going to ask, but here it goes.

Does the script work on DS1 models? When I try, it says it needs Geo UV's, and so far I'm unable to find a file that has the same Name which could correspond to the GEO containing the UV's.

Also, the errors reports back as --Float.

Stupid question, I know, so I was just wondering.

Re: Dead Space 2 Suit Models Help Please

Posted: Wed Feb 16, 2011 12:18 am
by nightFlarer
AceAngel wrote:Hey, sorry for the extremely stupid question I'm going to ask, but here it goes.

Does the script work on DS1 models? When I try, it says it needs Geo UV's, and so far I'm unable to find a file that has the same Name which could correspond to the GEO containing the UV's.

Also, the errors reports back as --Float.

Stupid question, I know, so I was just wondering.
I'm not sure if it's the same, I don't have any of the games. It could possibly be different, post a couple of samples and I'll quickly check.

Re: Dead Space 2 Suit Models Help Please

Posted: Wed Feb 16, 2011 12:36 am
by jaden
Great progress