mdl2mesh - Neverwinter Nights model converter

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
User avatar
Marc
Gremlin
Posts: 182
Joined: Tue Jan 25, 2005 7:56 am
Location: Germany

Post by Marc »

Just to make sure: If a model doesn't work with Borundin's converter, massconvert won't convert it either because it actually relies on Borundin's script. So the Umbermodel not working wasn't surprising.

If you want trees you might want to try
http://nwvault.ign.com/View.php?view=ha ... il&id=1609
They are not animated but static trees.

This one has lots of stuff and I can confirm that it produces many correct models. However, you should leave your pc for a few hours after starting massconvert on it ...
http://nwvault.ign.com/View.php?view=Ha ... il&id=4801
User avatar
Tubez
Gremlin
Posts: 169
Joined: Fri Aug 12, 2005 7:35 pm
Location: Delft, NL

Post by Tubez »

This is very very awesome.

This gives ready access to a huge number fo models, especially because I have found the makers of the things to be very friendly and helpful if you ask them if it's ok to use them in a small non-commercial project.
What I have significantly more problems with are animations: the only viable ones seem to be the original BioWare once that are obviously gelously guarded IP.
Does anyone have alternative animations?
saetrum
Halfling
Posts: 60
Joined: Fri Oct 24, 2003 6:39 pm
x 1

Post by saetrum »

Marc wrote:Just to make sure: If a model doesn't work with Borundin's converter, massconvert won't convert it either because it actually relies on Borundin's script. So the Umbermodel not working wasn't surprising.
Agreed.
If you want trees you might want to try
http://nwvault.ign.com/View.php?view=ha ... il&id=1609
They are not animated but static trees.

This one has lots of stuff and I can confirm that it produces many correct models. However, you should leave your pc for a few hours after starting massconvert on it ...
http://nwvault.ign.com/View.php?view=Ha ... il&id=4801
Thanks for the suggestions, I'll check them out.
User avatar
Marc
Gremlin
Posts: 182
Joined: Tue Jan 25, 2005 7:56 am
Location: Germany

Post by Marc »

Tubez wrote:Does anyone have alternative animations?
No, but some models have own animations that work. That's what I wrote massconvert for. You throw a hakpak with some 1000 models towards it and still get 100 models with animations. The others get filtered.

A more or less open question is if you are allowed to publicly use those converted models. I think it's perfectly ok to use them for your own. But even making freeware stuff with it may be problematic. There are bioware tools involved in the creation of the models and nwvault is from bioware, too. Maybe you have to agree to some "use only for nvn" terms when using those bioware tools or upload it to nwvault. So maybe asking the maker of a model isn't enough? I'm not sure.

Apart from that, I found it complicated to contact the makers. E.g. in this mega-hakpak I posted earlier, there are models from a lot of modellers in it. You basically have no idea who made a particular model in such a hakpak.
User avatar
Tubez
Gremlin
Posts: 169
Joined: Fri Aug 12, 2005 7:35 pm
Location: Delft, NL

Post by Tubez »

As far as I know Maximus and nwvault have no direct affiliation with bioware. It's somehow connected to IGN or some other game review site. Also, there's some of my own work on there (scripts, not art) and I didn't have to agree to any legalese thingy when putting it up that limited the use in any way. Not to mention that if it's not presented to the user/downloader, it doesnt matter much ;)

