Activity › Forums › Adobe After Effects Expressions › Need someone to help me with this converting After Effects Animation to script
-
Need someone to help me with this converting After Effects Animation to script
Posted by Pragyan Yadav on January 18, 2023 at 10:14 pmPragyan Yadav replied 3 years, 4 months ago 3 Members · 4 Replies -
4 Replies
-
Pragyan Yadav
January 19, 2023 at 9:13 pmI have made an animation in after effects, but if my team wants to change something in it, then the efforts we have to go through are much,
so I wanted to convert this animation to Extend Script (AE script) so I just change the variables, and run it and get whatever variant of this animation my team wanted. -
Dan Ebberts
January 19, 2023 at 10:33 pmIn theory you could probably do that. You’d have to document all the steps you used to create the animation and covert that to script code. The script would also need a UI where your team could enter new values to modify the animation. Depending on how much work went into setting it up in the first place, this could turn out to be a significant effort.
-
Pragyan Yadav
January 20, 2023 at 12:08 amHi
So I was able to write the script but issue I am facing is with the inner circle animation
This circle only comes as 3/4, i am not sure whythis is my code for that
// MAKE INNER CIRCLE
// Create a new shape layer
var shapeLayer = comp.layers.addShape();
shapeLayer.enabled = true;
// Add an elliptical path (Ellipse A) to the shape layer
var ellipseAPath = shapeLayer.property("ADBE Root Vectors Group").addProperty("ADBE Vector Shape - Ellipse");
ellipseAPath.property("ADBE Vector Ellipse Size").setValue([572, 572]);
ellipseAPath.property("ADBE Vector Ellipse Position").setValue([0, 0]);
// Add a trim path to Ellipse A
var trimPathA = shapeLayer.property("ADBE Root Vectors Group").addProperty("ADBE Vector Filter - Trim");
// Set the trim path start value to 0 (12 o'clock position)
trimPathA.property("ADBE Vector Trim Start").setValue(50);
trimPathA.property("ADBE Vector Trim End").setValue(100);
// Apply the expression to the start value
trimPathA.property("ADBE Vector Trim Start").expression = "linear(time,4.11,10,50,100)";
// Add an elliptical path (Ellipse A) to the shape layer
var ellipseBPath = shapeLayer.property("ADBE Root Vectors Group").addProperty("ADBE Vector Shape - Ellipse");
ellipseBPath.property("ADBE Vector Ellipse Size").setValue([572, 572]);
ellipseBPath.property("ADBE Vector Ellipse Position").setValue([0, 0]);
// Add a trim path to Ellipse A
var trimPathB = shapeLayer.property("ADBE Root Vectors Group").addProperty("ADBE Vector Filter - Trim");
// Set the trim path start value to 0 (12 o'clock position)
trimPathB.property("ADBE Vector Trim Start").setValue(0);
trimPathB.property("ADBE Vector Trim End").setValue(50);
// Apply the expression to the start value
trimPathB.property("ADBE Vector Trim Start").expression = "linear(time,7.05,10,0,50)";
// Add a stroke to Ellipse A
var stroke = shapeLayer.property("ADBE Root Vectors Group").addProperty("ADBE Vector Graphic - Stroke");
stroke.property("ADBE Vector Stroke Width").setValue(10);
stroke.property("ADBE Vector Stroke Color").setValue([0, 0, 1]);
Reply to this Discussion! Login or Sign Up