首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何仅通过脚本在实体上生成蒙版或在实体上创建自定义(复杂)绘图到Adobe After Effects

如何仅通过脚本在实体上生成蒙版或在实体上创建自定义(复杂)绘图到Adobe After Effects
EN

Stack Overflow用户
提问于 2019-03-12 00:12:28
回答 2查看 526关注 0票数 0

我正在制作一个After Effects脚本,为孩子们生成简单的形状和动画,我试图避免从Illustrator导入矢量形状到After Effects来为它们制作动画。这对于像正方形和圆形这样的简单形状是非常有效的。

有没有什么解决方案可以在Extendscript Toolkit中生成复杂的形状,这是一个没有导入的纯代码,或者定位一些.txt文件,只需设置形状的顶点、位置和颜色,并通过在After Effects中运行脚本将其应用于新的实体作为遮罩?

如果我想手动操作,我会添加一个新的实体,从illustrator复制第一个路径,然后回到after effects将其粘贴到该实体上,然后我将添加另一个实体,回到Illustrator,复制另一个路径,回到after effect,粘贴到solid 2上,然后重复这个过程,直到最终结果出现。

我想结束软件1和软件2之间的切换,并将绘图保存为顶点、入切线和出切线的数组,并随时调用它!

Running the script The Result

EN

回答 2

Stack Overflow用户

发布于 2019-03-12 00:25:14

我已经这样做了,它可以用来导入任何类型的素材

代码语言:javascript
复制
var path = "File Path";

 var input = new ImportOptinputns(File(path));
 if (input.canImportAs(ImportAsType.FOOTAGE));
     input.importAs = ImportAsType.FOOTAGE;

或者,如果你想导入一个图像序列,你可以这样做

代码语言:javascript
复制
// 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); 
票数 1
EN

Stack Overflow用户

发布于 2019-03-13 02:44:20

我知道如何通过脚本创建简单的矢量对象,但我不确定它是否能像您所希望的那样工作。两组矩形的示例

代码语言:javascript
复制
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

更复杂的形状的另一个例子,三角形添加到现有的形状层,您可以使用此代码作为基础并创建更复杂的形状。

代码语言:javascript
复制
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://forums.creativecow.net/docs/forums/post.php?forumid=2&postid=1119306&univpostid=1119306&pview=t

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55106070

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档