0
$\begingroup$

enter image description here

I am animating multiple objects with different sine waves, but all of them should have the same phase multiplier. I am trying to declare a "global variable" that all the different objects share. I can set the value there and that can be used by all my objects. Somebody told me to "add a driver", but right-clicking this field does not give me the option to add a driver. Any tips?

$\endgroup$

1 Answer 1

1
$\begingroup$

you can't animate or drive those modifiers... a workaround would be to use a script, if you have many objects it could help you test different setups, but not so much if you need to animate the value... there may be other ways, what do you want to achieve?

value = 0.5

import bpy
sel = bpy.context.selected_objects
ani = [o for o in sel if o.animation_data]

for ob in ani:
    for cu in ob.animation_data.action.fcurves:
        for mod in cu.modifiers:
            try: mod.phase_multiplier = value
            except: pass
$\endgroup$
2
  • $\begingroup$ I think your script solution works fine for me. I don't want to animate it. I just wanted like a central place where I can edit the value and speed up or slow down the animation, instead of editing it six different times. I anyway did manage a better way to do all that with a lot of changes in my animation strategy. $\endgroup$ Mar 7, 2022 at 19:19
  • $\begingroup$ ok, glad you solved it $\endgroup$
    – alambre
    Mar 8, 2022 at 4:50

You must log in to answer this question.

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