ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expression to stop rendering when there are no pixels in the composition

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Avinash Ramanath
Expression to stop rendering when there are no pixels in the composition
on Dec 21, 2016 at 9:57:27 am

Scenario: Text crawler
I am dynamically passing a string to a text layer which is crawling at below speed

rate = 2; //value in px/sec.
value - [rate*timeToFrames(time),1]

This text layer is placed inside a comp named RenderComp which I will render as TGA using Media Encoder.

Requirement:
The standard duration of RenderComp is set to 5 minutes. Is there a way to dynamically set the timing of the composition based on the string length, so that it does not render blank frames when the string is shorter.

rate = 2; //value in px/sec.
value - [rate*timeToFrames(time),1]


Return to posts index

Dan Ebberts
Re: Expression to stop rendering when there are no pixels in the composition
on Dec 22, 2016 at 5:13:22 pm

Expressions can't control the work area or anything else I can think of that would give you the result you're looking for. You could do it with a script though.

Dan



Return to posts index

Avinash Ramanath
Re: Expression to stop rendering when there are no pixels in the composition
on Dec 22, 2016 at 5:47:21 pm

Dan, I am new to scripting, could you please help me with a script that does what am looking for.

Pick a footage/footages from a folder (say video1 and video2)
Import the files inside after effects
make compositions from the videos
sequence the compositions
Render the composition

I know am asking too much, could you please direct me towards ways of achieving this even if i have to approach an agency.

Thanks in advance.


Return to posts index


Dan Ebberts
Re: Expression to stop rendering when there are no pixels in the composition
on Dec 22, 2016 at 6:24:41 pm

This is a simple example that asks you to navigate to a video file and then creates a comp with it.


function makeComp(){
var video1 = File.openDialog("Navigate to video file.");
if (video1 == null || (! video1.exists)){
alert("No video selected.");
return;
}
var myImportOptions = new ImportOptions;
myImportOptions.file = video1;
var myFootage = app.project.importFile(myImportOptions);
var myComp = app.project.items.addComp("video1",myFootage.width,myFootage.height,myFootage.pixelAspect,myFootage.duration,myFootage.frameRate);
myComp.layers.add(myFootage);
}
makeComp();


Hopefully that will get you started.

Dan



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]