Forums › Adobe After Effects Expressions › Round corner on shape layer
-
Round corner on shape layer
-
Michelle Barralet
December 13, 2022 at 7:16 pmHi all
I’m creating a shape layer that extends as you type. There is an expression on the position and size currently to create this, so the shape layer needs to remain as a Path and not converted to a bezier path. In the drop down there are animatable parameters for roundness. I just want to round one corner of my shape layer. Is there an expression that will do this? I’ve attached grabs of the current set up and the single corner I want to curve. Any help would be greatly appreciated, I’m on day 2 of googling and can’t find exactly what I need!
-
Tomas Bumbulevičius
December 21, 2022 at 3:15 pmMichelle, the best way to make this work is to have a separate shape, smaller than your existing one, matched ideally with existing shape’s corner (just with roundness). There is no way to make one-only round corner with native roundness keeping the shape as rect, as far as I known. You could also create a new shape, and mask it out except the corner
-
Dan Ebberts
December 21, 2022 at 6:22 pmI think if you convert the rectangle to bezier and use this path expression, you won’t need the position or size expressions:
radius = 20;
p = content("Rectangle 1").transform.position;
L = thisComp.layer("more info");
r = L.sourceRectAtTime(time,false);
ul = fromComp(L.toComp([r.left,r.top]))-p;
ur = fromComp(L.toComp([r.left+r.width,r.top]))-p;
lr = fromComp(L.toComp([r.left+r.width,r.top+r.height]))-p;
ll = fromComp(L.toComp([r.left,r.top+r.height]))-p;
ur1 = [ur[0]-radius,ur[1]];
ur2 = [ur[0],ur[1]+radius];
t = radius*0.5525;
it = [[0,0],[-t,0],[0,-t],[0,0],[0,0]];
ot = [[0,0],[t,0],[0,t],[0,0],[0,0]];
createPath([ul,ur1,ur2,lr,ll],it,ot,true)
Log in to reply.