Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Dragon Age 2 (PC)

Post questions about game models here, or help out others!
figuresculptor
beginner
Posts: 33
Joined: Thu Jan 06, 2011 9:08 pm
Been thanked: 4 times

Re: Dragon Age 2 (PC)

Post by figuresculptor »

Szkaradek123 wrote:Blender249 armature importer for .mmh files from Dragon age 2.
Awesome work! This script works beautifully!

I hope you don't mind if I add this functionality to the 2.5.x mesh import script in the thread. I'll make sure to give you full credit, I just find it hard to work in 2.49 these days after having jumped to 2.5 full time quite a while ago.
Szkaradek123
mega-veteran
mega-veteran
Posts: 292
Joined: Wed May 05, 2010 8:21 pm
Location: Poland Głogów
Has thanked: 21 times
Been thanked: 742 times

Re: Dragon Age 2 (PC)

Post by Szkaradek123 »

Update for importer:
- add import geometry with weighting and uv-mapping (*.msh)
You do not have the required permissions to view the files attached to this post.
User avatar
Tosyk
double-veteran
double-veteran
Posts: 1027
Joined: Thu Oct 22, 2009 10:24 am
Location: Russia, Siberia
Has thanked: 269 times
Been thanked: 154 times
Contact:

Re: Dragon Age 2 (PC)

Post by Tosyk »

Subject: Dragon Age 2 (PC)
Szkaradek123 wrote:Update for importer:
- add import geometry with weighting and uv-mapping (*.msh)
thanks Szkaradek123, and also thanks figuresculptor for your researches, but blender 2.49b is more native for me.
Thank you for all you do here
my blog | my forum
Erik24
ultra-n00b
Posts: 2
Joined: Sat Jan 22, 2011 12:23 am

Re: Dragon Age 2 (PC)

Post by Erik24 »

update 3d max script?
fonglee
ultra-n00b
Posts: 1
Joined: Sat Apr 02, 2011 8:08 pm
Has thanked: 1 time

Re: Dragon Age 2 (PC)

Post by fonglee »

Thanks very much for the importer script, it works perfectly :D but is there any chance you can make an exporter or replacer? The reason I ask is simple, I wish to mod the meshes for use in game, and while the importer will make modding the mesh possible, I have no way currently to put them back into the game. :eek:

Edit: never mind my question about an exporter, just read the rest of the pages and see that you guys are working on it already...my bad... :scaredy:
CountVirgo
ultra-n00b
Posts: 4
Joined: Sat Apr 02, 2011 11:19 pm

Re: Dragon Age 2 (PC)

Post by CountVirgo »

Apologies for what is undoubtedly a noobish question (I have only been playing about with Blender for a week or so now), however I would much appreciate it if someone could answer it :)

I have quite happily managed to extract the .msh files, and then import them into blender using figuresculptor's script and am trying to do exactly the same thing as in that post (import the msh & texture the Desire Demon).

Importing the .msh went just fine (as shown below), my problem is I can not work out how to add the .dds texture to the mesh.
I have googled it (adding the dds to a blender mesh) to no avail... so would much appreciate some pointers (or a link to a tutorial if there is one)!

Thanks in advance :)

Edit: I am using Blender 2.56 Beta.
You do not have the required permissions to view the files attached to this post.
daywalker03
ultra-n00b
Posts: 3
Joined: Sun Apr 03, 2011 1:13 am
Contact:

Re: Dragon Age 2 (PC)

Post by daywalker03 »

chrrox: I see you've got the import script mostly working; the only thing that would be nice is a way to scale it up to a manageable working size. Any progress on an export converter for this?
figuresculptor
beginner
Posts: 33
Joined: Thu Jan 06, 2011 9:08 pm
Been thanked: 4 times

Re: Dragon Age 2 (PC)

Post by figuresculptor »

CountVirgo wrote:Importing the .msh went just fine (as shown below), my problem is I can not work out how to add the .dds texture to the mesh.
I have googled it (adding the dds to a blender mesh) to no avail... so would much appreciate some pointers (or a link to a tutorial if there is one)!
Okay, so, yeah. This is not exactly a straightforward process. A week with Blender is just enough time to get frustrated :) You might want to look at Szkaradek123's script. It works with the older Blender 2.49b, but it does import the textures and armature, not just the mesh, and once you've imported and saved, you can open the file in Blender 2.56 no problem.

If you're feeling brave, the way you add textures is as follows:

1) Right-click on the object to select it and and hit tab to go into edit mode (tab - so it's showing vertices)
2) In the properties view, select the material tab (fourth from the right, icon is a checkered sphere):
Screen shot 2011-04-02 at 9.10.30 PM.png
3) There should be at least one material. Each one will correspond to parts of the model that use the same tetxure map(s). So, for example, the head might have two textures, one for the eyes and one for the rest of the head. Select one and hit the "Select" button on the material tab. This should select all of the vertices and give you an idea about which texture you should be using. If there's only one (which is true for most bodies), you could have just pressed the A key to select all the vertices, but wanted you to see the materials tab - this is where you specify base color, shininess (specularity), transparency, etc.
4) Now, click the texture tab (third from the right, icon is a checkered square. There should be a list of textures with red checkerboards with no names. Those are the textures for the currently selected material, and if they have no name, they're just an empty slot waiting for a texture. The material and texture tabs work together - the texture changes here affect the currently selected material in the materials tab.
5) Single-click the top empty item in the list of textures and then click the "+ New" button to create a new texture. Optionally, you might want to rename the newly created Texture from "Texture" to "Diffuse" because this texture channel is going to hold our diffuse texture (the main texture with colors)
6) Change the Type of the new Texture from "Clouds" to "Image or Movie"
7) Look down for the section called Image, and hit the "Open" button. Find the appropriate .dds file in your file system and select it. In your case, you want cn_bdy_suca_0d.dds for the body.
8) After you select the image, it should add some new fields to the Image section. Look for a checkbox called "Premultiply" and check-it. DA2 maps that use alpha use premultiplied alpha, so you need to select this for things like hair to look right.
9) In the Image Sampling section, make sure under Alpha:, the "Use" checkbox is checked. If not, check it. Not all textures in DA2 use alpha, but many do, and I believe the Desire Demon is one that does.
10) Go down further to the Mapping section (click the disclosure triangle if it's not visible) and change the Coordinates from "Generated" to "UV", then in the new Layer field that comes up, click and select UVTex (or whatever it's called - there should only be one UV coordinate layer)

Now you've got the base texture added. If you add some lights and setup the camera, you should be able to render. Switching your 3D view to "textured" mode probably won't show this new texture, however - this is for the rendered object, there's actually a different place to set it up, which I'll identify in a moment, but I'll tell you how to add the normal map to get the fine details first

Unfortunately, Dragon Age 2 uses byte-swapped normal maps. There's source code earlier in this thread that will create a program to process a normal map. The normal map in your case is cn_bdy_suca_0n.dds for the body (n for normal, see how that works?) The conversion sript works on .png images. So, you need to convert from .dds to .png (You can open it in Blender and save as a PNG), then byte swap the png with the program, which will create a purple tangent-space normal map out of the byte-swapped gold normal map from the game. You don't have to convert back to dds for Blender, it's happy to use png images.

Once you've converted to a purple tangent-space normal map, you select the second texture in the list (the first empty one) and repeat the steps above, only selecting the normal map. Then, there's a few extra steps you have to take to tell Blender this is a normal map, not a diffuse map, including

1) Under the Image Sampling section, click "Normal Map" and make sure "Tangent" is selected.
2) Scroll down to the "Influence" section. Unclick the "Color" checkbox under the Diffuse: section and then and click the "Normal" checkbox under the Geometry section.

Now your renders should pick up some of the fine details like wrinkles and folds.

DA2 files commonly have several other types of image maps. You don't need them, but they'll give extra oomph. The cn_body_suca_0s.dds is a specularity map. It defines what parts of the model reflect more light. This will make jewelry and weapons reflect light from your light sources more realistically. The process for adding a specularity map is the same as the diffuse texture, except uncheck "Color" in the "Influence" section and check "Intensity" and "Color" under the Specular: section.

