Forums › 💬 Slate Sequencer › ⚙️ Support › Randomization in Animation › Reply To: Randomization in Animation
Hello there 🙂
It really depends on how your blinking is done (is it based on blend-shape, or bone rotations for example?). In general, two clips can be made cross-blendable by overriding the .canCrossBlend property (and return true), as well as overriding blendIn and blendOut (so that the clip has blend parameters). Thus, the following clip has all it needs to be able to blend in/out, as well as cross-blend with itself.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
public class ExampleClip: ActorActionClip { [SerializeField, HideInInspector] private float _length; [SerializeField, HideInInspector] private float _blendIn; [SerializeField, HideInInspector] private float _blendOut; public override float length { get { return _length; } set { _length = value; } } public override float blendOut { get { return _blendOut; } set { _blendOut = value; } } public override float blendIn { get { return _blendIn; } set { _blendIn = value; } } public override bool canCrossBlend => true; } |
From here, it is a matter of using the blendIn
and blendOut
properties in the OnUpdate
method override, accordingly to what/how you want to implement the blending, which really depends on how the blinking is done though.
Does this information helps, or are you after more specifics? 🙂 If so can you please share your clip code?
Of course, another totaly different aproach would be to simply use a separate track and have your “specific blinking” above the “random blinking”. Since tracks are evaluated from bottom-to-top, your top track with the “specific blinking” will be evaluated last and thus override the bottom “random blinking” one. If the blinking implementation is “deterministic”, this will also work just fine.
Let me know if that helps.
Thanks!