ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Create a Shape Ellipse from Nulls

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Rubens Angelo
Create a Shape Ellipse from Nulls
on Aug 30, 2019 at 3:37:21 pm
Last Edited By Rubens Angelo on Aug 30, 2019 at 3:37:54 pm

Hi all,

I wanted to create a Shape Ellipse from some Nulls(I have 300) in same position from every Null and parent it.

I'm not that great on expressions, I even managed to create a single solid but I can't even color or resize it even using rd_GimmePropPath to get these properties

I am running a script file... any tips?

Thanks for your attention,
Rubens

app.beginUndoGroup("Add new shape layer");

var myEllipseSize = [500,500];
var myFillColor = [230, 130, 30];

var firstNull = 30;
var lastNull = 330;

var curComp = app.project.activeItem;

if(curComp){
for(firstNull; n &lt; lastNull;n++){
var shapeLayer = curComp.layers.addShape();
var shapeGroup = shapeLayer.property("Contents").addProperty("ADBE Vector Group");
shapeGroup.property("Contents").addProperty("ADBE Vector Shape - Ellipse");
shapeGroup.property("Contents").addProperty("ADBE Vector Graphic - Stroke");
shapeGroup.property("Contents").addProperty("ADBE Vector Graphic - Fill");

shapeGroup.content("Fill 1").color = myFillColor;

shapeGroup.content("Ellipse Path 1").size = myEllipseSize;
shapeGroup.content("Ellipse 1").content("Ellipse Path 1").size; // Just try
}
}

app.endUndoGroup();


Rubens Angelo
http://www.movee.tv


Return to posts index

Rubens Angelo
Re: Create a Shape Ellipse from Nulls
on Aug 30, 2019 at 8:55:38 pm

I got what I wanted! hahahaha

It was very rough but it worked,

best

app.beginUndoGroup("Add new shape layer");

var myEllipseSize = [90,90];
var myFillColor = [230, 130, 30]/255;

var firstNull = 29;
var lastNull = 333;

var curComp = app.project.activeItem;

if(curComp){
for (var i = firstNull; i &lt;= lastNull; i++){
var shapeLayer = curComp.layers.addShape();
shapeLayer.parent = curComp.layer(i+1);
shapeLayer.moveAfter(curComp.layer(lastNull+1));
var shapeGroup = shapeLayer.property("Contents").addProperty("ADBE Vector Group");
shapeGroup.property("Contents").addProperty("ADBE Vector Shape - Ellipse");
shapeGroup.property("Contents").addProperty("ADBE Vector Graphic - Fill");
shapeGroup.content("Fill 1").color.setValue(myFillColor);
shapeGroup.content("Ellipse Path 1").size.setValue(myEllipseSize);

shapeLayer.transform.position.setValue(curComp.layer(i+1).transform.position.value);
shapeLayer.transform.position.setValue([0,0]);

}
}

app.endUndoGroup();


Rubens Angelo
http://www.movee.tv


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]