3
$\begingroup$

I want to set a min and max influence range using a driver for the copy rotation constraint. I've tinkered with the driver graph in graph editor but it's too delicate to set my specific range --between 0.499 and 0.97. So when I manipulate the target object in the scene--a slide control bar--up and down, it sets the copy rotation influence between 0.499 and 0.96. The default range is between 0.0 and 1.0 when I slide the control bar targeted by driver.


This is graph editor screenshot with scripted expression from answer. Driver holds influence value at 0.499 but does not increase to 0.96 when targeted slide control is moved along Z axis

$\endgroup$
1

1 Answer 1

6
$\begingroup$

You can use a scripted expression, using min() and max() functions.

Let's say you're driving this from the Z position of an empty, the variable for which is named var.

Then if you use an expression like "min(0.96, max(var, 0.499))" then you will get 0.96 if var is greater than 0.96 (because the minimum value of the two is 0.96), 0.499 if var is less than that (the maximum of the two values), and var if var is in between those two values.

enter image description here

It's also possible to do this by editing the driver curve, using vector handles for the controls, but I just use scripted expressions for this kind of thing.

$\endgroup$
7
  • $\begingroup$ Wow, thanks for quick answer especially on 4th of July! I copied and pasted expression into scripted expression field (I'm using v2.79 btw). Influence sets at 0.499 but does not change when I move slider control. Am I doing something wrong? $\endgroup$ Commented Jul 5, 2021 at 6:34
  • $\begingroup$ I can upload a screenshot of blender control panels if you tell me how...sorry $\endgroup$ Commented Jul 5, 2021 at 6:41
  • $\begingroup$ @Dino808 I couldn't tell you without seeing a file or picture. You can edit your question and copy/paste an image with your cursor in the edit field to upload a pic to SE. $\endgroup$ Commented Jul 5, 2021 at 6:47
  • $\begingroup$ I had to answer my own question to paste screenshot above. $\endgroup$ Commented Jul 5, 2021 at 7:35
  • $\begingroup$ Looks like moderator moved screenshot to original question post $\endgroup$ Commented Jul 5, 2021 at 11:30

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.