Blender 2.68 MDB Import/Export Plugin
#26
Posté 22 novembre 2013 - 07:59
#27
Posté 22 novembre 2013 - 03:11
Modifié par rjshae, 22 novembre 2013 - 06:52 .
#28
Posté 22 novembre 2013 - 04:29
Walkmeshes (WALK):
Walk meshes seem to control where you can walk and where you cannot. Some vertices have unusual values like -1,000,000 to indicate a link to other walk meshes or perhaps non-navigable terrain. In Max, you probably want to use Quad/Tri Patches to create these.
Material IDS (Source: Jason Keeney of Obisidan)
MTL DEC HEX Name
---- ---- ----- --------
1 0 0x0000 no walk
2 9 0x0009 dirt
3 17 0x0011 grass
4 33 0x0021 stone
5 65 0x0041 wood
6 129 0x0081 carpet
7 257 0x0101 metal
8 513 0x0201 swamp
9 1025 0x0401 mud
10 2049 0x0801 leaves
11 4097 0x1001 water
12 8193 0x2001 puddles
I have remapped the material ids since max does not support values greater than 1000. For backward compatibility, if the name starts with "0x" then the old mechanism is used else I just use the values above
Modifié par -Semper-, 22 novembre 2013 - 04:30 .
#29
Posté 22 novembre 2013 - 06:09
Yeah, I haven't been able to get it figured out.rjshae wrote...
Oops, it looks like they moved the Batch Naming script to here.
You're supposed to be able to install it by selecting User Preferences (under File) then 'Install from File...'. But it is not showing up in the selection list. Maybe there's something wrong with the bl_info in the script?
#30
Posté 22 novembre 2013 - 06:57
-Semper- wrote...
guess those other bits are for the different materials so that the engine knows which stepping sounds to play. in 3dsmax that's handled through a walkmesh material. details are from tazpn's tools:Walkmeshes (WALK):
Walk meshes seem to control where you can walk and where you cannot. Some vertices have unusual values like -1,000,000 to indicate a link to other walk meshes or perhaps non-navigable terrain. In Max, you probably want to use Quad/Tri Patches to create these.
Material IDS (Source: Jason Keeney of Obisidan)
MTL DEC HEX Name
---- ---- ----- --------
1 0 0x0000 no walk
2 9 0x0009 dirt
3 17 0x0011 grass
4 33 0x0021 stone
5 65 0x0041 wood
6 129 0x0081 carpet
7 257 0x0101 metal
8 513 0x0201 swamp
9 1025 0x0401 mud
10 2049 0x0801 leaves
11 4097 0x1001 water
12 8193 0x2001 puddles
I have remapped the material ids since max does not support values greater than 1000. For backward compatibility, if the name starts with "0x" then the old mechanism is used else I just use the values above
I'm not sure it's the same for the MDL and MDB files. The MDL models I've looked at thus far have 3 = Grass, 4 = Stone, and 7 = Unwalkable.
kamal_ wrote...
Yeah, I haven't been able to get it figured out.rjshae wrote...
Oops, it looks like they moved the Batch Naming script to here.
You're
supposed to be able to install it by selecting User Preferences (under
File) then 'Install from File...'. But it is not showing up in the
selection list. Maybe there's something wrong with the bl_info in the
script?
I think I have it loaded now. This seemed to work:
- In Blender, select 'User Preferences' under the File menu
- Select 'Install from File...', navigate to the file, then pick it and click on the 'Install from File' button
- There should be a grayed out entry in the list: '3D View: Item Panel'
- Click on the small check box to activate then Save User Preferences and close
- In the 3D view, click on the View menu and toggle Properties
- There should be a little car icon at the bottom of the Properties panel
Modifié par rjshae, 23 novembre 2013 - 05:33 .
#31
Posté 22 novembre 2013 - 11:14
Hmmm.... stuck at step 5. I don't see anything like properties under the view menu.rjshae wrote...
[*]In Blender, select 'User Preferences' under the File menu
[*]Select 'Install from File...', navigate to the file, then pick it and click on the 'Install from File' button[*]There should be a grayed out entry in the list: '3D View: Item Panel'[*]Click on the small check box to activate then Save User Preferences and close[*]In the 3D view, click on the View menu and toggle Properties[*]There should be a little car icon at the bottom of the Properties panel[/list]
https://dl.dropboxus...nity/step_4.jpg
https://dl.dropboxus...nity/step_5.jpg
#32
Posté 23 novembre 2013 - 12:47
#33
Posté 23 novembre 2013 - 01:08
ok got it. The author said that support for texture renaming was coming, but it looks like it was never added. It did rename all the parts of the test tile correctly so it's still useful.rjshae wrote...
You'll want to use the View menu down in the lower left, below the 3D frame and left of 'Select' in your pic. The hot key listed is 'n'.
The Blender ui is horribad.
#34
Posté 23 novembre 2013 - 01:45
kamal_ wrote...
The Blender ui is horribad.
Heh, no argument there.
It's probably possible to batch modify the texture names using the Python scripting interface directly. Not sure whether you want to go there...
Modifié par rjshae, 23 novembre 2013 - 02:00 .
#35
Posté 23 novembre 2013 - 01:51
Here I'm trying it out on a few more imported NWN models:

