I’m working on an Editor script called from editor gui that will take an input fbx file, read out all the clips and an animator file, cycle through to set those clips to be used on Animator states.
The bit that I’m having trouble with is converting ModelImporterClipAnimation to a motion clip used by the animator states.
Here is how I get the clips from the fbx:
importedModel = ModelImporter.GetAtPath(path) as ModelImporter;
numClipsModel = importedModel.clipAnimations.Length;
importedClips = new ModelImporterClipAnimation[numClipsModel];
The animator states:
ChildAnimatorState[] ch_animStates = stateMachineLayer.states;
foreach (ChildAnimatorState curState in ch_animStates){
AnimatorState thisState = curState.state;
//thisState.motion = ???
}
I’m not sure if I’m missing something obvious, nothing useful showing up on Google either.
Thanks!