So I got lots of fbx format animation files, each animation file contain only one AnimationClip, and all AnimationClip named Take 001 by default.
Obvisouly, those AnimationClip’s name need to be modified, in this case, I want to modify its name to filename.
So I was wonder how could I do this through script?
I try something like this, of course it won’t work
AnimationClip ac = (AnimationClip)AssetDatabase.LoadAssetAtPath("Assets/Animation/Thug/Step/Step_Back_Long.FBX", typeof(AnimationClip));
ac.name = "Step_Back_Long";
I haven’t done this, but try defining ac as an Asset instead of an AnimationClip, then modify the Asset.name. The description for Asset.name in the API doesn’t say it’s read-only, but it does says it’s for “get”-ing the name… worth a try.