Not quite sure what went wrong with the desk, but I did confirm that the coordinates are the same as in the MDL file so the import is working as it should. Perhaps there's an issue with the de-compiler I used (NWN Carottes)? Shrug.
Anyway, I think I'll call this feature done for now.
#36
Posté 23 novembre 2013 - 02:44
Ideally what I'd want to do is loop through all .mdb files in a folder and do a search/replace or prepend on the texture name. For example the codi sigil tileset had really generic texture names that would very likely result in duplicate texture names if used in a large pack (the floor texture is "floor.dds" for example). I used ReNamer to rename all the textures to codi_xxxxx so there would be unique texture names for the tileset. Doing that requires that all the .mdb's have each texture in them switched to the new codi_xxxx standard. Doing that manually is possible, but time consuming.rjshae wrote...
kamal_ wrote...
The Blender ui is horribad.
Heh, no argument there.
It's probably possible to batch modify the texture names using the Python scripting interface directly. Not sure whether you want to go there...
I don't care if I have to open them in Blender/Gmax whatever. Doing a whole folder at a time via command line would actually be perfect, preferable to opening each individually in Blender or Gmax and doing them one at a time that way.
For some tilesets, I also need to rename model parts because I've made "original texture" and "retexturable" versions of the tileset. Gmax lets me do this fairly quickly even though it's done manually. Per Hellfire, two models should not have the same part names.
#37
Posté 23 novembre 2013 - 03:47
Modifié par rjshae, 23 novembre 2013 - 12:06 .
#38
Posté 23 novembre 2013 - 02:36
For the record, here are the (NWN) MDL aabb material codes I've found thus far:
1 -- Sand
2 -- (Vertical stone: unwalkable)
3 -- Grass
4 -- Stone
5 -- Wood
6 -- Shallow Water
7 -- Unwalkable
9 -- Carpet
10 -- Metal (grating)
15 -- Lava
17 -- Deep water
19 -- Snow
#39
Posté 23 novembre 2013 - 02:58
This is what gmax reports, taken from a cave tilerjshae wrote...
I don't suppose that anybody knows if NWN2 has an undocumented walk mesh material type for snow?
For the record, here are the (NWN) MDL aabb material codes I've found thus far:
1 -- Sand
2 -- (Vertical stone: unwalkable)
3 -- Grass
4 -- Stone
5 -- Wood
6 -- Shallow Water
7 -- Unwalkable
9 -- Carpet
10 -- Metal (grating)
15 -- Lava
17 -- Deep water
19 -- Snow
https://dl.dropboxus.../walk_codes.jpg
The CODI-Sigil tileset, which was imported from nwn1, has the same set. In going through the tilesets for my project I've never seen anything higher than the (12)WalkPuddles.
#40
Posté 23 novembre 2013 - 03:38
The Material types for snow in terrainmaterials.2da just maps to Stone. I wonder if the Material column in terrainmaterials.2da maps to triplets of columns in footstepsounds.2da? Not sure where the codes in the Sound column of surfacemat.2da gets mapped to step sounds.
Modifié par rjshae, 23 novembre 2013 - 03:46 .
#41
Posté 23 novembre 2013 - 04:08
I would guess that they do map. At least in external areas, the game plays sounds by predominant ground texture (I tested this awhile back for some reason). It would be straightforward if you wanted to test to change the material references for snow in terrainmaterialsrjshae wrote...
Thanks. I found surfacemat.2da, which lists the same surface materials. I'm curious whether adding to that file would cause the system to recognize new materials (and associated sound sets) in the walkmesh? Maybe the Sound codes in surfacemat.2da map to columns in the footstepsounds.2da file? It'd be nice to be able to use the crunchy snow sounds in a tileset or placeable. The Material types for snow in terrainmaterials.2da just maps to Stone.
The confusing thing is there's multiple columns for each terrain type in the footstepsounds.
#42
Posté 23 novembre 2013 - 04:12
In NwN1, the aurora base for creature models stores event information, including footstep (and detonation =). This way the footstep event is tied to the appropriate "step" frame of the animation. If you want to hear a footstep, the appearance model has to have footstep events in the anims.
The sound is then looked up in footstepsounds.2da referencing the two-letter sound type in surfacemat.2da.
The sounds are (I think) randomly cycled through the three variations in footstepsounds.2da
<...stories>
#43
Posté 23 novembre 2013 - 04:21
rjshae wrote...
The Material types for snow in terrainmaterials.2da just maps to Stone. I wonder if the Material column in terrainmaterials.2da maps to triplets of columns in footstepsounds.2da? Not sure where the codes in the Sound column of surfacemat.2da gets mapped to step sounds.
i guess that terrainmaterials.2da and surfacemat.2da both map to footstepsounds.2da. obsidian specifically created terrainmaterials because they upgraded the aurora engine and integrated outdoor areas where no walkmesh is created by hand in a 3rd party app. long story short: terrainmaterials is to map sounds to painted textures in outdoor areas and surfacemat is for placeables and tiles with a walk mesh material.
those triple columns are just there for variation. btw there're still footstep sounds for snow. it's shouldn't be hard to reactivate them.
#44
Posté 24 novembre 2013 - 05:57
I also tried a modified placeable with a walk mesh that has its material bit flags set to 0x00004001, but that just silenced the footsteps. It looks like the bit flag check was never added to the code... unfortunately.
Hmm, but maybe there's a use for silent steps... like walking in air?
#45
Posté 24 novembre 2013 - 06:51
- Added import/export of HAIR objects, using the material component index of the brown-hued base face to set the Hair Shortening Behavior flag.
- Included import/export of HELM objects, using the material component index of the violet-hued base face to set the Helm Hair Hiding Behavior flag.
- As imported SKIN packets are always given an ARMATURE modifier, the export code will now check for that modifier to see if an object should be exported as a SKIN packet. The option to export as a SKIN has thus been rendered unnecessary.
- Added a white-hued vertical face on the HOOK mesh to represent the default door position, so it is easier to position correctly.
- Used the material's use_shadows setting to preserve the No_Cast_Shadows texture flag for individual RIGD objects.
- Added a parameter to the import panel that allows you to enter a new Model title. This name will be globally substituted into the object and material names. It replaces any prefixes that match the file name, ignoring upper or lower case lettering in the process.
- Added a parameter to the Import/Export panels to set the minimum Z-coordinate for imported WALK meshes. This allows the special imported Z-values set at -1000000 to be raised for ease of editing, then lowered again on export.
- Modified the names of the import and export controls to make their roles clearer.
- Fixed a problem where a hair model failed to export if 'Mesh is a Head' wasn't selected on import.
- Implemented the ability to import Neverwinter Night .MDL files that are in ASCII format. Converting face-based texture mapping to vertex-based can result in some of the textures appearing stretched. For best results, the texture mapping should be reworked prior to export.
- Added a walk mesh type for an unimplemented material bit flag (0x00004001), which makes steps silent while walking over it. This might have a few specialized uses.
I've added a brief tutorial on importing .MDL files with this version of the plug-in.
Modifié par rjshae, 24 novembre 2013 - 08:15 .
#46
Posté 25 novembre 2013 - 03:40
Anyway, I figured out how to fix it.
#47
Posté 26 novembre 2013 - 05:18

