Copy link to clipboard
Copied
I just ran into this bug playing around with the "Buzz Words" text preset, a preset which allows you to to cycle through list of words on a text layer rather than having to keyframe the words. The bug is in the logic of the expression included with the preset. I have developed a fix for this, which I'll describe below. I'll create a bug report as well and send it to Adobe.
Recreation steps:
The issue is with the expression the preset uses for "Source Text", which is as follows:
buzz_words = "One|Two|Three|Four|Five|Six|Seven|Eight|Nine|Ten";
split_buzz_words_array = buzz_words.split('|');
buzz_frame_rate = effect("Buzz Frame Rate")(1);
buzz_frame = Math.floor(time * buzz_frame_rate);
buzz_index = buzz_frame % split_buzz_words_array.length;
split_buzz_words_array[buzz_index];
The problem is in the line that calculates the word index, which is "buzz_frame". The logic is using is the AE variable "time", which is the current time into the composition rather than the time into the layer itself, the later of which should be used to index the user-specified word list. Here is my proposed fix (new logic in bold):
layer_index = hasParent ? parent.index : index;
time_into_layer = time - thisComp.layer(layer_index).startTime;
time_into_layer = Math.max(0, time_into_layer); // necessary if CTI is presently before start of layer, results in neg #
buzz_words = "One|Two|Three|Four|Five|Six|Seven|Eight|Nine|Ten";
split_buzz_words_array = buzz_words.split('|');
buzz_frame_rate = effect("Buzz Frame Rate")(1);
buzz_frame = Math.floor(time_into_layer * buzz_frame_rate);
buzz_index = buzz_frame % split_buzz_words_array.length;
split_buzz_words_array[buzz_index];
Copy link to clipboard
Copied
Thanks for sharing!