# Trying to make a driver based on rotation; -1/1 shape key problems and other

I have a driver that essentially moves vertices out of the way of an object as it’s rotating;

VentThing_Upl.blend (902.5 KB)

Picture: A square with 4 rods that are attempting to push towards the center of the square.
I made a shape key so that the vertices simply appear to move out of the way of the square as the longest points rotate towards them. It works in one direction… for one rotation… but then breaks and cannot go in the other direction because it returns a negative value. Is there any way to get it to go in both directions? I’d imagine I need to run a short python if statement in the expression for that?

The Shape key currently gets: 4*var/pi (which actually only works for 1 45° turn). How can I make this works both infinitely on each 45°/90° turn and in both directions?

If you want it to increase the shapekey regardless of direction of rotation, use

4*abs(var)/pi

instead. “abs()” is a Python function meaning “absolute value” so turns negative numbers into positive numbers.

1 Like

And as far as working for everything-- well, really, you should be thinking about use of armatures instead of shapekeys here, it would be easier. Shapekeys are not going to match the proper shape. (Although one alternative would be a live boolean.)

Although if you’d like, you can make specific curves for you driver like so:

Notice the curve on the driver editor viewport. I added another control to that curve, so that it goes from 0 to 1 to 0. You’ll usually want to disable frame-snapping when editing driver f-curves like this.

1 Like

Ok you got me curious now, what is the armature setup? I barely use armatures.

I’d probably create two bones for each blade, one static, and one with a shrinkwrap constraint, on project, targeting the pan:

2 Likes