Inspired by Bobboau's previous work on the nameplate code, I took it upon myself to add support for complete texture replacement on ships in-mission.

It is now possible to reskin a ship model without needing an extra table entry.
Here's the final product...
http://fs2source.warpcore.org/exes/fs2_open_3.41_unofficial.exeAdd the following to the bottom of one or more ship entries in a mission file...
$Texture Replace:
+old: [old texture]
+new: [new texture]
or
$Duplicate Model Texture Replace:
+old: [old texture]
+new: [new texture]
The +old: and +new: lines can be repeated, if desired, to allow replacement of more than one texture on a ship. If you're using the $Duplicate Model Texture Replace method, there is a limit of 50 possible texture replacements per mission. But if people so desire, the limit can be raised.
The most obvious use for this mod is to allow custom nameplates on ships (à la the Galatea and the Bastion). The nameplate code was never completely finished, but you can accomplish the same result by (e.g., on the Orion) replacing capital01-05a with whatever the filename of your custom nameplate is. (Speaking of custom nameplates, this seems like a good time to highlight my
Orion nameplate tutorial.

)
You'll need to reskin a duplicate model if you want to substitute animated or transparent textures, but this is probably the optimal solution if you want to add cockpit kill count art, custom ship nameplates, or any stuff like that. Of course, mission designers can experiment on their own to see which method plays better in a given mission.
For the SCP gurus and anyone else interested, the way I implemented the $Texture Replace method was to add an array to the ship structure, int replacement_textures[MAX_MODEL_TEXTURES], which I initialized to -1 and later loaded the duplicate textures with a one-to-one correspondence to the textures in the polymodel struct. In the model render routine, I check to see if the texture currently being rendered has a positive (greater than -1) ID number in the associated replacement texture array, and if so I render that texture instead of the texture in the polymodel struct.
The way I implemented the $Duplicate Model Texture Replace method was to duplicate the ship model (not a trivial task!) for all ships with custom textures, and then reskin this duplicate model with the custom textures as the mission was loading. Once the mission has loaded, the model is all retextured, initialized, and ready to go, so there's no extra calculation in the middle of the mission.
[This post has been edited to reflect the final state of the mod, with both the ship texture array method and the duplicate model method implemented.

]