Copy link to clipboard
Copied
Hi, I've been searching and Googling around and still haven't gotten a clear answer as to whether or not the following setup is possible.
You have two layers, Layer A and Layer B next to eachother. The goal is to animate both of their positions, but make it so that Layer A's x position is limited to Layer B's position, even though they're both moving (Layer A would stop and be clamped to Layer B's X position when it runs into it). My understanding of the clamp expression is that you should do the following:
Put a clamp expression on Layer A's position
Clamp is an array (value, min, max)
Depending on whether Layer A or Layer B was on the left or right of eachother, you would highlight the min or max value in the clamp expression and pickwhip it to the x value of Layer B.
..And this would effectively make it so that if both Layers were next to eachother and moving in circle simultaneously, and those motion paths overlapped, Layer A would run into Layer B and be clamped to its moving X position until their motion paths didn't overlap anymore.
I think I may be missing some fundamental understanding of how the clamp expression works, and how you differentiate between clamping X and Y axes individually and clamping the entire position.. just surprisingly haven't found any documentation that clarifies this. Any help is much appreciated.
I think I may be missing some fundamental understanding of how the clamp expression works
Yes, you have. You cannot just pickwhip a single internal value of the expression. An expression always modifies the entire property stream value and that can be either the min or max in this case. So unless your value range encompasses the full diameter of the circle and realyl only clips on one side, both values could occur. that being the case, you also could not move the circles around and dynamically sh
...Copy link to clipboard
Copied
I think I may be missing some fundamental understanding of how the clamp expression works
Yes, you have. You cannot just pickwhip a single internal value of the expression. An expression always modifies the entire property stream value and that can be either the min or max in this case. So unless your value range encompasses the full diameter of the circle and realyl only clips on one side, both values could occur. that being the case, you also could not move the circles around and dynamically shift positions because then obviously you change the conditions and run into the same issue. If you realyl wanted that, you'd have to create a much more convoluted expression based on vector math testing proximity and intersections, a.k.a. collision detection.
Mylenium
Copy link to clipboard
Copied
Start here: Dan Ebberts's Expressioneering Design Guide
Copy link to clipboard
Copied
Gotta piggy back on this one.. can you somehow clamp an object on a path or curve? For example have a skier sliding and bouncing down the sode of a mountain.. the slope/side of the mountain would be the path that the skier is clamped to