hello
I use the unity editor
When I edit the FBX in the Unity editor, I want the actual file to be replaced as well.
After replacing the mesh of the FBX file, I saved the file in the mesh of the FBX.
In Unity, it appears as a replaced mesh.
but the actual file didn’t change
can i solve this
(I am using the asset’s code modified to save the mesh with lower quality.
Mantis LOD Editor - Professional Edition | Modeling | Unity Asset Store)
static void MakeMini(GameObject obj)
{
//OnPostprocessModel(GameObject model) Call this method
//Get GameObject
MeshFilter[] meshArr = obj.GetComponentsInChildren<MeshFilter>();
MantisLODEditor.Mantis_Mesh[] mantisArr = new MantisLODEditor.Mantis_Mesh[meshArr.Length];
float quality = 10.0f;// 0 ~100
if (meshArr.Length > 0)
{
for (int i = 0; i < mantisArr.Length; i++)
{
mantisArr[i] = new MantisLODEditor.Mantis_Mesh();
mantisArr[i].mesh = meshArr[i].sharedMesh;
}
float oldFaceNumber = MantisLODEditor.MantisLODEditorUtility.PrepareSimplify(mantisArr);
//Make Low Quality
bool protect_boundary = true;
bool protect_detail = false;
bool protect_symmetry = false;
bool protect_normal = false;
bool protect_shape = true;
bool use_detail_map = false;
int detail_boost = 10;
MantisLODEditor.MantisLODEditorUtility.Simplify(mantisArr, protect_boundary, protect_detail, protect_symmetry, protect_normal, protect_shape, use_detail_map, detail_boost);
int faceNumber = MantisLODEditor.MantisLODEditorUtility.SetQuality(mantisArr, quality);
//Change Mesh
for (int i = 0; i < meshArr.Length; i++)
{
meshArr[i].sharedMesh = mantisArr[i].mesh;
}
}
}