I don't know why I get the error "function object is not defined" with this script.

Hello

I have a script which adds a unique model in the render queue and applying a Render parameter model and model output for adding module make element of queue.  For some reason, I am getting an error on the first line which reads:

app.project.renderQueue.items (1), .applyTemplate ('MY SETTINGS');

I have attached the image of here error dialog:

Screen shot 2011-07-28 at 12.28.32 PM.png

Here is a part of the script.

        var currentProjectItem;
        var globalCompItemID;
        var renderCompItemID;

        for (var i=1;  i <= app.project.numItems; i++)
        {
            currentProjectItem = app.project.item(i);
            if (currentProjectItem.name == "globals")
            {
                globalCompItemID = i;
            } else if (currentProjectItem.name == "!_FINAL RENDER") {
                renderCompItemID = i;
            }
        }

        //add the necessary preview render jobs
        app.project.renderQueue.items.add(app.project.item(renderCompItemID));
        app.project.renderQueue.items(1).applyTemplate("MY SETTINGS");               <---THIS IS WHERE AE ERRORS
        app.project.renderQueue.items(1).outputModules[1].applyTemplate("MY SETTINGS");
        app.project.renderQueue.items.add(app.project.item(renderCompItemID));
        app.project.renderQueue.items(2).applyTemplate("MY SETTINGS");
        app.project.renderQueue.items(2).outputModules[1].applyTemplate("MY SETTINGS");
        app.project.renderQueue.items.add(app.project.item(renderCompItemID));
        app.project.renderQueue.items(3).applyTemplate("MY SETTINGS");
        app.project.renderQueue.items(3).outputModules[1].applyTemplate("MY SETTINGS");

 

The model I want to add is added to the render queue, it simply refuses to invoke the method applyTemplate() on the most recently added make queue item.

Any ideas why I get this error?

Thank you!

I think that from the line where the error occurred, you must use renderQueue.item () instead of renderQueue.items () (except when you add something to the rendering queue).

Dan

Tags: After Effects

Similar Questions

Maybe you are looking for