Anyone interested in adding a NIF mesh loader to Irrlicht? There is already some code done. The NIF format is used by games like Morrowind and City of Heroes.
There is a very good (if i might say so) importer and exporter for Blender 2.4 here:
http://niftools.sourceforge.net/
http://sourceforge.net/project/screensh ... ssid=19981
With some extra tools:
http://sourceforge.net/project/screensh ... _id=149157
And a C++ library to load/save files in the NIF format:
http://niftools.sourceforge.net/niflib_doc/
All the files can be doanloaded from here:
http://sourceforge.net/project/showfile ... _id=149157
If you want to extract files from Morrowind to test this stuff you will need a tool ti unpack Morrowind BSA archive:
http://www.thelys.org/mods/BSA%20Browser%200.5.zip
Then another tool to batch convert .dds images to .jpg or .tga for blender:
http://eliteforce2.filefront.com/file/D ... rter;29412
NIF mesh loader ?
-
Eternl Knight
- Posts: 313
- Joined: Tue Nov 01, 2005 5:01 am
Unless the file format has been PATENTED, there can be no legal issues using the format. And only really big companies bother patenting file formats (because the enforcability of such patents is highly questionable and hence you need good/expensive lawyers should you sue). And given the fact that there are already plugins for other apps, I highly doubt that there is a problem.
On the other hand - I do not know of any extra benefits in using the NIF file format other than perhaps the fact that one could use Morrowind/City of Heroes meshes (running into copyright issues).
--EK
On the other hand - I do not know of any extra benefits in using the NIF file format other than perhaps the fact that one could use Morrowind/City of Heroes meshes (running into copyright issues).
--EK
The maximum point count is 65k. Is about all I can find about the format. It would allow using meshes from any game that uses the NetImmerse engine or the Gamebryo engine, such as Irrational Games' Freedom Force, Oddworld Inhabitants' Munch's Oddysee, Totally Games' Star Trek Bridge Commander, AniVision's Net Race Live, Mythic Entertainment's Dark Age of Camelot, and Headfirst Productions' Simon the Sorcerer 3D and Call of Cthulhu to just name a few.
-
Eternl Knight
- Posts: 313
- Joined: Tue Nov 01, 2005 5:01 am
RE: Using other game models...
That is all well and good for when you are playing around with a tech demo you never intend to leave your little clique of friends, but as soon as you intend to show more people than that - you need to create your own models.
Which, of course, begs the question - why NIF? Note, I have no hassles with the file format - I simply don't know enough about it other than the fact it is used by the afore mentioned games!
--EK
That is all well and good for when you are playing around with a tech demo you never intend to leave your little clique of friends, but as soon as you intend to show more people than that - you need to create your own models.
Which, of course, begs the question - why NIF? Note, I have no hassles with the file format - I simply don't know enough about it other than the fact it is used by the afore mentioned games!
--EK
The blender exporter lets you do several types of animations. Normal keyframed animation with or without using bones and the new Blender envelop stuff.afecelis wrote:morrowind fan?![]()
what advantages does the NIF format offer? Is it a format for animated characters? Would there be any legal problems for using this format?
Check their tutorials here:
http://niftools.sourceforge.net/tutorial/blender/
About the advantages of this loader and to be honest i think this is the best documented importer/exporter and the one with best plugins for the major moding tools.
Plus they also made several cool helping tools. There are tons of games that use nif so you can easly find other fan made tools to work with this format.
This is part of the readme.html text that comes with the blender script:
---------------------------------------------------------------------------------
Release Notes
* The import & export scripts have been updated for Blender 2.40. You should remove any old versions of the scripts prior to installing these scripts (the old files are nif4_export.py, nif4_import_237.py, nif4.py, and nif4.pyc).
* Also, note that scripts under Blender 2.40 use Python 2.4; if you don't have it installed, grab it from http://www.python.org. (Python 2.3 and 2.4 can live peacefully together.)
* The old exporter GUI has been dropped... in favor of Blender's native Script Config GUI. To change the exporter settings, go to the scripts window in Blender, and select Scripts->System->Scripts Config Editor->Export.
Highlights
* Exporter support for skinning (armatures, bones, and vertex weights). Armature & bone animation is exported as well.
* Exporter support for texture flipping, both base and glow textures.
* Exporter should support NIF versions up to 4.2.2.0 (4.0.0.2, 4.1.0.12, 4.2.1.0, and 4.2.2.0), however, THIS HAS NOT BEEN TESTED EXTENSIVELY; if you want, you can try to write a 4.2.2.0 NIF file by setting "nif version" to 4.2.2.0 in the config editor (both Civilization IV and Dark Age of Camelot support this version). Bug reports regarding this new feature are highly appreciated!
* Various bugs have been fixed in the importer.
In the background...
Support for NIF versions >= 10.x.x.x comes closer. This means that in the short future we will be able to fully support many more games, most notably full import support for Civilization IV and Dark Age of Camelot. This is an on-going effort, and the NifTools devteam is especially grateful to the Civ modding community for the enthusiastic support we have recieved so far. Your patience will be rewarded!
The importer is currently being recoded to make use of Niflib as well, so keep an eye out for updates. We're working on full skinning support for the importer as well.
Exporter Notes
Main author: Amorilia
Thanks to...
* Brandano, for the import script, which helped a lot writing this export script
* Taharez, for helping with the Python NIF library, and NIF specs
* Brick, for NIF specs
* Shon, for Niflib, NIF specs, and explaining things about skinning and programming
* y67_a, for pointing out the fact that the script forgot to export normals; and thereby opening the path to smoothing support
* m4444x, for NifSkope, non-textured object support, optimizing the main loop in the trishapedata export, animation group support, vertex color support, and texture flipping support
Usage
* create meshes (and empties, if you like) in blender:
o IMPORTANT: if you wish to animate meshes without using armatures and bones, then, when grouping, always make parent without inverse (in Object Mode, use CTRL-SHIFT-P)
* create armatures and bones for animation
o either edit bone envelopes, and parent your meshes to armatures with vertex groups; the vertex weights will be constructed using the bone envelopes
o or, simply parent meshes to bones (armature must be in pose mode)
o insert pose mode keys in different frames (press I to insert key, and select Rot, Loc, or LocRot) to compose your animation
* create UV coordinates (be sure to check the blender manual for more details)
o create seams (3D View, Edit Mode, select seam vertices, CTRL-E)
o in the 3D View, UV Face Select Mode, select all faces, press U->LSCM
o (optional) if you want to create your own texture: in the UV/Image Editor, UVs->Save UV Face Layout, and process the saved texture with your favorite 2D paint program
* add materials to your meshes, and add one texture to each material, with the following settings:
o texture map input: UV
o texture map output: COL for diffuse map (base texture)
* for each texture:
o set texture type to 'Image'
o either load a texture from 'C:\MORROWIND\textures', or put your custom texture in the 'C:\Program Files\Morrowind\Data Files\Textures' folder, and load it from there. Note that Blender does not read .dds files.
* (optional) animate meshes and/or empty objects (press I to insert key, and select Rot, Loc, or LocRot; for now, only location and rotation channels are exported); define the animation groups in a text buffer called 'Anim' (check source code for an example)
* (optional) to export vertex colors, turn on the VCOL_PAINT flag in the material tab
* (optional) Hull your model in a simple so-called collision mesh, which defines where the player cannot walk through (most of Morrowind's static models have a collision mesh, you can see them in the TES CS pressing F4 in the render window). You may want to create it to speed up collision detection, to help the player walk over objects such as stairs, or to allow the player to walk through certain parts of your model such as spider webs.
o create a mesh called 'RootCollisionNode' (object name, not datablock name)
o don't apply any material to it
* (optional) if you suspect that some of the faces of your meshes are not convex, then you should let blender triangulate these meshes (press CTRL-T in edit mode with all vertices selected), because in that case, Blender's triangulation algorithm is less error prone than the triangulation algorithm used in this script.
* select the models that you wish to export, and run this script from the 'File->Export' menu. Note that the script looks for unparented parents of the selected objects, and exports these root objects along with all of their children, so you don't have to select the whole model.
Notes
...
.......................................................................................................
-
dhenton9000
- Posts: 395
- Joined: Fri Apr 08, 2005 8:46 pm
At this moment, there is no 2.4 .x export , and .x under 2.37 blender doesn't do keyframes.
The tricky thing for using this in irrlicht is writing an animator similar to the one for .x files. Its not going to be just a loader, but an animator as well. It would have to be part of the engine, not a plug-in loader.
The tricky thing for using this in irrlicht is writing an animator similar to the one for .x files. Its not going to be just a loader, but an animator as well. It would have to be part of the engine, not a plug-in loader.