Copy link to clipboard
Copied
I can't find anything in the docs that lists the properties of a gradient (and x.reflect doesn't work any more since Adobe binned Extendscript, it seems). I've got something like this -
thisComp.layer("circle_bg").content("e3").content("Gradient Fill 1").colors
I want to go into this colors object and be able to set the position of the start and end knot of the gradient. Is this possible?
Thanks!
Copy link to clipboard
Copied
You can use expressions on the Start Point and End Point of the Gradient Fill object, but at the moment it's not possible to apply expressions to the Colors object. Seems like this would be a useful function though, especially if you wanted several gradients to match a master fill.
One workaround for more control is to use the Gradient Ramp or 4-Color Gradient effects, which allow you to control the colors individually, but that can be clunky and overcomplicated.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
What final effect are you trying to create? The API for Gradient Fill may be useless, but there are other ways to create a graduated color which could be more scriptable (adjustment layers with blurred masks/tints/glows, etc.)
Copy link to clipboard
Copied
I'm basically trying to control the position of the left-hand knot. This shape on the left is formed of 4 different shape groups on one layer, with the radii controlled by sliders. I'd like the yellowy gradient to always start from the edge of the second ellipse, irrespective of the relative radii of each ellipse.
If there were some property like
[...].content("Gradient Fill 1").colors.knots[0] it would make this easy!
Copy link to clipboard
Copied
Hi, I am also looking for something similar. I aslo wonder if there is a way to use the expression change the first gradient color?
Copy link to clipboard
Copied
You still can't do any of that and that is that, as they say.
Mylenium
Copy link to clipboard
Copied
Use a Gradient effects like Gradient Ramp or 4 color gradient. Is the only way to map the gradients color, would be great in the future have more control on this.
Good look