Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects How to make an Arc using JSX in AE 2023? And have it rotate?

  • How to make an Arc using JSX in AE 2023? And have it rotate?

    Posted by Pragyan Yadav on January 16, 2023 at 12:17 am

    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();

    Pragyan Yadav replied 3 years, 7 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy