Copy link to clipboard
Copied
Has anyone had any luck with AEGPSetLayerTransferMode to set a layer to be a trackmatte of the layer above? It only works for me if the layer is already a trackmatte but it won't ever set it otherwise.
For example if my layer is a trackmatte of the layer above, I can use the function to change the trackmatte type to for example luma inverted. But if my layer is not a trackmatte, the code appears to do nothing. I can also use the functions flags to set a layer to be set to preserve transparency.
I understand there's a new method in ae 23 and newer which works well, but I'm trying to get backwards compatibility. Here's my code that is not behaving as expected:
AEGP_LayerTransferMode mode = {};
mode.mode = PF_Xfer_IN_FRONT;
mode.track_matte = AEGP_TrackMatte_ALPHA;
mode.flags = 0;
ERR(suites.LayerSuite7()->AEGP_SetLayerTransferMode(layerH, &mode));
Copy link to clipboard
Copied
i never tried setting a track matte programtically, so i don't know if you're doing it wrong or if that function is broken.
i can say, however, that some c api functions are indeed broken and the workaround is to use AEGP_ExecuteScript for that operation. once you're past the "but this is not elegant!" mental barrier, it just works. i used it to set keyframe interpolation info that was broken on the c side back when and perhaps still is broken...
Copy link to clipboard
Copied
Hi Shachar
Thanks, I guess I will go the execute script route! At least I learned you can set the preserve transparency switch through this method, which I didn't know how to do before and doesn't appear to be documented in the docs.