In after effects, write an expression to add to the path property of a shape layer so…
- User
In after effects, write an expression to add to the path property of a shape layer so that it draws a 500x500 PX square and the top right corner is rounded
Assistant
Here is an expression that will draw a 500x500 pixel square with a rounded top right corner on a shape layer's path property:
var s = thisComp.layer("Shape Layer 1").sourceRectAtTime(); var w = s.width; var h = s.height; var r = 50; // radius of rounded corner var cp = "M0,0 l"+(w-r)+",0 q"+r+","+r+" 0,"+r+" l0,"+(h-r)+" q0,"+r+" -"+r+","+r+" l-"+(w-r)+",0 l0,-"+h+"z"; cp;Breakdown:
sgets the source bounds of the shape layer, so we can base the path size on the layer sizewandhstore the width and heightris the radius of the rounded corner
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.