Skip to main content
Participant
December 28, 2011
Question

Is it possible to change "Layer Styles" properties such as "Color Overlay" in script ?

  • December 28, 2011
  • 3 replies
  • 4067 views

Hi Everyone!

Is it possible to change "Layer Styles" properties such as "Color Overlay" and "Gradient Overlay" in script ?

Thanks,

visuall

This topic has been closed for replies.

3 replies

Dhal_Naka
Inspiring
December 18, 2018

I have almost the same problem, but the answer has not been given here. I'd like to be able to read the gradient overlay values, I mean this (see picture below)

I need to gather those 4 gradient points values. Is that possible?

#target aftereffects

{

     var theComp = app.project.activeItem;

     var theLayer = theComp.selectedLayers[0];

     alert(theLayer.layerStyle.gradientOverlay.colors);
}

This exists, but I don't know which one the next step would be. I need to get inside colors, but "value" gives me an error.

zlovatt
Inspiring
December 20, 2018

Gradient data is not exposed to the scripting engine. The way things like Bodymovin access gradient data is by parsing your .aep file as text, searching for specific bits of the file, then scraping that data and turning it into knot/colour info.

A lot of work to get data out, but it's the only known way so far!

Known Participant
March 23, 2018

Yes it is possible

shapeLayer = pipComp.layers.addShape(); // adding a shape layer to the pipComp

shapeLayer.selected= true;

        app.executeCommand(9006); // add Fill Color

        var shapeColor = shapeLayer.property("ADBE Layer Styles").property("solidFill/enabled");

        shapeColor.canSetEnabled;

        shapeColor.property("solidFill/color").setValue([1,1,1,1]);

Legend
December 28, 2011

"Layer Styles" blend modes are read only. This was using the Stroke Layer Style.

app.project.item(1).layer("Layer Name").property("ADBE Layer Styles").property("frameFX/enabled").property("frameFX/mode2").value

You can read or write a comp layer blend mode though via:

Pg. 42 of Adobe CS3 After Effects Scripting Guide

AVLayer blendingMode attribute

app.project.item(index).layer(index).blendingMode

Description:

The blending mode of the layer.

Type:

A BlendingMode enumerated value; read/write. One of:

BlendingMode.ADD

BlendingMode.ALPHA_ADD

BlendingMode.CLASSIC_COLOR_BURN

BlendingMode.CLASSIC_COLOR_DODGE

BlendingMode.CLASSIC_DIFFERENCE

BlendingMode.COLOR

BlendingMode.COLOR_BURN

BlendingMode.COLOR_DODGE

BlendingMode.DANCING_DISSOLVE

BlendingMode.DARKEN

BlendingMode.DARKER_COLOR

BlendingMode.DIFFERENCE

BlendingMode.DISSOLVE

BlendingMode.EXCLUSION

BlendingMode.HARD_LIGHT

BlendingMode.HARD_MIX

BlendingMode.HUE

BlendingMode.LIGHTEN

BlendingMode.LIGHTER_COLOR

BlendingMode.LINEAR_BURN

BlendingMode.LINEAR_DODGE

BlendingMode.LINEAR_LIGHT

BlendingMode.LUMINESCENT_PREMUL

BlendingMode.LUMINOSITY

BlendingMode.MULTIPLY

BlendingMode.NORMAL

BlendingMode.OVERLAY

BlendingMode.PIN_LIGHT

BlendingMode.SATURATION

BlendingMode.SCREEN

BlendingMode.SILHOUETE_ALPHA

BlendingMode.SILHOUETTE_LUMA

BlendingMode.SOFT_LIGHT

BlendingMode.STENCIL_ALPHA

BlendingMode.STENCIL_LUMA

BlendingMode.VIVID_LIGHT