ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

[object FootageItem] is not the correct type.

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Alex Vaga
[object FootageItem] is not the correct type.
on Oct 11, 2016 at 6:56:11 pm

Hy guys, please help... I am stuck with a problem and I do not understand why this is not correct type.
Thank you in advance for your time and attention! ?

I got this error message:
Unable to execute script at line 31. After Effects error: Unable to call "add" because of parameter 1. [object FootageItem] is not the correct type.

This is the line #31
curItem = app.project.renderQueue.items.add(activeItem);

Here is the script:

var theComposition = app.project.item(1);
var theTextLayer = theComposition.layer(3);

var file = File("/Volumes/Media Alpha/Admissions Video Project 2016_2017/01_AE_Projects/AE Script Master/names.txt");
var renderFolder = Folder("/Volumes/Media Alpha/Admissions Video Project 2016_2017/01_AE_Projects/AE Script Master/render_queue_out")

file.open("r");

var name;
var activeItem;
var currentItem;

var renderLocations = "The following render paths were changed:\n";

while (!file.eof){
name = file.readln();
finalName = "\n" + name.toUpperCase();

var numChar = name.length;

var textProp = theTextLayer.property("Source Text");
var textDocument = textProp.value;
textDocument.fontSize = 72;
if(numChar - 20 > 0){
textDocument.fontSize = 72 - ((numChar - 20)*2);
}
textDocument.text = finalName;
textProp.setValue(textDocument);
app.project.save(File("//Volumes/Media Alpha/Admissions Video Project 2016_2017/01_AE_Projects/AE Script Master/OutputTitleCardsList200/" + name + " Title Card.aep"));
activeItem = app.project.activeItem;
curItem = app.project.renderQueue.items.add(activeItem);
curItem.outputModule(1).applyTemplate("Custom");
if (curItem.status == RQItemStatus.QUEUED) {
// Change all output modules for the current render queue item.
for (j = 1; j <= curItem.numOutputModules; ++j) {
var curOM = curItem.outputModule(j);

curOM.file = new File(renderFolder.toString() + "/" + name + " Title Card.mov");
}
}
app.project.renderQueue.render();
}

file.close();


Return to posts index

Walter Soyka
Re: [object FootageItem] is not the correct type.
on Oct 11, 2016 at 8:19:50 pm

You need to add compositions to the render queue; the error suggests that your active item is a piece of footage, not a comp.

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Alex Vaga
Re: [object FootageItem] is not the correct type.
on Oct 13, 2016 at 3:22:21 pm

Thank you, Walter!
Where should I add compositions to the render queue?


Return to posts index

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