xprremovematerial
-----------------

This application can remove materials from DOA3 models.  To understand what this means, you should have an understanding of how DOA3 models are set up.

Each model is made up of multiple objects.  An object is a head, or a foot, or a part of a leg.  The game assembles all of these objects together into a character, with the help of the .cat file.

Each object is made up of one or more materials.  For example, on a head, there is a face material and multiple hair materials.  Each material is assigned one (and only one) texture.

Anyway, this application allows you to remove materials from these objects.  Now, this only really works and looks good if there is another material underneath it.  Most of the time if you remove a piece of clothing from a DOA3 character, you end up with a big hole in your model because there wasn't anything underneath it.  If you remove a sleeve from a character's shirt, more often than not there won't be an arm underneath it.  You'll be left with a hand that's attached to nothing.

So the main practical uses of this application are somewhat limited.  The main materials that are OK to remove and still have a character without gaps in them are accessories and skirts, though removal of skirts can leave holes in the torso where they were attached.

In all of my testing, this generates valid xpr files that DOA3 will take.  Your mileage may vary, however.

Oh, and this only works with DOA3 xpr's.  

Usage
-----

To remove a material, enter at the command line:

xprremovematerial <xprfile> <objectnumber> <materialnumber>

So to remove the back of leifang's skirt:

xprremovematerial lei06.xpr 2 0

This will create a file called "out.xpr" that has that material removed.

To remove multiple materials, you can pass "out.xpr" back in like so:
xprremovematerial lei06.xpr 2 0 (creates out.xpr)
xprremovematerial out.xpr 2 1   (updates out.xpr)
xprremovematerial out.xpr 2 2   (updates out.xpr)


The application will print out a list of objects and material numbers, along with what textures are associated with each material on each object.  THESE ARE ZERO BASED, so if you use MiteeXPR to rip textures, you'll have to add 1 to the texture number when you look to see which texture it is.

As a rule of thumb, you'll most likely be interested in the first 10 objects or so.  That's usually where the head, torso, and pelvis are stored.


Code
----

The code is included, and it's probably the most useful piece of all of this.  It's built with VC++ 6.  It's based off _mirage_'s xpression code, with all of the data structures updated to handle the DOA3 xpr format.  I ripped out a good deal of the code that was useless to the material remove effort, mainly to keep to code easy to read, and partly because a lot of that code doesn't seem to work with DOA3 anyway.

I think it goes without saying, but feel free to take the code and modify it to your heart's content.

Thanks
------
To _mirage_ for the xpression code, without which this wouldn't have been possible.

To cypher35, for giving us a place to gather and talk about all of this.

Oh, and I guess to the MegaXKey people and that guy who did the 007:AUF linux hack, which has allowed me to work on this stuff without a modded XBox.
