Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.3 kB
1
Indexable
Never
// Create a new composition
var compWidth = 1080;
var compHeight = 1920;
var compDuration = 10;
var compFPS = 15;
var myComp = app.project.items.addComp("MyComposition", compWidth, compHeight, 1, compDuration, compFPS);

// Create a new text layer
var textLayer = myComp.layers.addText("ITA");
textLayer.property("Source Text").setValue("ITA");

// Set text properties
var textProperty = textLayer.property("Text");
var textDocument = textProperty.value;
textDocument.fontSize = 100;
textDocument.fillColor = [1, 0, 0]; // Red color
textProperty.setValue(textDocument);

// Set initial opacity to 0%
textLayer.opacity.setValueAtTime(0, 0);

// Set keyframes for opacity to fade in
var fadeDuration = 2; // Fade in duration in seconds
var fadeFrames = fadeDuration * compFPS;
textLayer.opacity.setValueAtTime(0, 0); // Start at 0% opacity
textLayer.opacity.setValueAtTime(fadeDuration, 100); // End at 100% opacity
textLayer.opacity.setInterpolationTypeAtKey(1, KeyframeInterpolationType.LINEAR);
textLayer.opacity.setInterpolationTypeAtKey(2, KeyframeInterpolationType.LINEAR);

// Center the text layer in the composition
textLayer.position.setValue([compWidth / 2, compHeight / 2]);

// Save the project with a unique name
app.project.save(new File("~/Desktop/MyAnimation.aep"));