Page 3 of 4

Re: Mafia 2 models [pc]

Posted: Sat Oct 02, 2010 3:40 am
by Dean
I'm having the same problem as the other people who aren't getting anything when they import it. Blender 2.49b, extracted the VertexBufferPool and IndexBufferPool, placed the .blend in the same folder, ran it and executed the script. Sometimes it acts like it's loading a model, but then when I check back a minute later nothing has actually loaded.

Re: Mafia 2 models [pc]

Posted: Sat Oct 02, 2010 12:56 pm
by Szkaradek123
The contents of this post was deleted because of possible forum rules violation.

Re: Mafia 2 models [pc]

Posted: Sat Oct 30, 2010 12:20 am
by shakotay
For all those of you who "did not get anything in blender":

I suppose it's an extractor version problem (which tool did you use for extracting the VertexBufferPool?).

(I used ExSDS v0.3 by CJay.)

I have the mafia2 demo only but I tested it with Lassiter_69.sds and it works:

http://www.pic-upload.de/view-7568802/m ... h.jpg.html

You'll have to right click on the block at the left and delete the selection several times.
At the end you'll see the car.

(Might occcur that nothing is left - then you'll have to repeat the procedure;-)

PS: Thank you so much, Szkaradek123, for your python script!

Re: Mafia 2 models [pc]

Posted: Thu Nov 11, 2010 11:02 pm
by DerPlaya
here's my try to write an exporter:

Mafia2ModelDumper:

- works on sds files (not just vertexbuffer/indexbuffer files, the real info is in the FrameResource data...)
- exports Models with Skeleton (if one exists) to Collada DAE format.

see Readme.txt
perhaps somebody can make a more useful tool with the source (I won't make any updates...)

source is c# (vc#2010, .net 4)

uses Gibbed's tools for sds access (thanks Rick!)

edit: updated the tool (fixed matrix stuff, cause softimage to mess up joint transforms)

Re: Mafia 2 models [pc]

Posted: Fri Nov 12, 2010 1:58 am
by Tosyk
The contents of this post was deleted because of possible forum rules violation.

Re: Mafia 2 models [pc]

Posted: Sat Nov 13, 2010 7:35 pm
by CityPoke912
Can anyone say how use it? I completly don't know how.

Re: Mafia 2 models [pc]

Posted: Sat Nov 13, 2010 10:59 pm
by DerPlaya
bin\Release\Mafia2ModelDumper <sdsfile>

where sdsfile is the path to a sdsfile (preferably one which contains models...)

...should be already be mentioned in the readme.txt

Re: Mafia 2 models [pc]

Posted: Sat Nov 13, 2010 11:08 pm
by shakotay
Copy sds file to release\bin\Release where Mafia2ModelDumper.exe resides.
In a DOS command window type Mafia2ModelDumper lassiter_69.sds for example.
3 dae files should be created (one is lassiter_69.Lassiter_69.Root.L0.dae).

I used 'Collada 1.4.1 Importer (.dae)' (author: teraapi) with blender 2.49 for dae import.

@DerPlaya: very impressive work! Thanks a lot. :)

@all: from city\distillery.sds (Mafia2 demo) you'll get 3000 dae files.
Here are two of them:

http://www.pic-upload.de/view-7751484/d ... e.jpg.html
http://www.pic-upload.de/view-7751499/d ... e.jpg.html

edit: upps, DerPlaya was schnella, ehm faster

greenfield villa:
http://www.pic-upload.de/view-7756712/g ... e.jpg.html

Re: Mafia 2 models [pc]

Posted: Sun Nov 14, 2010 11:02 am
by CityPoke912
My DOS window after a moment close and I can't do anything.

Re: Mafia 2 models [pc]

Posted: Sun Nov 14, 2010 1:36 pm
by shakotay
CityPoke912 wrote:My DOS window after a moment close and I can't do anything.
Which OS?

You'll have to open a DOS-Window:

for Win7: http://www.sevenforums.com/tutorials/94 ... rompt.html

Should be similar for Vista.

Then the window stays open after execution of Mafia2ModelDumper and you can read the output
(whatever it may be).

Re: Mafia 2 models [pc]

Posted: Sun Nov 14, 2010 2:44 pm
by DerPlaya
...drag & drop should also work (the exe just tries to read the first command line argument as an sds file...)

i could have made it more user friendly but it's just a proof of concept thing... i encourage everyone who has c# knowledge (and can understand the poorly commented mess which is my code :wink:) to do something useful with it.

i originally started to write a model viewer but i don't have enough enough time and lack knowledge of mdx, xna, etc. + it would be neccessary to use the games shaders for optimal results (the game does some strange stuff like building dynamic normal maps for damaged cars, dirt, snow etc.). there is some code for reading *.mtl files and shadercache files in the source but it's incomplete and probably all wrong...

@shakotay: question: do the character models work with blender? i thought the collada import plugin for blender can't cope with vertex weights (for skeletal animation).
I'm still searching for a modelling tool to test stuff (i use softimage mod tool at the moment but it likes to crash a lot; gmax doesn't read dae files and all other stuff like maya, 3dsmax cost money...)

@CityPoke912: ...make sure you've got .net framework 4.0.

Re: Mafia 2 models [pc]

Posted: Sun Nov 14, 2010 6:52 pm
by shakotay
DerPlaya wrote: @shakotay: question: do the character models work with blender? i thought the collada import plugin for blender can't cope with vertex weights (for skeletal animation).
Vito looks like this:
http://www.pic-upload.de/view-7761219/v ... e.jpg.html

(There are warnings in the blender console:
Warning: The DOM was unable to create an element named float at line 46. Probably a schema violation.
Warning: The DOM was unable to create an element named color at line 64. Probably a schema violation.

Probably from Dom4Blender.pyd (COLLADA DOM API?) used by the blender dae-import script.)

Re: Mafia 2 models [pc]

Posted: Sun Nov 14, 2010 8:06 pm
by CityPoke912
I've got Framework 4.0, but it doesn't help. After a parts of second, window disappear and I can't do anything with extracting models. I'm use Win 7.

Re: Mafia 2 models [pc]

Posted: Mon Nov 15, 2010 1:42 am
by DerPlaya
@shakotay: the warnings should be ok... those lines should be in the material/effects declaration which are dummy anyway.

...tested it myself (in blender). i thought those lines where offset vertices but it seems blender displays the bones like this (haven't used blender before) and it seems to be ok...

@CityPoke912: maybe you should read some of the hints about opening a command window (if you did that it would stay open and not close automatically)
here's a little trick:
- copy the Mafia2ModelDumper.exe to a folder containing sds files.
- in an explorer window hold shift -> right click the folder (containing the exe) -> choose 'command prompt here' from the context menu -> type "Mafia2ModelDumper <sdsfile>" where sdsfile is an existing file and press enter...

Re: Mafia 2 models [pc]

Posted: Mon Nov 15, 2010 8:58 pm
by CityPoke912
OK, it work, but now I can't import that. They are few errors in the Blender's console.