6
$\begingroup$

this isn't necessary, but would definitely help save time & frustration for housekeeping/troubleshooting on my procedural materials.

I'd like to be able to put a limiter on a node input field so that it would functionally stop at specific minimum and maximum positions--not unlike many existing node fields such as texture detail: 0,15; or generative texture Randomness: 0,1.

While I use a Map Range node to functionally remap this range , I'd like to, in addition, prevent the actual value field from being manipulated beyond the remapped range when click-dragging across the input. Can I limit a MR node value field or a Value node value field (or any other node field for that matter)?

Does anyone know of a (preferably low-cost) way of doing this?

$\endgroup$
5
  • 1
    $\begingroup$ Taiyo's way is probably the best, especially under the "low-cost" request. Other alternatives than already mentioned Map Range: Math minimum and maximum, ColorRamp, Float Curve and similar nodes. $\endgroup$ Commented Jul 6, 2023 at 10:07
  • $\begingroup$ Thank you, @Markus von Broady! Taiyo's way is the answer. The other alternatives will limit the signal, but they're not what I was looking for: I wanted a way to limit the value itself, rather than the resulting math. I could better describe it as a potentiometer (or electric knob if I'm using the term incorrectly): some will come to a hard stop when you turn them to their maximums and minimums and some will turn infinitely past the limits. Both will limit a signal that they send, but one of them gives you feedback to "feel" the limit and that's what I was nitpicking. Cheers! $\endgroup$
    – sevens
    Commented Jul 6, 2023 at 18:03
  • 1
    $\begingroup$ This is why I listed a float curve and a colorramp, where the interface also has a limit, though for the latter it can't be changed. $\endgroup$ Commented Jul 6, 2023 at 18:04
  • $\begingroup$ Ah! I'm not familiar with the float curve node, but I use a lot of Color Ramp nodes as limiters, though I find them awkward and finicky, (in this case I was actually using the Value node -> Mapping -> Math multiplier to fine tune a Color Ramp that manipulated a Gradient Texture). Too many Color Ramps in one NG is surprisingly hard on my concentration and focus & I prefer the feedback of the number value being prominent in the field. Thanks for the clarification, I will check out the float curve! $\endgroup$
    – sevens
    Commented Jul 6, 2023 at 18:15
  • $\begingroup$ anyone know how to do it for geometry nodes? snipboard.io/dG5nia.jpg $\endgroup$
    – Harry McKenzie
    Commented Mar 11 at 1:09

1 Answer 1

6
$\begingroup$

You can utilize Node Groups for that (dont know if there is a shorter way). In a node group you have control over the input and output values. Create some node, right-click it and select Make Group. Now within this group node you can put constraints on the input and output values with Default, Min, Max (you can also rename the fields and group, manage the in/outputs and so on). If you dont need the actual node with which you created the node group, you can remove it, so you are just left with an "empty" node group. If you dont find the node menu, its hidden behind the (very) small < in the top right corner of the shader editor. Additionally, to leave the node group again, click the upward arrow icon. In the screenshot, the input field MyValue of the node group NodeGroup behaves now like you want.

enter image description here

enter image description here

$\endgroup$
7
  • $\begingroup$ This is the answer! It's too bad that we can't do the same to nodes themselves, but that might also become a housekeeping nightmare. $\endgroup$
    – sevens
    Commented Jul 6, 2023 at 17:31
  • 1
    $\begingroup$ Oops, I accidentally entered the comment before finishing: Thank you! With your advice I put everything into a Node Group, removed the Value node and used a NG Input with limits to noodle a Mapping node that remapped the 0,5 range value to what was needed for my multiplier (Math) node. To add to your reply for others: 'N' will toggle the popup menu on the right and there should be labelled tabs along the right side that can be clicked for the appropriate context ("Node" in this case) $\endgroup$
    – sevens
    Commented Jul 6, 2023 at 17:50
  • $\begingroup$ this doesn't work for geometry nodes snipboard.io/dG5nia.jpg $\endgroup$
    – Harry McKenzie
    Commented Mar 11 at 1:08
  • $\begingroup$ @HarryMcKenzie the setup in your image works for me in Blender 4.0. Maybe a Blender 3.x version bug? Edit: works only when clicking on the arrows, not when typing a value directly into it. $\endgroup$
    – taiyo
    Commented Mar 16 at 13:17
  • $\begingroup$ @taiyo should i file a bug report or do you think there is already a ticket for this? $\endgroup$
    – Harry McKenzie
    Commented Mar 17 at 1:16

You must log in to answer this question.

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