Still, it is someone else's work and they retain copyright. While you can argue that putting it on the vault gave you an implicit license to use it in the NWN engine, you will not be able to convince anyone that this means you can use it for whatever you want.
Personal use is excepted from copyright in most legislations (which is why it's ok for me to borrow a book from the library and photocopy whole chapters, as long as i dont peddle the result), but I agree that distributing would require the author's permission and/or a license.

As far as the authors go, I agree that most "compilations" are horrendously bad about attribution. You would have to go through the smaller sets and cherry pick models.
Most of the good stuff originates from a small set of people anyway, DLA, CODI and CEP being the big ones, Lisa for clothing etc. I'm confident that if I see something I like I'll be able to track them down!
User avatar
Borundin
Platinum Sponsor
Platinum Sponsor
Posts: 243
Joined: Fri Oct 03, 2003 5:57 am
Location: Sweden
x 2

Post by Borundin »

Back to the Umberhulk problem. It was related to the appending space character bug. Anyway I have a new version of the mdl2mesh script ready that will handle these models as well as the old ones. The regression tests below were succesful:

Code: Select all

lua mdl2mesh.lua -s 50 -nobonerot -noanimpos G_Ant
lua mdl2mesh.lua -s 50 c_turtle
lua mdl2mesh.lua -s 50 c_goblinE
lua mdl2mesh.lua -s 50 c_urukb
lua mdl2mesh.lua -s 50 -noskel plc_oak101
lua mdl2mesh.lua -s 50 -noskel tcd01_a15_01
lua mdl2mesh.lua -s 50 -nobonerot -noanimpos c_slaad
lua mdl2mesh.lua -s 50 goatsbrn
lua mdl2mesh.lua -s 50 -nobonerot pig
lua mdl2mesh.lua -s 50 -noskel tzs01_s04_01
lua mdl2mesh.lua -s 50 -noskel tw010_t10_01
lua mdl2mesh.lua -s 50 -noskel c_gynosphinx_02
lua mdl2mesh.lua -s 50 -nobonerot Giant_Spider
lua mdl2mesh.lua -s 50 Umberhulk
Latest version of mdl2mesh can be downloaded here. Will soon be in anonymous ogreaddons also.
Image : Image
saetrum
Halfling
Posts: 60
Joined: Fri Oct 24, 2003 6:39 pm
x 1

Post by saetrum »

Borundin - Thank you.

This has been a great help to me, as I can't model at all. Thanks for looking at the issue I was having and fixing it.
User avatar
Borundin
Platinum Sponsor
Platinum Sponsor
Posts: 243
Joined: Fri Oct 03, 2003 5:57 am
Location: Sweden
x 2

Post by Borundin »

saetrum wrote:Borundin - Thank you.

This has been a great help to me, as I can't model at all. Thanks for looking at the issue I was having and fixing it.
Sure, no problem :)
Just frustrating that I dont have the time to fix everything right away. The converter code is kind of hard to read, also the MDL format is not fully documented which makes it a bit troublesome for me and others to fix errors.
Image : Image
spoot
Halfling
Posts: 40
Joined: Tue May 17, 2005 4:47 am

Post by spoot »

Hi,

I've used the script to convert the 400meg hakpak that someone put together and it seems to work fine. However, when I try to convert a model from the "base game" that I extracted with NWN Explorer it fails to do the conversion.

The material files are always blank.

Mesh file
<mesh>
<submeshes>
</submeshes>
<skeletonlink name="c_demon.mdl.skeleton" />
</mesh>

Skeleton file
<skeleton>
<bones>
</bones>
<bonehierarchy>
</bonehierarchy>
<animations>
</animations>
</skeleton>

Lua output
filename: c_demon.mdl
scale: 100
bonerot: 1
animpos: 1
creskel: 1
animation----->
{ }

tmp - { }

Scene hieracrchy:
{ }
Finished


Any ideas?
User avatar
Borundin
Platinum Sponsor
Platinum Sponsor
Posts: 243
Joined: Fri Oct 03, 2003 5:57 am
Location: Sweden
x 2

Post by Borundin »

Ok, thanks for the bug report!
I will look into it but it might take a few days because Im going on vacation now. The material export is still kind of crude in mdl2mesh so Im not surprised that its got a bug in there somewhere :?
Image : Image
spoot
Halfling
Posts: 40
Joined: Tue May 17, 2005 4:47 am

Post by spoot »

