MAO

From Dragon Age Toolset Wiki
Jump to: navigation, search

Each model uses an mao to define what its surface will look like. If you want to change an object's texture, this is the file to edit. Within are references to texture files which are used when drawing the model, as well as a reference to the material to use to render.

MAO Example

This is an example of a basic MAO file (plc_scarecrow01.mao).

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Exported by Material Editor --><!-- dc:source=file:///A:/DragonAge/SourceControl/ArtContent/Art/Levels/Materials/OutsourcedProps04.matproj -->
<MaterialObject Name="Plc_Scarecrow01">
  <Material Name="Prop.mat"></Material>
  <DefaultSemantic Name="Blend"></DefaultSemantic>
  <Texture Name="mml_tDiffuse" ResName="p_scarecrow_01d.dds"></Texture>
  <Texture Name="mml_tNormalMap" ResName="p_scarecrow_01n.dds"></Texture>
  <Texture Name="mml_tSpecularMask" ResName="p_scarecrow_01s.dds"></Texture>
</MaterialObject>

<MaterialObject Name="Plc_Scarecrow01"> - This line assigns a name to the mao. This should be a unique identifier as this is the name required to reference this mao.

<Material Name="Prop.mat"></Material> - This is the line which tells the mao which material it should use to render its textures with.

<DefaultSemantic Name="Blend"></DefaultSemantic> - This line tells the material referenced above which semantic it should use when rendering.

<Texture Name="mml_tDiffuse" ResName="p_scarecrow_01d.dds"></Texture> - This line tells the material which texture to use as the diffuse texture. To be more general, it tells the material to use the texture file referenced by ResName, in this case p_scarecrow_01d.dds, where ever it uses the parameter mml_tDiffuse. This is the same for the rest of the lines in the mao file.

See MAT for more information on materials.

To view more mao files, extract them from materialobjects.erf and open them in a text editor. They are only simple xml files and require nothing more to read or edit.

Many of the possible textures are covered in mikemike37's texture tutorial

MAO XML Schema

See [1] for information on the RELAX NG 1.0 XML schema format. For a free converter/verifier, see [2].

<?xml version="1.0" encoding="UTF-8"?>
<grammar ns="" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <start>
    <element name="MaterialObject">
      <attribute name="Name">
        <data type="NMTOKEN"/>
      </attribute>
      <oneOrMore>
        <choice>
          <text/>
          <element name="DefaultSemantic">
            <attribute name="Name">
              <data type="NCName"/>
            </attribute>
          </element>
          <element name="Float">
            <attribute name="Name">
              <data type="NCName"/>
            </attribute>
            <attribute name="value">
              <data type="decimal"/>
            </attribute>
          </element>
          <element name="Material">
            <attribute name="Name">
              <data type="NCName"/>
            </attribute>
          </element>
          <element name="SoundType">
            <attribute name="Name">
              <data type="NCName"/>
            </attribute>
            <attribute name="value">
              <data type="integer"/>
            </attribute>
          </element>
          <element name="Texture">
            <attribute name="Name">
              <data type="NCName"/>
            </attribute>
            <optional>
              <attribute name="RequiresID">
                <data type="boolean"/>
              </attribute>
            </optional>
            <attribute name="ResName">
              <data type="NMTOKEN"/>
            </attribute>
          </element>
          <element name="Vector4f">
            <attribute name="Name">
              <data type="NCName"/>
            </attribute>
            <attribute name="value"/>
          </element>
          <element name="Vector4fArray">
            <attribute name="Name">
              <data type="NCName"/>
            </attribute>
            <attribute name="value"/>
          </element>
          <element name="texture">
            <attribute name="Name">
              <data type="NCName"/>
            </attribute>
            <attribute name="ResName">
              <data type="NCName"/>
            </attribute>
          </element>
        </choice>
      </oneOrMore>
    </element>
  </start>
</grammar>