This model was imported from a pair of NWN MDL files into blender, reworked to give it a slight arch and end caps, retextured, then exported back out to .mdb. I'm not completely happy with the texturing or normal maps, but I think it turned out okay. The cobble stones are tintable.
Something odd happens when I use it though. At the edges, right where I enter the cobble stones, the camera suddenly dips down to a closeup. It goes back to normal after a couple more steps. Very wierd. I've tried tweaking the model and the walk mesh, but nothing helps. It all seems to bake normally.
Modifié par rjshae, 26 novembre 2013 - 06:07 .
#48
Posté 26 novembre 2013 - 06:37
PJ
#49
Posté 26 novembre 2013 - 06:47
Someone around here knows what causes that to happen. They told me once, and it seems like it was something easily fixable. I hope whoever it was speaks up again, because I seem to have forgotten what it was.rjshae wrote...
Something odd happens when I use it though. At the edges, right where I enter the cobble stones, the camera suddenly dips down to a closeup. It goes back to normal after a couple more steps. Very wierd. I've tried tweaking the model and the walk mesh, but nothing helps. It all seems to bake normally.
I like structures that look like they've been in the world for a while. Most of the stock placeables are very clean.
#50
Posté 26 novembre 2013 - 07:07
About your camera problem, are you sure there are no collision mesh somewhere ?
Modifié par Calister68, 26 novembre 2013 - 07:08 .





Retour en haut