Sounds good, but I should've been a bit more specific in my original post. It fails on ALL of the base creature models. Which is why I'm wondering if I missed a step. :?
User avatar
Borundin
Platinum Sponsor
Platinum Sponsor
Posts: 243
Joined: Fri Oct 03, 2003 5:57 am
Location: Sweden
x 2

Post by Borundin »

Well, just tried the model in question and it converted OK including the material script. This is the material file I got:

Code: Select all

material c_demon
{
	technique
	{
		pass
		{
			alpha_rejection greater 128
			ambient 1 1 1 1
			diffuse 1 1 1 1
			specular 0.0500000007 0.0500000007 0.0500000007 1

			texture_unit
			{
				texture c_demon.tga
			}
		}
	}
}

And here is a screenshot of it in my test app: Image

Are you using an old version of the script by any chance? Be sure to download the latest version from addon projects.
[Edit] It might also be NWN Explorer doing something odd. I used nwnmdlcomp.exe to decompile the model from the data file.
Image : Image
spoot
Halfling
Posts: 40
Joined: Tue May 17, 2005 4:47 am

Post by spoot »

Thanks for looking into it......and I'll have to reluctantly admit I was being an idiot. :oops: I got it running ok now. 8)
User avatar
Martoon
Greenskin
Posts: 118
Joined: Thu May 19, 2005 7:36 pm

Post by Martoon »

First, I just want to say Thanks to Borundin and Marc for the script and mass convert tool. We're implementing a game in our Ogre-based engine that was started as a NWN mod, so we have a ton of content to convert, and these tools will be lifesavers.

I'm having a problem with massconvert. I run the bat file on a directory, and when it converts dds files to tga, it appends a "0" to the file name. For example, the mdl references a bitmap "mmc01_hrdwd01". There is in fact a "mmc01_hrdwd01.dds" file in the directory, but when it converts it to tga, it creates "mmc01_hrdwd010.tga" (note the extra "0"). Likewise, "mmc01_evil02.dds" becomes "mmc01_evil020.tga", "mmc01_plstr10.dds" becomes "mmc01_plstr100.tga", etc.

Any idea why this is happening, and how I can fix it?

Thanks!
User avatar
Marc
Gremlin
Posts: 182
Joined: Tue Jan 25, 2005 7:56 am
Location: Germany

Post by Marc »

Yeah I noted this myself like a month ago when I used that tool myself again. Strange thing is, I didn't remember to notice that problem when I posted that tool here. I tried multiple hakpaks as input ...

Well, my solution 2 weeks ago was to just rename all those files with a multirename tool. Appart from that I can remember that I changed something on the code, can't remember what the purpose was. I also didn't got the experience that anyone uses it anyways because otherwise someone would have complained earlier. But I can have a look at it if you want. It's probably just a small problem.
User avatar
Martoon
Greenskin
Posts: 118
Joined: Thu May 19, 2005 7:36 pm

Post by Martoon »

We definitely intend to use the tool. It would great if this was fixed. If you're willing to release the source, I'd be glad to look into it myself.

I could rename the files, but the problem is that the massconvert tool is discarding all of the models (if I watch the folder, I can see the output file appear, then disappear). I suspect it's discarding them because it thinks the needed textures don't exist.
User avatar
Marc
Gremlin
Posts: 182
Joined: Tue Jan 25, 2005 7:56 am
Location: Germany

Post by Marc »

I think I fixed the bug. http://rochel.s83.deinprovider.de/temp/massconvert.zip. Make sure your browser doesn't give you the old version from its cache.

I also changed something in Borudins script. There was a problem with the referencing of the skeleton from its model if the to be converted model is not in the current working dir during conversion. I also included the srccode and a readme!

Please report problems, otherwise I might not notice and never fix them. :D
User avatar
Martoon
Greenskin
Posts: 118
Joined: Thu May 19, 2005 7:36 pm

Post by Martoon »

Thanks! I'll let you know how it goes.
User avatar
Martoon
Greenskin
Posts: 118
Joined: Thu May 19, 2005 7:36 pm

