Page 1 of 1

Help setting the render duration

Posted: Sat Sep 02, 2017 10:01 am
by joeRaider
I am trying to set up a render duration that can be controlled by how many pages are defined in the project, where each page has a defined duration.
I am somewhat new to expressions and I do not understand where I should put the expression so it executes when I render. I am controlling the page durations with time-remapping expressions in a nested comp. Any help is greatly appreciated.
here is my expression:

var fps = 1/ thisComp.frameDuration;

//text source
var pgs = comp("_Color_Cnt").layer("pages").text.sourceText
var aTR = comp("_Color_Cnt").layer("trans").text.sourceText
var bH = comp("_Color_Cnt").layer("hold1").text.sourceText
var cH = comp("_Color_Cnt").layer("hold2”).text.sourceText

//make absolute number * fps
var PAGES = Math.abs(pgs)*fps;
var TR = Math.abs(aTR)*fps;
var HO1 = Math.abs(bH)*fps;
var HO2 = Math.abs(cH)*fps;

//define duration value (115 is intro, TR is transition, HO is hold-frame duration)
var dur0 = 115
var dur1 = 115 + TR + HO1
var dur2 = 115 + TR + HO1 + TR + HO2

//set duration of render 
if (PAGES == 1) {
var duration = dur1;
} else if (PAGES == 2) {
var duration = dur2;
} else {
var duration = dur0;

thisComp.workAreaDuration = duration;

Re: Help setting the render duration

Posted: Tue Oct 17, 2017 8:26 pm
by CodingAe
You can change the speed a layer, but can't change the duration of a layer using Expression. You can change the duration using ExtendScript, so if you go to the ExtendScript part of the site somebody should be able to help you. Unfortunately, I can't help in that language because I'm still learning it myself.