Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE AFTER EFFECTS: HomeForumBasicsExpressionsTutorialsPodcastsMotion GraphicsTrainingCinema 4DFAQ

Render error when attempting to render renamed psd file

Cow Forums : Adobe After Effects Expressions

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>
Render error when attempting to render renamed psd file
by Dean Mougianis on Nov 6, 2009 at 5:05:19 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')
}


Respond to this post   •   Return to posts index

Re: Render error when attempting to render renamed psd file
by Xinlai Ni on Nov 6, 2009 at 7:29:54 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.


Respond to this post   •   Return to posts index

Re: Render error when attempting to render renamed psd file
by Dean Mougianis on Nov 6, 2009 at 9:48:36 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.



Respond to this post   •   Return to posts index


Re: Render error when attempting to render renamed psd file
by Dean Mougianis on Nov 6, 2009 at 11:13:46 pm

skipFrames only goes up to 99.

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



Respond to this post   •   Return to posts index

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>


FORUMSTUTORIALSMAGAZINETRAININGVIDEOS - REELSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]