Mesh Read/Write Enabled Checkbox Not Working

I was trying to turn on Read/Write for a mesh, but every time I hit “Apply”, the Read/Write checkbox unchecks itself…so I can’t turn on Read/Write for some reason. I’m doing this on an FBX file.

Is this a Unity bug, or is there some reason that Unity would not allow me to turn Read/Write on for a mesh? I’m not seeing any errors or issues popping up in the log when I try to apply the change the mesh.

So, turns out that my project had an AssetProcessor script in it that was always turning off this checkbox. So, I’d turn it on, hit apply, the processor script would turn it off. False alarm, but thought I’d share in case anyone runs into the same problem!

2 Likes

Thank you for answering to yourself ahah, it helped me!

Putting this here for everyone that may have the same issue while using a ModelImporter / AssetPostprocessor.

Here’s the code in case you want to leave the model importer to disable read write on ALL all imports, but you also want to add an exception for an object :

using UnityEditor;

public class ReadOnlyModelPostprocessor : AssetPostprocessor
{

    public const string EXCEPTION1 = "Assets/Models/Model.FBX"; 

    public void OnPreprocessModel()
    {       
        ModelImporter mi = (ModelImporter)assetImporter;       
        if (mi.isReadable && !assetPath.Equals(EXCEPTION1))
        {           
            mi.isReadable = false;
            mi.SaveAndReimport();
        }
    }
}

*ReadOnlyModelPostprocessor class needs to be located in Assets/Editor folder.

1 Like

Disabling these checks solve this problem on build , read/write was false on it