Expressions/Scripts/Presets

Moderators: Disciple, zlovatt

 
joeRaider
Topic Author
Posts: 1
Joined: Sat Sep 02, 2017 9:11 am

Help setting the render duration

Sat Sep 02, 2017 10:01 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: 3
Joined: Wed Aug 30, 2017 8:35 pm
Location: Detroit, Mi
Contact:

Re: Help setting the render duration

Tue Oct 17, 2017 8:26 pm

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.

Who is online

Users browsing this forum: No registered users and 1 guest