Highlighted

AE – Scripting — Setting Marker Keys Duration

New Here ,
Sep 29, 2020

Copy link to clipboard

Copied

Hello there,

 

I need to set the marker key duration via script, but can't find a way.

 

Am I missing something or is it not possible to set marker's keys duration from a script?

It seems only natural that one should be able to set its value.

 

Something along these lines (which I know it doesn't work):

    var mKey = layer.marker.keyValue(index);

    mKey.duration = d;
 
If not possible at this time, this would be very useful feature.
 
Thanks,
N

Jumped the gun. This works:

    var markerValue = new MarkerValue("Comment");
    markerValue.duration = d;
    layer.property("Marker").setValueAtTime(time, markerValue);
TOPICS
How to, Scripting

Views

63

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

AE – Scripting — Setting Marker Keys Duration

New Here ,
Sep 29, 2020

Copy link to clipboard

Copied

Hello there,

 

I need to set the marker key duration via script, but can't find a way.

 

Am I missing something or is it not possible to set marker's keys duration from a script?

It seems only natural that one should be able to set its value.

 

Something along these lines (which I know it doesn't work):

    var mKey = layer.marker.keyValue(index);

    mKey.duration = d;
 
If not possible at this time, this would be very useful feature.
 
Thanks,
N

Jumped the gun. This works:

    var markerValue = new MarkerValue("Comment");
    markerValue.duration = d;
    layer.property("Marker").setValueAtTime(time, markerValue);
TOPICS
How to, Scripting

Views

64

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 29, 2020 0
New Here ,
Sep 29, 2020

Copy link to clipboard

Copied

Jumped the gun. This works:

    var markerValue = new MarkerValue("Comment");
    markerValue.duration = d;
    layer.property("Marker").setValueAtTime(time, markerValue);

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 29, 2020 0
Adobe Community Professional ,
Sep 30, 2020

Copy link to clipboard

Copied

Yes, in general for properties, when you read them you get a copy. So to apply the change, you always need to set the value again with setValueAtTime or setValuesAtTimes. That's also a pitfall when working with shapes, for example.
Thanks for sharing your solution!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 30, 2020 1