- Home /
How to 'call' AssetPostprocessor script?
I am trying to make a model post process using something like what they say here: http://docs.unity3d.com/Documentation/ScriptReference/AssetPostprocessor.OnPostprocessModel.html But it's not doing anything. I put the script in the Editor folder, is that enough? Do I have to call it explicitly or attach it to something, or should it just work whenever the model re-imports?
Answer by DoktorAce · Dec 03, 2012 at 09:09 AM
Yes, the script should run whenever the AssetPostprocessor starts (When an asset is being imported or re-imported). And the script do have to be inside a folder called Editor.
I've been doing this with textures and it works just fine, but I've done it using C#. (You might have to put "using UnityEditor;" at the top of your class)
class Postprocessing : AssetPostprocessor {
void OnPostprocessTexture (Texture2D texture) {
//Do stuff with the texture
}
}
Your answer
Follow this Question
Related Questions
Adding custom functionality to 2D texture import settings -- where to start? 0 Answers
Importing FBX with textures 1 Answer
Editor crash on all scenes and projects 1 Answer
Why Are My Project Assets Constantly Re-Importing? 2 Answers
Editor.DestroyImmediate crashes Unity. Am I using it wrong? 3 Answers