Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

I don't know why I'm getting "Function Object is undefined" error with this script.

Participant ,
Jul 28, 2011 Jul 28, 2011

Hi There,

I have a script that is adding a single comp to the render queue and applying a Render Setting template and Output Module template to the added render queue item.  For some reason, I'm getting an error on the first line that reads:

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

I've attached the error dialog image here:

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

Here's a portion 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 comp that I want to add is being added to the render queue, it just refuses to invoke the applyTemplate() method on the most recently added render queue item.

Any ideas why I'm getting this error?

Thanks!

TOPICS
Scripting
995
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 28, 2011 Jul 28, 2011

I think from the line where the error occured on, you should be using renderQueue.item() instead of renderQueue.items() (except when you're adding something to the render queue).

Dan

Translate
Community Expert ,
Jul 28, 2011 Jul 28, 2011

I think from the line where the error occured on, you should be using renderQueue.item() instead of renderQueue.items() (except when you're adding something to the render queue).

Dan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 28, 2011 Jul 28, 2011
LATEST

Thank you, Dan--for your time and expertise.  That was it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines