- Home /
Why are changes in OnPreprocessMaterialDescription ignored?
Hi!
I can't get a custom AssetPostprocessor to work, specifically OnPreprocessMaterialDescription. The example from the docs does not perform a visual change. Therefore, I have to modify the script to see whether it works:
When I insert a radical change, such as setting the Material color to blue, there is still no change. For example:
public void OnPreprocessMaterialDescription(MaterialDescription description, Material material, AnimationClip[] materialAnimation)
{
material.color = Color.blue;
Debug.Log(material.color);
}
I know the method gets called, because the console output appears after reimporting the model. This code prints the expected blue color values to the console, but the material does not change its visual appearance. The model contains one material which is red which should be blue after import. But it is still red after import. Strangely, before assigning the material color to be blue, it is white, according to console logs! So the material is white initially, the script sets it to blue, and then Unity sets it to red, according to the source fbx file?
Has someone an idea what I can try? Someone experienced this before? I'm using Unity 2021.1.21f1.
This is what it looks like:
But it should be blue.
Your answer

Follow this Question
Related Questions
Import Project from Asset store 6 Answers
C4d file import to Unity No Animations 0 Answers
Importing .max file 1 Answer
fbx model is missing faces but its okay in maya, 3ds max and blender. 1 Answer
Bad lighting on imported object. 0 Answers