Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Render error when attempting to render renamed psd file

  • Render error when attempting to render renamed psd file

    Posted by Dean Mougianis on November 6, 2009 at 5:05 pm

    Hi,

    Has anyone had this problem? I’m trying to render a series of stills (photoshop psd files) at regular points along a timeline – all generated by a script. I can generate the renderitems just fine – I’ve attaced the script that does it.

    When I try to render however, I get this error:

    error: Can’t copy from a file “ / AEtemp-AADE9C- ” that is empty (39 :: 0)

    and are my filepath and new filename – but the AEtemp portion is generated by after effects. What results are files that are about 40K bytes but are not valid photoshop files.

    When I don’t try to rename the render output file, after effects generates it’s own name with a file sequence number and this renders fine.

    I hope I’m being clear. Any help would be appreciated

    var frameSpeed = theComp.layer("control layer").property("Effects").property("speed").property("Slider").value;
    var retPathObj = new Folder().selectDlg("Pick a folder");
    for (var i = 0, startPos = 0; startPos < theComp.duration; i++, startPos += frameSpeed) {
    var renderItem = app.project.renderQueue.items.add(theComp);
    renderItem.timeSpanStart = startPos;
    renderItem.timeSpanDuration = theComp.frameDuration;
    renderItem.outputModules[1].applyTemplate("Photoshop");
    renderItem.outputModules[1].file = new File(retPathObj.fullName + '/' + theComp.name + '_' + i.toString() + '.psd')
    }

    Dean Mougianis replied 16 years, 6 months ago 2 Members · 3 Replies
  • 3 Replies
  • Xinlai Ni

    November 6, 2009 at 7:29 pm

    First of all, Photoshop template expects the file name to be something like: rendered[#####].psd, so the rendering program can fill in the sequence index – even if you only render 1 frame. So if you change your last line to
    renderItem.outputModules[1].file = new File(retPathObj.fullName + '/' + theComp.name + '_' + i.toString() + '-[#####].psd')
    It should work, except it adds 00000 to every output frame.
    By the way, you can greatly simplify your code by using the renderItem.skipFrames attribute – if you set renderItem.skipFrames = 1, every other frame will be rendered, if 2, every 3rd frame is rendered. So discarding your loop, you’ll have something like:
    var renderItem = app.project.renderQueue.items.add(theComp);
    renderItem.timeSpanStart = 0;
    renderItem.timeSpanDuration = theComp.duration;
    renderItem.skipFrames = 5; // render every 6th frame
    renderItem.outputModules[1].applyTemplate("Photoshop");
    renderItem.outputModules[1].file = new File(retPathObj.fullName + '/' + theComp.name + '-[#####].psd')

    This way, you only have 1 render item which outputs all sampled frames for you.

    Xinlai Ni
    Software Engineer, Google Inc.

  • Dean Mougianis

    November 6, 2009 at 9:48 pm

    Thank you, Xinlai

    I was wondering, is there a way to modify the photoshop template so that those sequential numbers are not there? Or is that behavior that is hard coded into after effects when you render still image file types?

    I will definitely make use of the skip frames – thank you so much.

  • Dean Mougianis

    November 6, 2009 at 11:13 pm

    skipFrames only goes up to 99.

    Argh! Is Adobe saving up 3-digit numbers to give out at Christmas time?

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy