Skip to main content
Known Participant
August 6, 2022
Answered

How to set the start frame (or time) of a composition in Automation Blocks

  • August 6, 2022
  • 2 replies
  • 1331 views

I was trying to set the start frame of the active composition (where the start frame is 1000) using:

 

set attribute time of project item active composition to 0

 

When I run the script, I'm not seeing any change, and the console shows:

 

"execution result:undefined

destructor final end point 'main script' reached"

This topic has been closed for replies.
Correct answer Mathias Moehl

The time attribute of project items is the location of the playhead. If you want to change the start timecode of the composition, you need to set the display start frame or display start time (s) which you find in the "set attribute of comp" instead of the "set attribute of project item" block (since it can onl be changed for comps and not for other project items.

Also note that in Ae scripting in general and also in Automation Blocks, internally the beginning of the comp is always time 0. This means when you work with time values, you can always rely on 0 being the beginning of the comp and the "display start value" is only a cosmetic thing that Ae adds when showing time values in the user interface.

2 replies

Mathias Moehl
Community Expert
Community Expert
August 6, 2022

Oh, and a few words to the console output - this is the typical output when the script finished without any issue, here is exactly what it means:

 

"execution result:undefined"
The execution result is the value that the last executed block produced. For many blocks the "result" is undefined. If you put a "get attribute time of item" attribute at the bottom of your script, it would show the retrieved time value of the attribute instead of undefined, for eample.

 

"destructor final end point 'main script' reached"
This shows that the script exection is completely finished. In the (not yet published) Premiere Pro version of Automation Blocks, you can write scripts which wait for the render queue to finish and then perform additional tasks. Those scripts then have several "end points" - i.e. at some point the end of the 'main code' is reached, but it is not the 'final end point' yet, since the script is still waiting for the render queue to finish and plans to execute more code once that happened. In those cases, the console messages will be different and inform you that the code is still waiting for more "end points".

 

 

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Mathias Moehl
Community Expert
Mathias MoehlCommunity ExpertCorrect answer
Community Expert
August 6, 2022

The time attribute of project items is the location of the playhead. If you want to change the start timecode of the composition, you need to set the display start frame or display start time (s) which you find in the "set attribute of comp" instead of the "set attribute of project item" block (since it can onl be changed for comps and not for other project items.

Also note that in Ae scripting in general and also in Automation Blocks, internally the beginning of the comp is always time 0. This means when you work with time values, you can always rely on 0 being the beginning of the comp and the "display start value" is only a cosmetic thing that Ae adds when showing time values in the user interface.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
ckuehneAuthor
Known Participant
August 6, 2022

Fantastic! That worked! Thank you!