To begin, create your desired morph in the toolset's morph editor. You pretty much have free reign here, but as I found out in my initial experiments, you don't want to go too extreme for certain features, lest your head not animate well. Also, don't worry about hair, eye colour, etc. All that you need to focus on for now is the physical face shape. If you decide you absolutely must have a beard, that will require a separate step later at the hair stage, so just focus on getting your face to fit the beard you want and note down the model name of it for later.
Once you have the settings to your liking, save out the morph as an MRH as per usual. The name is unimportant, but remember that you must replace spaces with underscores. Now we need to export the morph. First, look for the XML button on the toolbar and activate it. This will export the morph as an XML file instead of the usual game-ready GFF-based MOR. Now right click and choose Post to local to export. Refer to this picture of my Leno-esque test subject:

If you get an error, make sure you don't have spaces or other inappropriate characters in your filename. If so, re-save your MRH with a proper name and try again. Once the export is finished, you can close the toolset. Go to My Documents\\BioWare\\Dragon Age\\AddIns\\<MODULE NAME>\\core\\override\\toolsetexport\\ and you should see a file called XY_<MRH filename>.mor.xml, where X is the species and Y the sex of your morph (in my example, EM for Elf male - em_morph_2_mesh_test.mor.xml). Grab it from there and move it to a suitable working directory. Make it somewhere easy to find, as this will be used a lot. Leave the morph for now - we'll come back to it shortly.
Now we need to get our donor head files. Open DATool. Strictly speaking DATool isn't required, it just expedites the process, so I'll be using herein. You can extract the required files manually if so desired. Go to the Elf male section:

Scroll right to the end (hold CTRL + right arrow) to the base head model em_uhm_bas_0. This is the base model that all the morph targets (the extremes you are blending between in the morph editor) for this race/sex are derived from. This is the key to this process, as the resultant morph is essentially just an edited version of this head, thus it has identical geometry. Now export this model:

You can now close DATool. Now we need to convert this model into an XML file. For this purpose I am going to assume you are using Max/GMax and Eshme's import/export script. This may be possible using Blender or Lightwave using their respective scripts, but I'll leave that for others to explore. Import the model using Eshme's script as per usual. It will complain about missing textures and ask if you want to select them manually - just choose no. You should end up with something like this:

Without making any modifications we want to export this model. You can name it whatever you like - I called it em_uhm_basa_0_ORIGINAL. Once the export is finished you can reset/close Max/GMax. Now you need to navigate to the DATools folder in your system temporary directory. For Vista/Windows 7 this should be C:\\Users\\<USER NAME>\\AppData\\Local\\Temp\\DAOTools\\ and for XP it should be C:\\Documents and Settings\\<USER NAME>\\Local Settings\\Temp\\DAOTools\\. Here, depending on how much you have used the script and how long it is since you cleaned out your system's temp files, you should see a bunch of XML files. You are looking for two files with the name of the model you just exported. In the case of my example that is em_uhm_basa_0_ORIGINAL.mmh.xml and em_uhm_basa_0_ORIGINAL.msh.xml. Grab these two files and move them to your working directory.
Now you should have three XML files - the morph and the two model files. Open all three in a text editor. You can use pretty much any text editor you want, but I'll be using Notepad++ as it has a raft of additional functionality that makes it vastly superior to Windows Notepad. Start with the MSH.XML. You'll see a whole bunch of stuff here (almost 20,000 lines of data), but what we are interested in is right at the top. You'll see the first chunk of data is headed with:
<Data ElementCount="2331" Semantic="POSITION" Type="Float4">
This is the actual geometry information for the model - the 3D position of each vertex. Select everything in this chunk bounded by:
<![CDATA[ ]]>
and delete. Now go to the morph MOR.XML. Scroll down to the section headed:
<MeshHierarchy Name="FaceM1"> <Data Semantic="POSITION" Type="Float4" ElementCount="2331">
Once again, select everything in this chunk bounded by:
<![CDATA[ ]]>
and this time copy. Now go back to the MSH.XML and past this into the section you previously deleted. What you have just done is replace the vertex positions for the base head with the modified vertex positions of your morph.
Now we need to save out our modified file. At the top of the file, change this line:
<ModelMeshData Name="em_uhm_basa_0_ORIGINAL.MSH" Version="1">
to an appropriate name for your new head model:

