8
$\begingroup$

Is there a way to control parts of a node (that doesn't have inputs) with Group Input nodes?

ColorRamp

$\endgroup$
3
  • $\begingroup$ Nope. AFAIK this isn't supported. $\endgroup$
    – gandalf3
    Commented Sep 25, 2014 at 2:44
  • $\begingroup$ I am able to change the factor using a Driver Scripted Expression but even though the Pos slider seems to support this, I can't get it to have any effect for that particular field. I have not put much effort into drivers yet so maybe someone who has can figure this out. You can use animation keyframes for the Pos field. $\endgroup$ Commented Sep 25, 2014 at 20:45
  • $\begingroup$ Related: blender.stackexchange.com/questions/40770/…. $\endgroup$
    – PGmath
    Commented Dec 16, 2015 at 3:42

2 Answers 2

8
$\begingroup$

So far as the method addressed in the question, I think the C-Code would have to be changed for that to work. Maybe with Python but I'm not sure about that.

This field can be manipulated using Drivers and Scripted Expressions.

One way to do this would be to add an Empty.

enter image description here

Next keyframe the empty at t=0 then move the timeline to the end of the animation and the empty 1 unit to the right along the X-axis.

enter image description here

Now add a driver to the Step Field of the Color Ramp by hovering over the value and pressing 'd'.

Open the graph Editor and change the value in the expression field to be 'var' as seen in the image below. Also, add the Empty as the Object to the default Variable field and change the Type to X Location so when the Empty moves to the right, it will change the driven value accordingly. (I had to add a default modifier to get this to work for the Pos field which may be a bug since it now continues to work after I delete the modifier.

enter image description here

Here it is animated. The reason I am moving the mouse cursor around in the Node Editor is because this updates the UI and the animated values can be seen to move.

enter image description here

With a bit of creativity, maybe you can find a way to use drivers to do what you were planning on doing with the socket input... you didn't say what would be driving the socket so we can only guess at this part.

Some thoughts I'd like to add to this. I believe, (at least according to my understanding which is very limited here) that this will be per-object since I don't know of a way to make drivers work on a per-vertex basis and especially not on a per-fragment basis which excludes a lot of the refinement which a shader-based control would offer.

It may be possible to duplicate an object and give it the same material but make it invisible and alter it's shape in order to affect shader input values like Geometry->Position and if I come up with anything like then I will append this method to the Answer.
If anyone else does think of something like this, feel free to piggy-back a second answer based on what I've shown here as a starting point so that this page can become a more comprehensive piece of documentation. I'll vote up any answers that are useful even though this has been chosen as the solution.

$\endgroup$
4
$\begingroup$

Blender 2.81 introduced a "Map Range" node which is essentially the same as a color ramp node with two stops which both have grayscale values.

The "Map Range" node has 5 inputs.

The "Value" which is the same as the input of the color ramp.

The "From Min" and "From Max" inputs are the left and right position, between 0 and 1.

The "To Min" and "To Max" inputs are the rgb value of the left and right stops.

enter image description here

$\endgroup$

You must log in to answer this question.

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