Can I control an f-curve modifier with a driver?

Basically, I’ve applied a noise modifier to a transform channel in the graph editor, and I would like to drive the strength of the modifier with a custom attribute on a different object. Unfortunately, when I right-click on the “Strength” channel of the modifier, I see no option to add a driver. Is what I’m attempting possible? How would I achieve this?

Thanks!

Get rid of the noise modifier and add the driver to the transform channel directly. Then use a python noise function, from import random, to emulate what the noise modifier was doing along with whatever else needs to be calculated for that channel.

I’ll try that when I get into work, but i how do I control the amount of noise with a driver? What your suggesting sounds like a different way to set up a noise modifier, but I don’t think you can control that noise function with another driver can you?

I’ve set up a custom property on a control curve. I want to be able to dial a value on the control that controls the amount of noise on the channels, but I’m getting really stuck. It doesn’t help that I’m not good at math… Like… At all. :slight_smile:

Thanks for the help!

Just think of it as adding two numbers together. Create a variable to calculate the ‘real’ work of the driver. Then create another variable that generates a random noise value. Now that you have two values add them together. If you need to scale the value of the noise that would be a multiplication of the noise before the addition.


def my_driver_processor(my_random_scale_value)
    # NOTE: my_random_scale_value could be passed to the driver func from a custom property that is animated on another object..?
    true_work = my_func_makes_magic_value(var)
    noise = random.random() * my_random_scale_value

    return true_work + noise

I’m afraid this is way beyond my knowledge at the moment. I’m getting the gist of what you are suggesting, but there’s a lot of fundamental things here I just don’t know so I don’t even know where to start. If I add a driver to a channel, go to the graph editor and look at the driver there, I get a lot of options (like scripted expression), but how do I control any of this? I know how to set up basic relationships (like one transform channel controlling another), but this seems to be controlling a channel with a python script? And is there a python function that provides all the functionality of the noise modifier? Simply adding noise to a channel (not that I even know how to do that) would just return a random value and insert it, wouldn’t it? I need this to behave a like a noise modifier, where random values are added over time and has controls for scale and strength over time. Is there really no way to control noise modifier values with a driver? Do I have to code my own custom noise function in Python?
Sorry for my lack of knowledge on this subject. I really want to learn how to tackle rigging problems like this in blender, but I think I’m missing some important steps here. :slight_smile:
Thanks!

Add a custom var named noise, put the noise modifier on this
Add a custom var named amp use this to amplify the noise

Set up a driver on the transform property with amp * noise

Example driving z loc of cube.

Note: as in your OP, the amp could be a custom property on another object.

Attachments

noise2.blend (85.3 KB)

AWESOME! I think that will be exactly what I need. Thanks for the blend! It’s helping make sense of the approach.

Ok, I implemented the technique that was shown in the blend file and it works great with one issue. It doesn’t seem to be possible to properly animate the custom amp value. What I would like to do is animate the amp value over time, but when I do, the noise seems to “pop” from one integer to the next. The example text blend animates perfectly fine, but mine pops. Which leads me to believe that my custom attributes are integer values, not float, and I know of no way to make them float values. I might be wrong here, but that’s the behavior I’m getting. Any ideas? Thanks!

EDIT: Looking at the animation curve on the custom attributes, I am definitely getting a “stepped” appearance to the animation curve. But I can’t figure out how to “unstep” it. I’ve set the keyframes to bezier handle types in the graph editor, but it changes nothing. And I can’t enter any value other than an integer into the properties panel value.

EDIT #2:
Ok, it appears that if you set your custom property to a default value of 0, it becomes an integer slider. Weird behavior. But at least i’ve fixed the issue.

Click the edit button on the custom property panel for the amp prop. Make all entries floats. Especially prop value. (eg 1.0 rather than 1) Change the min / max to suit your animation too. (Make sure they are floats as well). Make sure you hit the OK button or nothing is saved.

Simple to check by dragging the slider.