我正在制作一个After Effects脚本,为孩子们生成简单的形状和动画,我试图避免从Illustrator导入矢量形状到After Effects来为它们制作动画。这对于像正方形和圆形这样的简单形状是非常有效的。
有没有什么解决方案可以在Extendscript Toolkit中生成复杂的形状,这是一个没有导入的纯代码,或者定位一些.txt文件,只需设置形状的顶点、位置和颜色,并通过在After Effects中运行脚本将其应用于新的实体作为遮罩?
如果我想手动操作,我会添加一个新的实体,从illustrator复制第一个路径,然后回到after effects将其粘贴到该实体上,然后我将添加另一个实体,回到Illustrator,复制另一个路径,回到after effect,粘贴到solid 2上,然后重复这个过程,直到最终结果出现。
我想结束软件1和软件2之间的切换,并将绘图保存为顶点、入切线和出切线的数组,并随时调用它!
发布于 2019-03-12 00:25:14
我已经这样做了,它可以用来导入任何类型的素材
var path = "File Path";
var input = new ImportOptinputns(File(path));
if (input.canImportAs(ImportAsType.FOOTAGE));
input.importAs = ImportAsType.FOOTAGE;或者,如果你想导入一个图像序列,你可以这样做
// or if your footage is an image sequence
input.sequence = true;
input.forceAlphabetical = true;
imageSequence = app.project.importFile(input);
imageSequence.name = 'My automatically imported foorage";
theComp = app.project.activeItem; //import in to currently selected composition
theComp.layers.add(imageSequence); 发布于 2019-03-13 02:44:20
我知道如何通过脚本创建简单的矢量对象,但我不确定它是否能像您所希望的那样工作。两组矩形的示例
var shapeLayer = newComp.layers.addShape(); // adding shape layer
shapeLayer.name = "bannerLayer"; // name the shape layer
var shapeGroup1 = shapeLayer.property("Contents").addProperty("ADBE Vector Group"); / creating a group1
shapeGroup1.name = "Banner"; //name the group1
myRect= shapeGroup1.property("Contents").addProperty("ADBE Vector Shape - Rect"); // adding rectangle to the group1更复杂的形状的另一个例子,三角形添加到现有的形状层,您可以使用此代码作为基础并创建更复杂的形状。
var shapeLayer = newComp.layers.addShape(); // adding shape layer
shapeLayer.name = "bannerLayer"; // name the shape layer
var shapeGroup1 = shapeLayer.property("Contents").addProperty("ADBE Vector Group"); // creating a group1
shapeGroup1.name = "Banner"; //name the group1
myRect = shapeGroup1.property("Contents").addProperty("ADBE Vector Shape - Rect"); // adding rectangle to the group1
// construct a Shape object that forms a triangle
var myTriShape = new Shape();
myTriShape.vertices = [[-50,50], [50,50], [0,100]];
myTriShape.closed = true;
// add a Path group to our existing shape layer
myTriGroup = shapeLayer.property("Contents").addProperty("ADBE Vector Group"); // adding rectangle to the group1
myTriGroup.name = "Triangle";
myTri = myTriGroup.property("Contents").addProperty("ADBE Vector Shape - Group");
// set the Path property in the group to our triangle shape
myTri.property("Path").setValue(myTriShape);您可以在此页面上找到更多信息。我自己用谷歌搜索的。
https://stackoverflow.com/questions/55106070
复制相似问题