Help setting the render duration

Moderators: Disciple, zlovatt

Post Reply
joeRaider
Posts: 2
Joined: September 2nd, 2017, 9:11 am

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;
User avatar
CodingAe
Posts: 21
Joined: August 30th, 2017, 8:35 pm
Location: Detroit, Mi
Contact:

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.
joeRaider
Posts: 2
Joined: September 2nd, 2017, 9:11 am

I was able to successfully change layer durations. What I have not been able to do is set the duration of a render.
Post Reply