Skip to main content
swrutherford
Inspiring
May 16, 2023
Open for Voting

Request: Gradient start/end points relative to layer position

  • May 16, 2023
  • 2 replies
  • 987 views

I would like to see the ability to toggle absolute/relative position of the start/end points of a gradient. 

The current system has you pick an x/y position within the composition (absolute values). I would like the option within the effect itself to use these composition coordinates or lock them with the layer (relative positioning) so that - when moving the layer's position - it doesn't fly through the gradient. 

Yes, I know an easy expression can handle this. For example:

x=transform.position[0];
y=transform.position[1]-100;
[x,y]

The point at which it becomes tricky is when layers are parented to each other. The child's layer position becomes relative to the parent layer's position, the expression would effectively revert the effect to an absolute position. Yes, you can add other expression controls to make the "offset" variable (instead of "100" in the above expression), but depending on how many layers you're working with, this becomes a large time suck.

My thought is to have a simple drop-down next to the "Position" settings within the effect to be Absolute  (to Comp) or Relative (to Layer). Then you could specify the ± x/y where you want the gradient to begin/end. 

I've added two reference animations in case I'm not communicating properly.

First, in gradient_test, the "relative" version utilized the expression above (with different y offsets) for the gradient's begin/end.

In gradient_test_2, both layers are utilizing the basic expression above (with different offsets for y), but the child layer looks like it's absolute due to the position properties being relative to the parent layer.

 

2 replies

swrutherford
Inspiring
May 16, 2023

@JohnColombo17100380 Thank you for the reply and the simpler expression. I ended up getting what I needed, but it involved an extra slider control to help the layers offset rather than parenting 😉

I appreciate you taking time to review the request.

Stephen
JohnColombo17100380
Community Manager
Community Manager
May 16, 2023

Hi @swrutherford,

Thanks very much for making this feature request. It definitely would be great to simplify how positional effect points are handled for the case you've described and shown in the videos.

 

From my experience, this unwanted behavior, where the effect points remain stationary in composition space while the layer is moved, only occurs with Text and Shapes (or continuously rasterized footage layers). This is because due to how effects are currently handled in the rendering order for those layer types.

 

Using expressions is certainly the best workaround at the moment. However, rather than hardcoding values and dealing with unwanted shifts when parenting, you can use this simple expression on any effect point to allow it to maintain the location you've set for it on a Text/Shape layer: 

toComp(value - anchorPoint)

After setting the expression, you'll need to reposition the effect points, but they will retain their location after that, even when keyframed, while the layer with the effect is moved around.

 

Thanks again for making this request,

- John, After Effects Engineering Team