- Home /
Question by
BlackWings · Jan 17, 2014 at 02:59 AM ·
animationeditormecanimanimation clipblendtree
How to set animation clip to BlendTree on Editor?
I want to replace animation clips of BlendTree automatically on Editor. It was possible to get clips in BlendTree, but I do not know how to be set.
I tried in Editor script,
---ellipsis---
UnityEditorInternal.BlendTree bt = motion; //<- successful.
Debug.Log( bt.GetMotion(0) ); //<- successful.
bt.SetChildThreshold(0, 1.0f); //<- successful.
bt.AddAnimationClip( someClip ); //<- Editor freezes when you do this. This is bug?
I could not find a method of set animation clip. How to set animation clip to BlendTree do not exist?
Comment
Are you calling bt.AddAnimationClip( someClip ) inside a loop where you are iterating over the child motions of the BlendTree you want to modify?
Your answer
Follow this Question
Related Questions
UnityEditor.Animations.AnimatorControllerLayer.SetOverrideMotion not working 0 Answers
Reusing an Animator Controller for generic animations 4 Answers
modify mecanim clips 0 Answers
Is there a way to access the current animation clip being edited through a script? 1 Answer
Mecanim Character Barrel Roll 0 Answers