Copy link to clipboard
Copied
Is there any way to differentiate a solid color layer from any other footage layer (aka AVLayer object) with extend script? This only gives back "Footage" als type:
alert(app.project.activeItem.layer(4).source.typeName);
I know that there is the SolidSource object, where I could test against e.g. if this is not undefined:
app.project.item(7).mainSource.color
but that only works on project level - I need to distinguish the solids on a layer level.
This might not cover every layer type but it should give you an idea:
var theLayer = app.project.activeItem.layer(1);
if (theLayer instanceof AVLayer) {
if (theLayer.source instanceof CompItem) alert("it's a comp");
else if (theLayer.source instanceof FootageItem) {
if (theLayer.nullLayer) alert("it's a null");
else if (theLayer.source.mainSource instanceof SolidSource) alert("it's a solid");
else alert("it's footage");
}
} else alert("not AV");
Copy link to clipboard
Copied
This might not cover every layer type but it should give you an idea:
var theLayer = app.project.activeItem.layer(1);
if (theLayer instanceof AVLayer) {
if (theLayer.source instanceof CompItem) alert("it's a comp");
else if (theLayer.source instanceof FootageItem) {
if (theLayer.nullLayer) alert("it's a null");
else if (theLayer.source.mainSource instanceof SolidSource) alert("it's a solid");
else alert("it's footage");
}
} else alert("not AV");
Copy link to clipboard
Copied
Great, works for me, thx!