Skip to main content
Dhal_Naka
Inspiring
December 18, 2018
Answered

Gather a layer style gradient overlay colours data

  • December 18, 2018
  • 1 reply
  • 725 views

Hi!

I don't know if this is possible but I would need to gather this data:

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. How could I do it?

This topic has been closed for replies.
Correct answer UQg

Scripts can read property values only if their propertyValueType is not PropertyValueType.CUSTOM or PropertyValueType.NO_VALUE.

For these exceptionnal types, there is no javascript object designed to hold the actual value.

If you inspect a CUSTOM / NO_VALUE property in the estk data browser, you see: value = null, but if you try to access the value by script (myProp.value), you get an error.

Gradients fall in the wrong category (propertyValueType is : PropertyValueType.NO_VALUE.).

Xavier

1 reply

UQg
UQgCorrect answer
Legend
December 18, 2018

Scripts can read property values only if their propertyValueType is not PropertyValueType.CUSTOM or PropertyValueType.NO_VALUE.

For these exceptionnal types, there is no javascript object designed to hold the actual value.

If you inspect a CUSTOM / NO_VALUE property in the estk data browser, you see: value = null, but if you try to access the value by script (myProp.value), you get an error.

Gradients fall in the wrong category (propertyValueType is : PropertyValueType.NO_VALUE.).

Xavier

Dhal_Naka
Dhal_NakaAuthor
Inspiring
December 18, 2018

So there is no way... such a pity

Thanks Xavier!