I'm not 100% sure what the other two are. I think the one that ends in "e" (cn_body_suca_0s.dds) is an emission map - it defines parts of the model that actually emit light. If I'm right about this (and I'm not sure I am), it would be used for things like glowing eyes.

I have no idea what the map that ends in "t" is (cn_body_suca_0t.dds). It seems to hold some kind of pattern (a checkerboard in the case of the desire demon) and I honestly haven't a clue what it's for.

Finally, if you want the texture to show up when displaying the 3D view in Textured mode, you'll need to convert one of the panes (not the 3D view) into a UV/Image editor. If the selected object is in Edit mode and there are vertices selected, you should see a graphical representation of the UV coordinates in the UV/Image editor. Now, in the bottom of the UI/Image editor, look for the "+ New" button, but don't press it. Instead, hit the little image icon right to the left of it and select cn_body_suca_0d.dds. That should overlay your UV coordinates over the diffuse texture. Now the textured mode should work. Textured mode doesn't work well with multi-texture models. I rarely work in texture mode anyway.

Hope that helps.
You do not have the required permissions to view the files attached to this post.
daywalker03
ultra-n00b
Posts: 3
Joined: Sun Apr 03, 2011 1:13 am
Contact:

Re: Dragon Age 2 (PC)

Post by daywalker03 »

figuresculpter: the *_t.dds files are tint maps, which determine if a given model can have its color changed when used as a base model for an item.
lpss
ultra-n00b
Posts: 5
Joined: Sat Apr 02, 2011 4:51 pm

Re: Dragon Age 2 (PC)

Post by lpss »

I can't seem to export the hair and beard meshes with the UV maps. Is there any workaround for this?
CountVirgo
ultra-n00b
Posts: 4
Joined: Sat Apr 02, 2011 11:19 pm

Re: Dragon Age 2 (PC)

Post by CountVirgo »

figuresculptor - Thank you for the reply, very much appreciated :)

As for using Szkaradek123's script, I tried that and imported the MSH/MMH just fine but could not figure out the texture part, I selected the directory, clicked re-load textures and it didn't seem to do anything - I really dislike Blender 2.49b's GUI too, so i'll probably just stick with doing it the long way for now :P
figuresculptor
beginner
Posts: 33
Joined: Thu Jan 06, 2011 9:08 pm
Been thanked: 4 times

Re: Dragon Age 2 (PC)

Post by figuresculptor »

CountVirgo wrote:figuresculptor - Thank you for the reply, very much appreciated :)
You're welcome.
CountVirgo wrote:I really dislike Blender 2.49b's GUI too, so i'll probably just stick with doing it the long way for now :P
yeah, I feel the same way, but I've been using Blender long enough that it's not really an issue for me. I remember what it's like trying to learn this beast, though, so thought I'd make the suggestion.
CountVirgo
ultra-n00b
Posts: 4
Joined: Sat Apr 02, 2011 11:19 pm

Re: Dragon Age 2 (PC)

Post by CountVirgo »

figuresculptor - I'm so close now, it's just the last step that has me stumped.

Everything else has gone fine, I've selected the object, gone into edit mode, added the Diffuse and Normal maps (thanks for the Normal map converter too!) go to the UV/Image Editor, select the cn_bdy_0d.dds file, and the selected vertices look like they are a flipped version of the Diffuse map.

Any idea where I went wrong? I've attached a picture to show what I mean.
Also this is is a zipped version of my .blend file if you want to take a look yourself.
You do not have the required permissions to view the files attached to this post.
figuresculptor
beginner
Posts: 33
Joined: Thu Jan 06, 2011 9:08 pm
Been thanked: 4 times

Re: Dragon Age 2 (PC)

Post by figuresculptor »

CountVirgo wrote:Any idea where I went wrong? I've attached a picture to show what I mean.
Also this is is a zipped version of my .blend file if you want to take a look yourself.
Oh, my bad - I forgot that the UV coordinates are flipped on the Y axis. In the UV Image editor, under the UV file menu, look for the Mirror option, and the "Y Axis" suboption (I'm not at my computer, so can't verify the exact names). That will flip the UVs on the Y axis. You might need to tweak them a tiny bit once you flips them, but mirroring on the Y should take care of 99% of the problem.
CountVirgo
ultra-n00b
Posts: 4
Joined: Sat Apr 02, 2011 11:19 pm

Re: Dragon Age 2 (PC)

Post by CountVirgo »

figuresculptor wrote:Oh, my bad - I forgot that the UV coordinates are flipped on the Y axis. In the UV Image editor, under the UV file menu, look for the Mirror option, and the "Y Axis" suboption (I'm not at my computer, so can't verify the exact names). That will flip the UVs on the Y axis. You might need to tweak them a tiny bit once you flips them, but mirroring on the Y should take care of 99% of the problem.
Great, got it - Thanks.

In case any other Blender noobs have been following this and do not understand the last bit:

1) Select Mesh in 3D mode (right click) press Tab to enter Edit mode.
2) Switch to the UV/Image Editor
3) Press A to select all.
4) UVs -> Mirror -> Click "Y Axis", the UV coordinates will be flipped.
5) Click the button just to the left of + New (it has a picture of an image on it)
6) Select the Diffusion map (the one ending in _0d.dds)
7) Switch back to 3D View
8) Press Tab to deselect the mesh
9) Change viewport shading to Textured
10) Enjoy the fully textured model!

:)
Post Reply