Skip to main content
Participant
January 8, 2019
Answered

FootageItem replace() method doesn't keep original alpha setting

  • January 8, 2019
  • 2 replies
  • 661 views

I am replacing footage with FootageItem replace() (scripting manual page 66).

I've been testing it by replacing footage with the same footage just from a different directory.

But AE doesn't maintain the Alpha Interpretation that I saved in the .aep file.

Instead it appears to guess the alpha.

As a test I interpreted straight alpha footage as premultiplied and premultiplied as straight.

When I do the replace, the straight is guessed as straight and premultiplied guessed as premultiplied.

But I don't want AE to do any guessing.

The manual says:

The method preserves interpretation parameters from the previous mainSource object. If the specified file has an unlabeled alpha channel, the method estimates the alpha interpretation.

But the files do not have an unlabeled alpha. (How do I double check this?) They were created with an alpha in AE to begin with.

How do I get it to never try and guess the alpha and leave it how they were manually interpreted in the .aep project?

Thanks

Correct answer davidp26418601

This seemed to work:

var originalAlphaInterpretation = item.mainSource.alphaMode;           

item.replace(file);           

item.mainSource.alphaMode = originalAlphaInterpretation;

2 replies

Inspiring
April 23, 2025

This is an infuriating (one of many) behavior in AE. Replacing footage manually also often changes the alpha interpretation. WHY?? This is so unintuitive, and given the way that alpha interpretation is so buried in AE potentially very damaging.

 

I guess this dates to AE's antiquated way of initially reading in files. Nuke of course does all of this stuff in the comp, NOT in some hidden and baked part of the import process.

davidp26418601AuthorCorrect answer
Participant
January 8, 2019

This seemed to work:

var originalAlphaInterpretation = item.mainSource.alphaMode;           

item.replace(file);           

item.mainSource.alphaMode = originalAlphaInterpretation;