2016-05-08 19 views
0

Ich möchte den Titel + Künstlernamen eingeben, wenn das Lied spielt, aber ich weiß nicht, wie man das erreicht, denn mit fast 30-35 Songs würde es lang und langweilig sein, um für jeden Song eine eigene Textebene zu erstellen. Wenn es einen Trick gibt, um dies schnell zu erreichen.(After Effects) Ändere den Textinhalt im Laufe der Zeit

Antwort

1

Sie können dies über Skripting erreichen. Ich habe diese zwei Skripte, die tun sollten, was Sie wollen. Ich habe sie vor einiger Zeit geschrieben. Vielleicht müssen Sie ein paar Anpassungen vornehmen.

Dieser fügt mehrere Textebenen aus einer CSV-Datei hinzu.

https://github.com/fabiantheblind/after-effects-script-snippets/blob/master/comp_with_text.jsx

Dieser sollte auf den Inhalt eines csv einer Textebene mit dem Quelltext gesetzt hinzuzufügen.

https://github.com/fabiantheblind/after-effects-script-snippets/blob/master/text_to_comp.jsx

Dies ist ein minimales Beispiel eine Textebene mit sourceText

/** 
* main function 
*/ 
var main = function() { 
    var txt = ['Hello - World', 'dog -cat', 'foo - bah']; // the text to add 
    app.beginUndoGroup('add source text'); // open a undo group 
    var curComp = app.project.activeItem; // get the current comp 
    // check if the curent active item is a comp 
    if (!curComp || !(curComp instanceof CompItem)) { 
    alert('noComp'); 
    return; 
    // end if no comp is active 
    } 
    var txtLayer = curComp.layers.addText('titles'); // add a text layer 
    var counter = 0; // the time to add a keyframe to (in seconds) 
    // loop the text 
    for (var i = 0; i < txt.length; i++) { 
    var curFrame = (counter/curComp.frameRate); // calc time for each frame 
    $.writeln(curFrame); 
    // add a keyframe with the text as value every frame 
    txtLayer.text.sourceText.setValueAtTime(curFrame, txt[i]); 
    counter++; // increase the time by one 
    } 
    app.endUndoGroup(); 
}; 
main(); 
hinzufügen