How to control avatar blinking animation?

Ubiytsa
by Ubiytsa · 21 posts
4 years ago in Basic Creator Help
Posted 4 years ago · Author
Hey. Wondering if anyone could help me on this one. Where on create mode can I slow down the speed of the blinking animation to happen again when creating avatar poses? Or decrease the likelihood of the blinking animation to repeat itself?
Posted 4 years ago
@Ubiytsa


Derive from a male or female avatar (PID 80 or 191)

Create a new asset named blink.xpf

This will override the default blink.xpf used by the avatar.

Here default code that goes inside of blink.xpf

Code
<HEADER MAGIC="XPF" VERSION="919" />
<ANIMATION NUMTRACKS="80" DURATION="0.2">
<TRACK NUMKEYFRAMES="20" MORPHNAME="blink.Left.Lower.Clamped">
   <KEYFRAME TIME="0.0" >
      <WEIGHT>0.0</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.01" >
      <WEIGHT>0.05</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.02" >
      <WEIGHT>0.10</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.03" >
      <WEIGHT>0.15</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.04" >
      <WEIGHT>0.20</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.05" >
      <WEIGHT>0.25</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.06" >
      <WEIGHT>0.30</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.07" >
      <WEIGHT>0.35</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.08" >
      <WEIGHT>0.40</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.09" >
      <WEIGHT>0.45</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.10" >
      <WEIGHT>0.50</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.11" >
      <WEIGHT>0.55</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.12" >
      <WEIGHT>0.60</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.13" >
      <WEIGHT>0.65</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.14" >
      <WEIGHT>0.70</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.15" >
      <WEIGHT>0.75</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.16" >
      <WEIGHT>0.80</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.17" >
      <WEIGHT>0.85</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.18" >
      <WEIGHT>0.90</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.19" >
      <WEIGHT>0.95</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.20" >
      <WEIGHT>1.00</WEIGHT>
   </KEYFRAME>
</TRACK>
<TRACK NUMKEYFRAMES="20" MORPHNAME="blink.Left.Upper.Clamped">
   <KEYFRAME TIME="0.0" >
      <WEIGHT>0.0</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.01" >
      <WEIGHT>0.05</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.02" >
      <WEIGHT>0.10</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.03" >
      <WEIGHT>0.15</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.04" >
      <WEIGHT>0.20</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.05" >
      <WEIGHT>0.25</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.06" >
      <WEIGHT>0.30</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.07" >
      <WEIGHT>0.35</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.08" >
      <WEIGHT>0.40</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.09" >
      <WEIGHT>0.45</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.10" >
      <WEIGHT>0.50</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.11" >
      <WEIGHT>0.55</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.12" >
      <WEIGHT>0.60</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.13" >
      <WEIGHT>0.65</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.14" >
      <WEIGHT>0.70</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.15" >
      <WEIGHT>0.75</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.16" >
      <WEIGHT>0.80</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.17" >
      <WEIGHT>0.85</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.18" >
      <WEIGHT>0.90</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.19" >
      <WEIGHT>0.95</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.20" >
      <WEIGHT>1.00</WEIGHT>
   </KEYFRAME>
</TRACK>
<TRACK NUMKEYFRAMES="20" MORPHNAME="blink.Right.Lower.Clamped">
   <KEYFRAME TIME="0.0" >
      <WEIGHT>0.0</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.01" >
      <WEIGHT>0.05</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.02" >
      <WEIGHT>0.10</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.03" >
      <WEIGHT>0.15</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.04" >
      <WEIGHT>0.20</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.05" >
      <WEIGHT>0.25</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.06" >
      <WEIGHT>0.30</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.07" >
      <WEIGHT>0.35</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.08" >
      <WEIGHT>0.40</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.09" >
      <WEIGHT>0.45</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.10" >
      <WEIGHT>0.50</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.11" >
      <WEIGHT>0.55</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.12" >
      <WEIGHT>0.60</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.13" >
      <WEIGHT>0.65</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.14" >
      <WEIGHT>0.70</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.15" >
      <WEIGHT>0.75</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.16" >
      <WEIGHT>0.80</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.17" >
      <WEIGHT>0.85</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.18" >
      <WEIGHT>0.90</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.19" >
      <WEIGHT>0.95</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.20" >
      <WEIGHT>1.00</WEIGHT>
   </KEYFRAME>
