Using Multiple AssetPostprocessors

In working on my asset pipeline for my current Unity project, I stumbled across something handy today I hadn’t needed to use before. As such, I figured a short post might help me remember and spread a useful tip. Specifically, the AssetPostprocessor class contains a function GetPostprocessOrder(). I didn’t find the documentation to be immediately obvious, so here’s a quick example.

A couple of weeks ago, I posted up an example video for an automated Blend Shape extraction tool I made for Unity and Maya. Moving this tool back into Touch KO 2.0, I needed it to work in conjunction with another big AssetPostprocessor script that sets up my boxer prefabs. Basically, I needed to make sure that my blend shapes were all set up on the character before I start building the prefab, so that I can link them up as needed.

My first thought was to make my prefab setup script inherit from the blend shape importer, call the base method, and then call all of my setup stuff. This approach would work, provided that my base method appropriately contained controls to avoid reduplication of information. Then I stumbled across this function. All I had to do was add it to my AssetPostprocessor class that sets up my boxer prefab.

/*
 * Ensure this script executes after blend shapes have been set up
 * */
public override int GetPostprocessOrder ()
{
	return 100;
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.