You can pretty much call it whatever you want, but you need to conform the DA model naming structure to save yourself some hassle later on. The form is:
[Mainclass]_[MODELTYPE]_[MODELSUBTYPE][MODELVARIATION]_[LOD]
For this example I am using em_uhm_tallelfa_0
where, in this case:
Mainclass is the two letter race and sex ID (EM)
MODELTYPE is the three letter body part ID (UHM)
MODELSUBTYPE is the name of your model (TALLELF)
MODELVARIATION is the one letter variation ID appended to the end of your model name (A)
LOD is the one digit ID of the particular level of detail (0)
Refer to this wiki page for more info.
Once you have made those edits, save the file using the name you just chose as the basis, in my case em_uhm_tallelfa_0.msh.xml. Once it is saved, you can close the file. You can now also close the MOR.XML.
On to the MMH.XML. In this file we just need to edit the model names, as per the last step of the MSH.XML. Replace the ModelHierarchy Name and ModelDataName as appropriate:

Save the file using your new filename, in my case em_uhm_tallelfa_0.mmh.xml.
Now we have our two new model XML files we need to compile them into a game-usable format. To do this we need to use the toolset's model processors. These are commandline, so you'll either need to go old school and use a command prompt (i.e. a DOS box) or a make batch file. The processors are picky about directory names, so the easiest route is using a batch file. Create a new text file. Paste in the following:
"<ORIGINS INSTALL DIR>\\tools\\ResourceBuild\\Processors\\MMH\\GraphicsProcessorMMH.exe" <MODEL NAME>.mmh.xml
editing where appropriate. For example, in my case:
"E:\\Dragon Age\\tools\\ResourceBuild\\Processors\\MMH\\GraphicsProcessorMMH.exe" em_uhm_tallelfa_0.mmh.xml
Save this file as MMH_XML.BAT or something else appropriate. Make sure you aren't hiding file extensions and that it is .BAT and not .BAT.TXT instead. Refer to this. Put this batch file in the same directory as the MMH.XML file and double click it. You should see a command prompt flash up briefly, then an MMH and PHY file should appear. Create another text file and paste in:
"<ORIGINS INSTALL DIR>\\tools\\ResourceBuild\\Processors\\MSH\\GraphicsProcessorMSH.exe" -platform pc mmdtogff <MODEL NAME>.msh.xml
editing where appropriate. Again, in my case this is:
"E:\\Dragon Age\\tools\\ResourceBuild\\Processors\\MSH\\GraphicsProcessorMSH.exe" -platform pc mmdtogff em_uhm_tallelfa_0.msh.xml
Once again, save this file, put in the same folder as the MSH.XML file and double click. you should now have a MSH file.
Alternatively, if you are scared of commandline stuff, or just lazy like me, you can take advantage of a GUI from back in the early days of DA modding. Grab Allstar92's GUI for tazpn's Command Line Tools. Once you have that downloaded and set up (it may require you to install tazpn's tools) you can use the two compile buttons in the bottom right corner to quickly run your XML files through the appropriate processor.
Either way, you should now have your set of 3 model files for your head (MMH, MSH, PHY). Time to test them out! Open up Max/GMax again and try the to import your new model using Eshme's script. If all went to plan then you should get something like my big-chinned, fat-necked friend here:

Note that I've hidden the head collision object so you can see things more clearly. For Max users, the head will probably be invisible unless you turn off textures or set the diffuse to no alpha (face diffuse maps use the alpha channel for the spec map). Select the head mesh and it should have both Skin and Unwrap UVM modifiers (and in Max, an Edit Normals modifier). If you kept the original files exported by DATool, it should have the proper face textures applied. If everything looks good then you can export the model in the usual manner (using the same filename) to generate the metadata (.MET). I'm not sure if this is strictly required for non-props, but it can't hurt. Perhaps Eshme can clarify this. Once finished you can reset/close Max/GMax.
Now we have our head as a model instead of a morph. You can put the files in the Override folder - My Documents\\BioWare\\Dragon Age\\packages\\core\\override\\ - but by itself that isn't enough. To get the game to recognise and use the head, we need to do some additional work extending some GDAs.
Navigate to the 2DA source directory, <ORIGINS INSTALL DIR>\\tools\\Source\\2DA\\, and open Heads.xls. You'll see an array of different worksheets in this file. Scroll along until you get to the elf_heads worksheet. You'll see a whole lot of nothing in there - just the default head we used as a donor. We need to extend this file and add in our new head so that it shows up in the toolset. Select everything in this worksheet and copy, then create a new XLS and paste. We want to add a new line, using one of the previous lines as a guide.
You'll see that there are 8 columns. The two header rows describe their function and valid data types. The first column is ID. This is used in every GDA file. Your ID number must be unique unless you specifically want to overwrite an existing row in the original GDA - you cannot share row numbers. For my example I'm using 99. Note that there is a bug with certain GDAs that prevent IDs higher than 255 from showing up in the game, so some testing in this regard may be warranted. See this wiki page for more info. In this instance though, low IDs should be fine as it is highly unlikely that you'll run into clashes with other modders for something so obscure (it's most problematic in the case of weapons and armour). The next column is Label. This is a toolset-only description - it's what you see in the relevant drop-down menu, so use something descriptive enough to make it easy to find later.
The next three columns are concerned with the model filename. You will recall my earlier comments about using the proper filename format, and this is why. You should recognise the ModelType, ModelSubType and ModelVariation headings and be able to sub in the appropriate values. In my case these were uhm, tallelf and a, respectively. You'll notice there is no reference to either Mainclass or LOD. The Mainclass race element is determined by the GDA's race designation, in this case Elves (so you can't have Human heads in an Elf head GDA and vice versa), and the sex element is determined on a row-by-row basis, which we'll get to in a second. LOD is unnecessary, as the specified model is always required to be LOD0 and additional LODs (i.e. LOD2 and LOD3) and substituted by the game dynamically as (and if) appropriate.
The last three columns are fairly self-explanatory. This is where you identify which sex a particular head is for with a binary 0 or 1. As you can see from row ID #1, you can specify multiple sexes for a single row. The game will automatically detect the appropriate model from the filename. The game makes provision for a "neutral" sex, but I'm not sure if this is actually used in practice and I think it just uses the male's models anyway, so you'll likely want to just set this one to 0 and make your head either male or female by putting a 1 in the appropriate column.
With that done you can delete all the original rows aside from the first two header rows. Here is a comparison of the original sheet to my extended sheet:

Once you have something along those lines, you need to name the worksheet appropriately. When extending GDAs, you need to use the original name with an appropriate epithet. In my case, I called mine elf_heads_tallelf. You can call yours whatever you like, as long as it is unique (if multiple GDAs with the same filename exist, only the first loaded is used) and the entire name doesn't exceed 27 characters. Save the file using the same filename as the worksheet name (the filename is actually irrelevant as only the worksheet name is used, but I like to do this for the sake of clarity). Set this file aside for the moment and we'll come back to it in a minute.
Now we need to address hair. If you go back to the source Heads.xls, you'll see the elf_hair worksheet. The only thing contained within it is the bald/scalp mesh, so we need to add in references to all the other hair models so they are selectable. As before, copy the data and create a new file. The procedure is identical to the head model, except this time we will be adding in rows for the vanilla hair models. These follow the filename format of:
XY_har_hZ0
Where:
X is a one letter race descriptor (D for Dwarf, E for Elf, H for Human, K for Kid, Q for Qunari)
Y is a one letter sex descriptor (F for female, M for male, N for neutral)
Z is a one letter style ID (A, B, C, D)
0 is a one digit model ID (1, 2, 3, 4 - N.B. there are no Xm_har_ha4 models)
DATool is handy for figuring out all the filenames. You will likely have seen the hair models when browsing for the base head model. Here is a comparison of the original sheet to my extended sheet:

You'll note that I tried to override the original row ID #1 to give it a more descriptive label, but for some reason that didn't show up in the toolset, so just leave that one out. The rest of my hair labels were fairly uninspired, but you are free to come up with more colourful descriptions. As before, chose an appropriate sheet name, in my case elf_hair_tallelf, and save the file.
Now that we have the hair, we need some hair colours. Hair (and eye and skin) colours are derived from tints, so we need to open up the Tints.xls source 2DA. Follow the same procedure as before, this time with the hair_tints worksheet. Unlike with the previous examples however, this is a universal file - it can be set to apply to any race, not just Elves. The structure of the tint 2DAs is a bit simpler as well. The ID and Label columns are the same, the other two columns let you specify the filename of a particular tint and restrict that tint to a particular entry in Apr_base. In this particular instance we will set the APR column for all entries to 0, which will make the tints available for all races. For the filenames, the vanilla hair tints follow the format t3_har_XXX.tnt, where XXX is a three letter code for the particular colour. You can see the full list of vanilla hair tints in the following comparison pic:

If you have other tints, be they your own or something like PineappleTree's Vibrant Colors, feel free to add them as you see fit. And while you are at it, extend eye_tints in the same manner. The list of vanilla tints is in the following pic, although again you can add additional ones:

At this juncture, those of you still conscious that are working with a Dwarf or Human head and wanting a beard will recall my comments at the start of the post. For Human heads this is just a repeat of the previous two files - find the human_beard worksheet, extend it with all the beard model names, save with an appropriate worksheet name/filename. For Dwarves, you are required to jump through several extra hoops. For whatever reason, Bioware decided not to include a dwarf_beard GDA. In order to be able to make one you would need an extended M2DA_base to add in the new GDA, then extend Apr_base to add in the new beard GDA ID to the Dwarf appearance beard slot. That is creeping beyond the scope of this particular post, but as the same procedure could be used to add beards to Elves and Qunari (with some additional model work on top of course), I may address this elsewhere.
Once you have your finished all your XLS files, take them to <ORIGINS INSTALL DIR>\\tools\\ResourceBuild\\Processors\\ and, one at a time, drag and drop them over ExcelProcessor.exe. You'll see a command prompt flash up briefly and a GDA should appear in the directory. Repeat for the remaining XLS files. If you didn't get a GDA, then either your worksheet name exceeded 27 characters or you have an incompatible XLS file. If using Office 2007/2010, make sure you export as a Office XP/2003 XLS, not an XLSX. If you are using OpenOffice then your XLS will need to be run through Google Docs or some other program to generate a useable format. For whatever reason XLS files it generates natively aren't acceptable. Once your GDAs are produced, put them in the Override folder alongside the model files. The XLS source files can be deleted or stored elsewhere - they are not used by the toolset/game.
Now we are on the home stretch. Time to get that sucker in the game! I'm not going to cover the specifics of creature/NPC creation here. There should be plenty of info on that on the wiki or elsewhere. As a quick test all I did was (as indicated in a previous post) create a new template, copied across the details from the vanilla Berwick template and edit the appearance details as follows:

Then loading up a save in Redcliffe, I ducked into the tavern to see the results:

Success! Although the eagle-eyed amongst you may notice that he is lacking both eyebrows and eyelashes. Fear not, we can resolve both those issues, although they require different approaches.
First, let's fix the eyelashes. This requires a model solution. Open DATool and browse to the end of the model list for the appropriate race and sex, as you did when extracting the base head. The eyelashes are the very last model in the list: XY_ulm_basa_0. As before, choose Save all to export this model. Now open up Max/GMax. Start by importing your existing custom head model, em_uhm_tallelfa_0 in my case. Once that has finished, leave the importer window open (or open again if you closed it) and do the following:

1. In the "Game Objects in Scene" list, select the GOB.
2. Directly underneath in the "Model Import" options section, tick the "Merge with selected" checkbox.
3. Browse for the eyelashes model. In my case this was em_ulm_basa_0.
4. Now hit the Import button, as per usual.
You will get a window popping up asking for confirmation to merge the new model with the existing model. Select Yes. Once the import is finished you can close the import window. What you have just done is import the eyelashes mesh into the head model, making a multi-mesh model.
Now all that needs to be done is to re-export the head model. However, before doing that we need to facilitate the eyebrow fix. Eyebrows in DA are just tinted textures, so we need a texture fix to resolve this issue. To do that, we need our model to use a custom MAO so we can edit it without affecting any other head. Open the Material Editor and use the eyedropper/pick button and click on the face mesh (you probably need to select and hide the collision object obscuring the head first). It should have the uh_hed_masa material applied. All you need to do is select the name and change it to something else unique. In my case, I changed it to uh_hed_tallelfa. Once your name change is done, you can close the Material Editor and unhide the collision object.
With that done you can now export the model. Make sure to tick the "Export MAO" button. Use the same name as you used originally and make sure to replace any old copies in the Override directory with the new one. Since I am including the source files, for illustration purposes I exported mine with a different name, so that people can examine the differences between the two models. I added an additional row to the heads GDA to facilitate the selection of either head. N.B. You should have a pm_ulm_bas.mao or similar with your newly exported model. You can delete this, as it is just a copy of the vanilla eyelash MAO that we have no desire to edit or override.
Now to the texture fix for the eyebrows. To start with, we need a base diffuse map. By default, your head was probably using uh_hed_masa_0d.dds. There are a couple of different options to choose from, each with varying degrees of appropriateness to the species and sex in question. I'll leave people to investigate that at their leisure and stick with uh_hed_masa_0d for this example. The first step is to extract the texture. You'll find it in <ORIGINS INSTALL DIR>\\packages\\core\\textures\\high\\texturepack.erf which you can open either with the standalone ErfEditor.exe in the toolset directory (my preference) or the toolset itself. In the ERF, simply right-click on the texture and choose Extract Resource, then select a location to save it from the directory browser that pops up. At the same time, extract uh_hed_stb_0t.dds, as this is the file that gives us the eyebrow tint masks. Additionally, you want uh_hed_masa_0n.dds and uh_hed_stb_0n.dds, as these are the normal maps. You'll notice for all these files that there are additional textures with the l2 and l3 epithets. These are the LOD2 and LOD3 versions of the textures. We don't need to worry about these, as we'll only be making a custom texture for the LOD0 head (you can't see tiny details like eyebrows at the distance the LOD substitution kicks in).
With all the appropriate textures to hand, we can start editing. I will be using Photoshop for this purpose and will be assuming you are either using the same thing or something roughly equivalent (PSP, GIMP, etc.) and that you know how to use it. Open the tint texture (uh_hed_stb_0t) and switch to the channels view. Each channel holds a different mask for different shaped eyebrows and facial stubble. Chose the one you find most appropriate. I chose the green channel:

