3
$\begingroup$

You can do this with drivers, and I've seen multiple blender channels that use an empty to control the value of multiple lights.

i was wondering how i would use drivers to control the value of multiple math nodes within the margin of -1 to 2 with an empty's z location. the reason i want to do this is because i need to control the transparency factor of multiple objects but only in the viewport so that means not an animation. also, what i mean by "within the margin of -1 to 2" is that if i move the empty up then the value will only increase up to the value of 2 then after that point, no matter how much i move the empty up, the value wont go past 2.. and same with the -1 value.

there is an equation out there that lets us do this but i have yet to find it. :( you don't have to tell me the whole equation i just need some better insight on how i would achieve this or maybe someone's experience using a similar driver setup in there own projects. thanks.

$\endgroup$
1
  • 1
    $\begingroup$ If you need to share @Jachym's answer between multiple materials, it might be a good idea to put it in a Node Group. Then it's instanced: If you tweak the settings in one material, it will be tweaked in them all. $\endgroup$ Oct 13 '20 at 8:13
5
$\begingroup$

Simply use the Map Range node to clamp the results between -1 and 2.

  1. Add a Map Range node with min = -1 and max = 2 values
  2. Check Clamp
  3. Select your empty's Z location and go RMB > Copy Driver
  4. Paste the driver to the Value field of the Map Range node.

The Result of the map range is shown here as a slider

enter image description here

$\endgroup$
4
  • 2
    $\begingroup$ Perfect, minimal, descriptive, illustration, IMO.. :) $\endgroup$ Oct 13 '20 at 8:10
  • $\begingroup$ Learned from the betts :). $\endgroup$ Oct 13 '20 at 8:21
  • $\begingroup$ thank you so much this is the answer i needed! it worked just as i wanted it to! you're a life saver. $\endgroup$ Oct 13 '20 at 16:15
  • $\begingroup$ You're welcome :). This kind of response is why i love this site. Have a great day :). $\endgroup$ Oct 13 '20 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.