Untitled

 avatar
unknown
plain_text
2 years ago
1.3 kB
2
Indexable
// 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");
var textProperty = textLayer.property("Source Text");
textProperty.setValue("ITA");

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

// 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"));
Editor is loading...