Page 1 of 1

Is it possible to create Composition Markers?

Posted: May 24th, 2007, 10:15 pm
by robtech2000
Hi all!

I'm doing a Javascript for After effects CS3.
I'm able to add layers and effects.

To access properties of layers:

Code: Select all

app.project.item(1).layer(1).effect("Blur").property("Blur Amount")
And Layer-time markers something like this:

Code: Select all

app.project.item(1).layer(1).marker
But, how can I add composition time markers?
Something like this?

Code: Select all

app.project.item(1).marker
I need to use composition time markers because my script will make a marker,
then the user will align some clips to that marker, and then the script will continue.

:?:

Can someone help me pleease.
I'm now trying to find some documentation in the After effects scripting guide.
Any help will be appreciated.
Thanks,
Robin.

Posted: May 25th, 2007, 3:09 am
by Mylenium
There's a keyframe to markers script floating around somewhere, maybe this can give you some ideas. I believe comp markers are read-only, though.

Mylenium

Re: Is it possible to create Composition Markers?

Posted: November 12th, 2008, 5:59 am
by strawdog
Hi guys,
Bit of a thread resurrection.
Related to the OP, I'm having no joy getting access to the composition markers from within a CS3 script - I would love to know if anyone else has managed to do this ?

It appears that you can query the number of comp markers as an expression:

Code: Select all

thisComp.marker.numKeys
But you can't seem to get access to any of the values ie.

Code: Select all

thisComp.marker.keyValue(1).comment
..doesn't work, which makes me wonder if these markers are even read only to scripts or expressions.

Cheers
Simon

Re: Is it possible to create Composition Markers?

Posted: November 12th, 2008, 6:24 am
by Paul Tuersley
You can access the marker info using an expression like:

Code: Select all

thisComp.marker.key(1).comment
So you could probably get a script to read the marker info by adding a temporary text layer and putting an expression in the source text, then read the result of the expression.

The scripting docs say the MarkerValue object represents a layer marker, nothing about comp markers, so I guess you're right that scripts can't access comp markers. But if you made sure all layers were deselected, you could add comp markers using:

Code: Select all

app.executeCommand(app.findMenuCommandId("Add Marker"));

Re: Is it possible to create Composition Markers?

Posted: November 12th, 2008, 1:09 pm
by strawdog
Neat.
Unlike the OP, I only wanted to read the comments out of the comp markers. I've since given up, and resorted to duping the markers into layers.