Page 1 of 1

Help setting the render duration

Posted: September 2nd, 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: October 17th, 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.

Re: Help setting the render duration

Posted: November 11th, 2017, 11:36 am
by joeRaider
I was able to successfully change layer durations. What I have not been able to do is set the duration of a render.