- Home /
what to return from OnAssignMaterialModel?
Hi,
I'm implementing my own ModelPostprocessor.OnAssignMaterialModel and I want to override materials just for some meshes. For others I would return material which was passed in as a parameter, but that doesn't work if material is Default-Diffuse, I get errors:
OnAssignMaterial must return a persistent material (AssetDatabase.CreateAsset)
Is there a proper solution for this?
Answer by Paulius-Liekis · Jan 03, 2011 at 08:40 AM
Figured it out: if you don't want to override material you have to return null (it says so in the documentation...).
Your answer
Follow this Question
Related Questions
Can I change a material name using AssetPostprocessor.OnPreprocessModel 1 Answer
Material.mainTexture not working outside of runtime? 1 Answer
Material doesn't have a color property '_Color' 4 Answers
Changing two different objects renderer colour 1 Answer
How to find and assign Default-Particle material to a renderer 2 Answers