FORUMS: list search recent posts

Extendscript - is FootageItem a layer in a layered PSD

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
spencer tweed
Extendscript - is FootageItem a layer in a layered PSD
on May 5, 2019 at 10:13:07 pm

I'm working on a script that does find/replace for missing items in your project. Unfortunately I'm running into a situation replacing layered image sources (psd, ai, etc.) where the usual avItem.replace() function will just replace the item with the whole image, not the layer within the image.

For example:
var item = app.project.item(3); //assuming this is the 'layer' we want to replace
item.replace(new_path)


Is there a way to determine if an AvItem is a layer in a layered image, and if so is there a clean way to relink it without losing that relationship?

Thanks,
Spencer


Return to posts index

Tomas Bumbulevičius
Re: Extendscript - is FootageItem a layer in a layered PSD
on May 6, 2019 at 5:34:49 pm

Hey Spencer, one good way to find out whether the item in project panel (AVItem) is actually a separate layer inside the .psd or .ai - by looking into its file name.

Layered files are separated by the slash in project panel like [layerName]/[fileName].psd.

One idea I have in mind, but its not tested though - you shouldn't need to find all missing layers individually - but instead, only do this for one item / file, and then update the missing items array. Chances are it is reduced accordingly.

Haven't tried such import/replacement myself, so it's interesting whether you will find a way to import it.

Find out more:
After Effects Tutorials: motion design, expressions, scripting.


Return to posts index

spencer tweed
Re: Extendscript - is FootageItem a layer in a layered PSD
on May 7, 2019 at 12:39:55 am

Thanks Tomas,

Shame there's nothing better for this, I wish Adobe would expose more information to scripting developers. I made a similar script for Nuke and it was so simple, it only took a handful of lines of code.

I did use string parsing as you suggest (looking for the slash) but it isn't a perfect solution. It will work for most cases though, so that combined with a helpful message box is as good as I'm getting until Adobe revamps extendscript I guess!

- Spencer


Return to posts index

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