Skip to main content
Known Participant
September 23, 2022
Answered

Animating weepy character

  • September 23, 2022
  • 1 reply
  • 1554 views

Hello,

 

I'm attempting to create a rig for an animated character and am running into a problem with an animated sequence in a time-remapped composition. It may be easier to explain using this recording:

 

 

Each facial feature has a one second in the composition. Appreciate any ideas. Thanks!

This topic has been closed for replies.
Correct answer Dan Ebberts

I appreciate the expression template. Sadly, I wasn't able to impliment it correctly but I also realize that I'm making this more complicated than necessary.

 

What if I added an expression to the time remap where the Slider's position (1 through 6) was the start point and the composition played for 29 frames before looping back to the same Slider point? That way, each expression would loop in blocks of 29 frames, which no one would notice unless the facial feature was likewise animated.

 

I'm not very strong at scripting so I can only imagine modifying the LoopOut expression.


I think that would only make a slight difference:

s = effect("Eyebrow Tear")("Slider");
n = 0;
if (s.numKeys > 0){
  n = s.nearestKey(time).index;
  if (time < s.key(n).time) n--;
  if (n > 0){
    val = s.key(n).value;
  }else{
    val = s.key(1).value;
  }
}else{
  val = s.value;
}
if (n > 0){
  val + (time - s.key(n).time)%framesToTime(29);
}else{
  val;
}

1 reply

Dan Ebberts
Community Expert
Community Expert
September 23, 2022

You can probably do it, depending on how you're animating the slider. If you use a slider keyframe for each facial pose, then you could have a time remap expression that finds the most recent slider keyframe and just uses that value unless it's pose 6, in which case it uses 6 plus how long it's been since the keyframe (you'd probably need that to loop if it could be longer than the animation). In any case, quite do-able if you provide more detail.

Known Participant
September 23, 2022

Let's see what I can provide.

 

The tears are indeed the 6th possible pose, though I can rearrange them. It runs for 29 frames before being intended to loop back to the first.

 

I have a time remap going for the tears sub-composition, but I haven't done anything with it yet. I could always make the tears a separate comp. It's more for convenience if I can make it work within the larger comp and selectable by the slider.

Known Participant
September 23, 2022

This might work without keyframes:

s = effect("Eyebrow Near")("Slider");
n = 0;
if (s.numKeys > 0){
  n = s.nearestKey(time).index;
  if (time < s.key(n).time) n--;
  if (n > 0){
    val = s.key(n).value;
  }else{
    val = s.key(1).value;
  }
}else{
  val = s.value;
}
if (n > 0){
  val + (time - s.key(n).time)%framesToTime(29);
}else{
  val + time%framesToTime(29);
}

Oh wow! I didn't realize about the keyframes. Works great as soon as I added them. Further proof I need to learn about expressions and coding.

 

I'll give the other script a go as well but this solves my challenge either way. Thank you!