Post by Martoon »

Looks like you forgot to include the lua script, so I'm using the old unmodified from before. It's ripping through a directory right now, so we'll see how it goes. So far, the .tga names look good, and it's producing a bunch of .mesh files (so it doesn't seem to be rejecting them).

Thanks again.
User avatar
Marc
Gremlin
Posts: 182
Joined: Tue Jan 25, 2005 7:56 am
Location: Germany

Post by Marc »

Oh. I uploaded it again with the lua script.
User avatar
Martoon
Greenskin
Posts: 118
Joined: Thu May 19, 2005 7:36 pm

Post by Martoon »

I've modified the script so the Ogre meshes it generates have the y-axis up (instead of z-up like NWN). This way, you don't have to rotate each model 90 degrees when you load it. I haven't tested it with animations yet (just static models), but it should be fine. The modified script can be downloaded here: http://www.jcvr.org/rabens/mdl2mesh.lua

I notice that the script doesn't handle node rotations. Most .mdl's seem to have no rotation, so it's usually not a problem, but a few of the ones I'm converting do have rotation. It looks like Borundin started to implement this, but it's incomplete (and the function call is commented out). It appears he's assuming the node rotations in the .mdl are quaternions, but I think they're actually axis and angle (someone correct me if I'm wrong).

I'm trying to decide if I should complete the script so it applies node rotations, or just convert the models that have rotations manually with an import/export. Is anyone else out there using this script anymore?
DigitalBilby
Gnoblar
Posts: 10
Joined: Fri Aug 05, 2005 11:55 am

Post by DigitalBilby »

I'm certainly thinking about it. I have something in mind and NWN style
models and scenery would be a good resource to have access to.
User avatar
Borundin
Platinum Sponsor
Platinum Sponsor
Posts: 243
Joined: Fri Oct 03, 2003 5:57 am
Location: Sweden
x 2

Post by Borundin »

Martoon wrote:I've modified the script so the Ogre meshes it generates have the y-axis up
Excellent! I know others have asked for this too so I would be happy to include this in the Mdl2mesh AddOn project if you dont mind. Since there are not that many users I think it would be alright to change the default behaviour even if it does break backward compatibility.
Martoon wrote:I notice that the script doesn't handle node rotations. Most .mdl's seem to have no rotation, so it's usually not a problem, but a few of the ones I'm converting do have rotation. It looks like Borundin started to implement this, but it's incomplete (and the function call is commented out). It appears he's assuming the node rotations in the .mdl are quaternions, but I think they're actually axis and angle (someone correct me if I'm wrong).
Yup, this confused me alot and since most models didnt have rotations I left it int this incomplete stage.
Martoon wrote:I'm trying to decide if I should complete the script so it applies node rotations, or just convert the models that have rotations manually with an import/export. Is anyone else out there using this script anymore?
I am :D
Same here, It would be great if we could include this in the main mdl2mesh project as long as you approve and have time to implement it!
Image : Image
User avatar
Martoon
Greenskin
Posts: 118
Joined: Thu May 19, 2005 7:36 pm

Post by Martoon »

Okay, the new mdl2mesh script is up (again at http://www.jcvr.org/rabens/mdl2mesh.lua).

This one handles node rotations. Again, not extensively tested (and not tested at all with animated models), but it appears to work on the set of models I've tried.

Feel free to include this with whatever you like (the addon project, etc.), and let me know if there's any problems with it.

I noticed that even with the -noskel option, the bone assignments are still exported. Does this have any overhead in the Ogre model when it's loaded?
User avatar
Marc
Gremlin
Posts: 182
Joined: Tue Jan 25, 2005 7:56 am
Location: Germany

Post by Marc »

Martoon wrote:I've modified the script so the Ogre meshes it generates have the y-axis up (instead of z-up like NWN).
Is this configurable? I always prefer z-up ...