5
$\begingroup$

Lately, I've been doing a lot of animation with binary values: things such as changing the visibility of an object, changing the value of a constraint from 0 to 1, etc. The way I'm doing this currently is by, on one frame, keyframing it, then on the next frame, changing the value and adding a new keyframe. But, since there aren't actually any frames in between the keyframes, this seems like a weird way to do it. Is there any better way? Or is this how it's done? Are there any add-ons that make this more elegant?

$\endgroup$
3
  • $\begingroup$ You don't have to put a "holding" keyframe before each one. Binary values will only change on the keyframe, not before it. $\endgroup$
    – PGmath
    Nov 18, 2015 at 3:50
  • $\begingroup$ If you want to alternate a value between every other frame use the Math node and select Modulo with "2" as the second value... ;-) $\endgroup$
    – Samoth
    Nov 18, 2015 at 16:49
  • $\begingroup$ @Samoth just in case I want to give anybody who watches my animation a seizure? $\endgroup$ Nov 18, 2015 at 23:56

2 Answers 2

9
$\begingroup$

When keyframing binary values there is no need to include a "holding" keyframe as you have described before each change. Blender knows to only switch the value at the keyframe since there is no way to interpolate a boolean.

enter image description here

In the above example I have visibility keyframes at frames 1, 15, 30, and 40. Notice that I don't need keyframes at frames 14, 29, and 39 to make sure that it stays constant up until those frames.

$\endgroup$
2
  • $\begingroup$ I thought this whole time that it would "interpolate" it the best it could and change the value halfway between the last keyframe! I guess blender is smart...like usual. Thanks! $\endgroup$ Nov 18, 2015 at 4:23
  • $\begingroup$ @markasoftware TBH, I did too until you asked and I tried it out! $\endgroup$
    – PGmath
    Nov 18, 2015 at 4:25
6
$\begingroup$

As PGmath noted there is no need to do anything special for binary values.

Howerver, if you ever deal with values that are not binary, the "elegant" solution you need is setting the Interpolation Mode to Constant . That way there will be no values in between the ones set for the keyframes:

enter image description here

To access the interpolation options select the keyframes you want to affect and press T (or on the menu select Key->Interpolation)

$\endgroup$
1
  • 1
    $\begingroup$ probably more of a comment than an answer, since the main part of the question is already answered...but I guess I'll +1 anyways $\endgroup$ Nov 18, 2015 at 4:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .