The only way to "re-synch" a layer with Photoshop, that I know of, is to make sure that the layer name
in AE is the same as the source name
in AE.
This however is not super pretty, as the layer names would look something like [my layer/my project file.psd]
and I'm not sure how your export script would handle it.
I wrote this scrip that will go through every layer and change the layer name if it doesn't match its source name.
Inside the for loop, I put two different ways to change name and I think the latter one, that I left uncommented, is the one that would let you use the export script without any issues.
It doesn't re-synch the layers with photoshop, so this might be something you'd want to run before you run the export script.
The script:
{
if ( app.project.activeItem ) {
var project = app.project;
var comp = project.activeItem;
var layers = comp.layers;
// Loop through every layer in the active comp...
for ( i = 1; i <= layers.length; i++ ) {
var layer = comp.layer( i );
var layerName = layer.name;
var layerSourceName = layer.source.name;
// If layer name doesn't match the sourcename (minus the psd filename and extension)...
if ( layerName !== layerSourceName.split('/')[0] ) {
/*
Replaces the layername with [empty], which will force AE to use the source name.
Stays in synch with Photoshop...
*/
// layer.name = '';
/*
Replaces the current filename with the first half of the source name.
Doesn't stay in synch with Photoshop...
*/
layer.name = layerSourceName.split('/')[0];
}
}
}
}
As it is, the script will change the layer names...
from this:
Layer name Source name
logo picture 1/project.psd
animation character/project.psd
to this:
Layer name Source name
picture 1 picture 1/project.psd
character character/project.psd
If you uncomment line 24
and comment line 31
, the layer names will go...
from this:
Layer name Source name
logo picture 1/project.psd
animation character/project.psd
to this:
Layer name Source name
[picture 1/project.psd] picture 1/project.psd
[character/project.psd] character/project.psd
In AE, if layer name has square brackets, it means that it matches the source name.