Select All, then copy. Now open the diffuse texture (uh_hed_masa_0d) and in the layers view create a new layer. Fill it with a solid colour. What colour doesn't particularly matter at this point as you can change it later, but I went with a dark brown. With the layer selected, choose Add Layer Mask. Now switch back to the channels view, activate the layer mask channel and deactivate the other channels. With the layer mask channel selected, paste in the tint channel you copied earlier. Unless you like it, set your foreground colour to solid black and paint out any beard stubble and other unwanted white areas. The layer mask is essentially just an alpha over the solid colour you filled the new layer with, so anything not solid black will receive some level of that colour. Once you are finished, reactivate the RGB channels and deactivate the layer mask channel, then switch back to the layer view. If all went to plan, your guy should now have an appropriately hirsute brow:

You may want to play with the opacity of the layer a bit to get a look you like. I set mine to 90%.
The last thing on the diffuse map to edit is the alpha channel. As I mentioned earlier, in face textures, the alpha channel holds the specular map. Now that we have added eyebrows, we need to tone down the spec map in this area a bit (unless you like shiny eyebrows). Start by switching to the channels view and activating the alpha channel and deactivating the other channels. Select All, then copy. Now deactivate the alpha and reactivate the RGB. Switch back to the layers view and create a new layer. Paste in a copy of the alpha channel. Now select your eyebrow layer and make sure it is activated and all other layers are deactivated. Select All and Copy Merged. Now create a new layer and deactivate the eyebrow layer. In the new layer, Paste Special->Paste in Place. You should now have another eyebrow layer, but this time without using a mask. With this layer still selected, Adjustments->Desaturate. Set the opacity to about 90% and position the layer directly above the copied alpha channel layer. Activate the alpha copy layer. Switch back to the eyebrow copy layer and set the blend mode to Overlay. You may want to fiddle with the opacity of the eyebrow layer or try different blend modes to your taste. When happy, with the eyebrow copy layer selected, Select All and Copy Merged (make sure only the eyebrow copy and alpha copy layers are active). Now switch to the channels view and activate the alpha channel. Deactivate the RGB channels. With the alpha channel selected, paste:

