Specific/custom driver expression

Hello all! This is my first post here, so hopefully I’m in the right spot/category. My question involves scripted expressions under drivers. I’ll try my best to explain the situation.
I have an imported Daz character whose skin sweat amount I want to control using a custom bone I created on the rig. I’m achieving this by creating a group node which has a value run through a clamp with 0 and 1 as its min/max. I then route this group’s output into each of the body materials’ Daz Top Coat or Dual Lobe roughness values, and have the value set with a driver that uses the custom bone’s (Skin Sweat Control) Z location. The bone has a Limit Distance constraint on the Z axis from 0 to 1 for simplicity. The expression that I found works generally from a 0 to 1 distance is var * 3.3. I’m using Imperial units instead of Metric, so this is probably why the odd number, as I think 3.3 is the equivalent of 1 between the two (I could be wrong). Anyhow, it works wonderfully this way, except that the driver is working in the wrong “direction”. What I need is the value to start at 1 instead of 0, and then as I move the Skin Sweat Control bone up, the value decreases. So basically, the inverse of var * 3.3? I tried switching the min and max values of the clamp node, and var * -3.3, but nothing worked. Math wasn’t exactly my strong point in college, especially Statistics. I still have nightmares about Bell Curves chasing me. Anyhow, if what I’m trying to do is possible, I’d appreciate any help! Apologies for the long post, but I wanted to be as descriptive as possible.

1.0 - (var * 3.3)
if (var * 3.3) is 0, then the result of 1-0 is 1; as (var * 3.3) increases, the result decreases, and when (var * 3.3) reaches 1, then the result becomes 1-1 => 0.

but better than 3.3 it would be 3.2808399 (number of feets in 1 meter)

2 Likes

Secrop, thank you soooo much! I will be doing this immediately (I currently have a model open in-work). Perfect timing!