-
Draw shape with script
I want to make a script that creates a specific shape layer (the shape of a mouse/cursor). I’ve figured out how to create a new shape with the proper groups, paths, and fills. But I haven’t found a good way to manipulate the actual “Path” properties.
var myComp = app.project.activeItem;
var newCursor = myComp.layers.addShape();
newCursor.property("ADBE Root Vectors Group").addProperty("ADBE Vector Group");
newCursor.property("ADBE Root Vectors Group").property(1).property("ADBE Vectors Group").addProperty("ADBE Vector Shape - Group");
newCursor.property("ADBE Root Vectors Group").property(1).property("ADBE Vectors Group").addProperty("ADBE Vector Shape - Group");
var cpg1f = newCursor.property("ADBE Root Vectors Group").property(1).property("ADBE Vectors Group").addProperty("ADBE Vector Graphic - Fill");
cpg1f.property("ADBE Vector Fill Color").setValue([1,1,1,1]);
newCursor.property("ADBE Root Vectors Group").property(1).property("ADBE Vector Materials Group").remove();
newCursor.property("ADBE Root Vectors Group").addProperty("ADBE Vector Group");
newCursor.property("ADBE Root Vectors Group").property(2).property("ADBE Vectors Group").addProperty("ADBE Vector Shape - Group");
var cpg2f = newCursor.property("ADBE Root Vectors Group").property(2).property("ADBE Vectors Group").addProperty("ADBE Vector Graphic - Fill");
cpg2f.property("ADBE Vector Fill Color").setValue([0,0,0,1]);
newCursor.property("ADBE Root Vectors Group").property(2).property("ADBE Vector Materials Group").remove();