Hello. I have sine modifier on x-location channel. I would like to use drivers to control some values like amplitude, phase offset etc. Is it impossible in blender? Because when I right click on slider there is no option to add driver. Heck there is even no option to add keyframes to animate values. Am I missing something and if not is there some workaround to control modifier values over time?
I don’t know of any sliders for f-curve modifiers. The same panel where you make the modifier should have some fairly obvious parameters which include amplitude and phase offset.
Oh, I see what you’re saying. No, in general, you cannot keyframe f-curve modifiers or drive them.
But if you want to drive something, you don’t need to use f-curve modifiers. You’d just use a straight driver. As an example of a driver that was the sine of frame, with amplitude and offset, you might use a scripted expression like:
where a is amplitude, frame is the current frame count, and o is phase offset.
If you wanted to keyframe a or o, these could be variables in the driver rather than constants. For example, you might use the location of a keyframed empty to provide these values.
If you wanted the modifier in additive mode, then you’d want the base keyframes on some other object, and then you’d use an expression like f+a*sin(frame+o) where f is the base f-curve value, again, as a driver variable.
Thank you very much. Basicly I want to drive amplitude by distance between two bones A and B so closer bone A to bone B amplitide should be less and vice versa. Would you be so kind to show me example of such set up. Expressions with drivers are too hard to me to get working as I want. That’s why I hoped there is simple option to add drivers to those options as I usually do without expressions,
Thank you once again…
P.S. Ok I’ve managed to set up such drivers with variables using your expression, but I need phase multiplier what is expression for it?
Here it is with amplitude driven by the distance between two empties:
sindriver.blend (809.9 KB)
You could parent those empties to bones, or you could designate bones as the objects used for the driver, in the driver editor, which I have open. You can see that it’s just the expression I offered, copy/pasted, with offset assigned a constant of 0.
If you need phase multiplier, the expression is
a * sin(p * frame+o)
where p is the phase multiplier.
It was very helpfull. Thank you very much.
Should be said, you don’t want to animate the phase multiplier. It will lead to discontinuous behavior.