-
How to make an Arc using JSX in AE 2023? And have it rotate?
I need to make a loading animation type arc using JS script, how can I do that?
I tried this method
but it gives me error “Object is Invalid”app.project.close(CloseOptions.DO_NOT_SAVE_CHANGES);
app.newProject();
app.beginUndoGroup("Create Comp");
var width = 1920;
var height = 1080;
var duration = 10;
var frameRate = 25;
var bg = [1, 0, 0];
var arc = [0, 1, 0];
var comp = app.project.items.addComp("Comp", width, height, 1, duration, frameRate);
comp.openInViewer();
var layer = comp.layers.addSolid(bg, "Background", width, height, 1);
var shapeLayer = comp.layers.addShape();
shapeLayer.selected = true;
var shapeGroup = shapeLayer.property("ADBE Root Vectors Group").addProperty("ADBE Vector Group");
var arc = shapeGroup.property("ADBE Vectors Group").addProperty("ADBE Vector Shape - Ellipse");
arc.property("ADBE Vector Ellipse Size").setValue([100, 200]);
var arcFill = shapeGroup.property("ADBE Vectors Group").addProperty("ADBE Vector Graphic - Fill");
var mask = shapeLayer.property("ADBE Mask Parade").addProperty("ADBE Mask Atom");
mask.property("ADBE Mask Shape").setValue(arc.property("ADBE Vector Shape"));
var maskPath = mask.property("ADBE Mask Shape");
var startAngle = 0;
var endAngle = 90;
maskPath.setValueAtTime(0, [width/2, height/2, startAngle]);
maskPath.setValueAtTime(duration, [width/2, height/2, endAngle]);
var rotation = shapeLayer.transform.rotation.property("ADBE Vector Rotation");
rotation.expression = "time * 360";
app.endUndoGroup();
Sorry, there were no replies found.