Is it possible to create Composition Markers?

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
robtech2000
Posts: 1
Joined: May 24th, 2007, 12:16 pm
Location: India

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.
Mylenium
Posts: 139
Joined: July 20th, 2005, 12:07 am

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
[Pour Mylène, ange sur terre]
strawdog
Posts: 5
Joined: November 10th, 2008, 9:35 am

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
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

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"));
strawdog
Posts: 5
Joined: November 10th, 2008, 9:35 am

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.
Post Reply