Add the feature to add suffix (e.g. humanoid, generic) to the converted animation

rabberdakk 2 years ago updated 2 years ago 1

Please add the feature to add suffix (e.g. humanoid, generic) to the converted animation.

NOTE: This issue has been resolved by contacting support previously

Animation Converter Version:
1.03p01
Unity Version:
2021.3.8f1

Rename the "AnimationConverterWindow.cs" file at line 605

string[] guids = AssetDatabase.FindAssets("*", new string[] { configuration.OutputDirectory });
string[] paths = guids.Select(guid => AssetDatabase.GUIDToAssetPath(guid)).ToArray();

var suffix = "legacy";
if (configuration.DestinationAnimationType == AnimationConverter.AnimationType.Generic) {
    suffix = "generic";
} else if (configuration.DestinationAnimationType == AnimationConverter.AnimationType.Humanoid) {
    suffix = "humanoid";
} else {
    suffix = "unknown";
}

foreach (var assetPath in paths) {
    if (assetPath.EndsWith(".anim") == false) continue;

    foreach(var clip in clipsToConvertList.ToArray()) {
        string clipPath = AssetDatabase.GetAssetPath(clip);
        if (System.IO.Path.GetFileName(assetPath) == System.IO.Path.GetFileName(clipPath)) {
            string newAssetPath = System.IO.Path.GetFileNameWithoutExtension(assetPath) + " (" + suffix + ")";
            AssetDatabase.RenameAsset(assetPath, newAssetPath);
        }
    }
}