Done! Now you can deactivate the alpha, reactivate the RGB and switch back to the layers view. Save out the master file in case you need to make changes later. Once that is done you can delete the alpha copy and eyebrow copy layers, leaving just the original diffuse and the eyebrow overlay. Flatten the image and save it out as a DXT5 DDS. Make sure to use a unique filename. I went with uh_hed_tallelfa_0d.dds. We are done with diffuse map now, so you can close all those files.
To create the normal map, we are going to use the same layer mask approach. Open uh_hed_masa_0n.dds and uh_hed_stb_0n.dds. You'll need uh_hed_stb_0t.dds as well. In uh_hed_masa_0n, go to the channels view and pick one of the R, G or B channels (doesn't matter which). Select All, then copy. Now create a new image. Make sure it is RGB and not greyscale. Save it as uh_hed_tallelfa_0n_MASTER (or something similar). In the existing layer, paste. Rename the layer ORIGINAL RGB. Go back to uh_hed_masa_0n and activate the alpha channel, deactivate the RGB. Select All, then copy. Back to the master, create a new layer, paste. Rename the layer ORIGINAL ALPHA. Go to uh_hed_stb_0n. Repeat the same process - copy one of the RGB channels and paste it as a new layer called RGB OVERLAY in the master. Copy the alpha channel and paste it as a new called ALPHA OVERLAY in the master. Position the overlay layers above their matching original layers. Now go to uh_hed_stb_0t and activate whichever channel you used for the diffuse. Select All, copy. Back in the master, select each overlay layer in turn, Add Layer Mask, switch to channels view and past into the layer mask channel just as you did previously. Don't forget to paint out any excess stubble. Now your overlay layers should just be the eyebrows. Make sure the two RGB layers are activated and the alpha layers deactivated. Select the overlay layer, Select All and Copy Merged. Create a new image. Make sure it is RGB. If you created it with a transparent background, fill the layer with a solid colour (doesn't matter what, the layer just needs something in it). Switch to the channels view, select one of the R, G, or B channels, paste. Repeat this for the remaining two channels. Go back to the master. Deactivate the two RGB layers and activate the alpha layers. Select the overlay layer, Select All and Copy Merged. Go back to the new image, in the channels view create and activate the alpha channel, deactivate the RGB channels. Paste. Switch to the layers view and make sure the image is flattened. Save out as a DXT5 DDS with a filename such as uh_hed_tallelfa_0n.dds.

We are done with texture editing for now, so we can close those. Make sure to move any final copies of custom DDS files to the Override folder. To get the new textures to show up, we have to edit the custom MAO we specified during the model export. Find this file, uh_hed_tallelfa.mao or whatever you named it. Open in a text editor (it's another XML file). There are just two lines we need to change. Find
<Texture Name="mml_tDiffuse" ResName="uh_hed_masa_0d.DDS"></Texture> <Texture Name="mml_tNormalMap" ResName="uh_hed_masa_0n.DDS"></Texture>
and replace with
<Texture Name="mml_tDiffuse" ResName="uh_hed_tallelfa_0d.DDS"></Texture> <Texture Name="mml_tNormalMap" ResName="uh_hed_tallelfa_0n.DDS"></Texture>
substituting in whatever texture filenames you used. Save the MAO and make sure it is in the Override folder with all your other files and load up the game to test!

And there we go, one `browed and `lashed up Elf, ready for a night out on the town. Or something.
Phew. After all that lot I need a good lie down. After the intermission, I'll move on to part 2 - creation of LODs, and then (at some point) Part 3 - scaling and inter-species cranial cross-overs.
I'll upload the source files as soon as I can. Until then.....*faints*





Retour en haut





























