Randomization in Animation

Slate Forums Support Randomization in Animation

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2056
    shadston
    Participant

    Hey,

    I am trying to add some blinking to my character. I wanted my character to blink randomly during whole cutscene but sometimes I need to insert a specific type of a blink in a specific moment in time (for example close eyes, keep eyes closed for 1 second, open them and go back to random blinking). I created a random blinking clip, but when I wanted to put random blinking and specific blinking together on a single track I didn’t know how to blend them properly. Do you have any advice for me how could I approach this problem?

    #2057
    Gavalakis
    Keymaster

    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.

    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!

    Join us on Discord: https://discord.gg/97q2Rjh

    #2058
    shadston
    Participant

    I am using bones rotations and positions in the animation clip. I guess I am after specifics for example how to connect custom mixer to animation graph. I know how to do it in a simple script but I don’t see an option to integrate it with your API. Putting separate track above random blinking track causes my character to blink with closed eyes (no matter how weird it sounds). This is my blinking clip. The best scenario for me is to cover whole track with a random blinking and put specific blinks in between, but then I can’t guarantee that I won’t start specific blink with eyes closed, so I need a way to blend it nicely no matter in what state are eyes because of the random blinking. I thought about tweaking whole track weight, but maby you know a better solution.

    #2059
    shadston
    Participant

    I solved it by tweaking whole track weight instead of tweaking specific clip weight/progress. If you know better solution I’d love to hear it.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.