How to set animation clip to legacy with editor script?

HI,
I want to set the animation clip to legacy through editor script, is that possible?

In a desperate attempt, I try to set it with this code with no success, Does anyone know Is this even close?

private void OnPreprocessAnimation()
    {
        Debug.Log ("AssetProcess: Importing animation");

        var modelImporter = assetImporter as ModelImporter;
        modelImporter.clipAnimations = modelImporter.defaultClipAnimations;

        modelImporter.clipAnimations.SetValue ("Legacy", long.Parse("true"));
    }

AnimationClip has a .legacy bool property. Doesn’t it work to just set that?

Hi baste, thanks for replying! :slight_smile:
I need to change it to legacy in editor because I need to pack it into assetbundle. It doesn’t work if it is set with AnimtionClip .legacy after the asset bundle is unpack.