</TRACK>
<TRACK NUMKEYFRAMES="20" MORPHNAME="blink.Right.Upper.Clamped">
   <KEYFRAME TIME="0.0" >
      <WEIGHT>0.0</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.01" >
      <WEIGHT>0.05</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.02" >
      <WEIGHT>0.10</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.03" >
      <WEIGHT>0.15</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.04" >
      <WEIGHT>0.20</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.05" >
      <WEIGHT>0.25</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.06" >
      <WEIGHT>0.30</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.07" >
      <WEIGHT>0.35</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.08" >
      <WEIGHT>0.40</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.09" >
      <WEIGHT>0.45</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.10" >
      <WEIGHT>0.50</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.11" >
      <WEIGHT>0.55</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.12" >
      <WEIGHT>0.60</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.13" >
      <WEIGHT>0.65</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.14" >
      <WEIGHT>0.70</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.15" >
      <WEIGHT>0.75</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.16" >
      <WEIGHT>0.80</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.17" >
      <WEIGHT>0.85</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.18" >
      <WEIGHT>0.90</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.19" >
      <WEIGHT>0.95</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.20" >
      <WEIGHT>1.00</WEIGHT>
   </KEYFRAME>
</TRACK>
</ANIMATION>


But Don, what does all of this code mean?

Let's start with:
Code
<ANIMATION NUMTRACKS="41" DURATION="0.2">


The above line of code says that the duration of the blink animation should last 0.2 sections. Increase this number to allow the blink to last longer / make it slower. Decrease this number to make the blink not last as long / faster.

Now, notice this part of the code:

Code
<TRACK NUMKEYFRAMES="20" MORPHNAME="blink.Left.Lower.Clamped">
   <KEYFRAME TIME="0.0" >
      <WEIGHT>0.0</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.01" >
      <WEIGHT>0.05</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.02" >
      <WEIGHT>0.10</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.03" >
      <WEIGHT>0.15</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.04" >
      <WEIGHT>0.20</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.05" >
      <WEIGHT>0.25</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.06" >
      <WEIGHT>0.30</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.07" >
      <WEIGHT>0.35</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.08" >
      <WEIGHT>0.40</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.09" >
      <WEIGHT>0.45</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.10" >
      <WEIGHT>0.50</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.11" >
      <WEIGHT>0.55</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.12" >
      <WEIGHT>0.60</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.13" >
      <WEIGHT>0.65</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.14" >
      <WEIGHT>0.70</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.15" >
      <WEIGHT>0.75</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.16" >
      <WEIGHT>0.80</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.17" >
      <WEIGHT>0.85</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.18" >
      <WEIGHT>0.90</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.19" >
      <WEIGHT>0.95</WEIGHT>
   </KEYFRAME>
   <KEYFRAME TIME="0.20" >
      <WEIGHT>1.00</WEIGHT>
   </KEYFRAME>
</TRACK>


Each track contains 20 keyframes and each keyframe counts the time upwards towards the total duration of .20 seconds by increments of 0.01 seconds (Example: [0.01, 0.02, 0.03 .... 0.19, 0.20 ] )

This needs to continue to be true if you increase / decrease the duration; the keyframes need to slowly count up to the duration that you chose, preferably by increments of (Duration / Number of KeyFrames) if you want the morph of the eyes blinking to remain smooth. (Example: [0.20 seconds / 20 KeyFrames = 0.01 seconds] giving us increments of 0.01 seconds per KeyFrame )
Posted 4 years ago
i was talking to a dev about this code and she said it works fine if you put it in complete in one shot i dont know what she meant by that but she was like ding stage input doesn't work. since i dont dev im not sure what she meant care to explain to me?? please?
Posted 4 years ago · Author
@Don Von Alpha Dom


Oh, thanks for the info. I have previously tried changing the duration part, but not the keyframes of each morph part.
Posted 4 years ago
thank you i know more now then i did.
Posted 4 years ago
This is amazing
Posted 4 years ago
is there a way you can explain this more , to make the blinking slower but also more smooth running. and how you can mame multiple blinks in a small amount of time , as like a flirty type blinking ? fluttering the eyes, if im explaining it right. i've tried different numbers and nothing has worked.
Posted 4 years ago
@Don Von Alpha Dom


Im trying to replace the default animation, I'm mostly focused on just slowing down the blinking to a more normal/natural pattern & then working on the fluttering of the eyes. Although, no matter how many numbers i play with or try to understand, my .xpf file doesnt seem to make a difference in the blinking. It only makes the 1st blink slow. but not normal. It closes gradually and naturally but doesnt open naturally , it just opens suddenly. and then the rest of the blinks are just default fast blinks.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here

SIGN IN NOW

Create an account

Sign up for a new account in our community. It's easy!

REGISTER A NEW ACCOUNT