FORUMS: list search recent posts

How do I add an Rectangle shape to a Comp with script?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
taehyung kim
How do I add an Rectangle shape to a Comp with script?
on Oct 25, 2011 at 11:09:48 am

Here the ellipse has found a way to add to the script. But I do not know how to add a Rectangle. Can you fix this script?

var myComp = this.InterlaceComp;

var myEllipseSize = [footage.width*2,footage.width*2];
var myFillColor = [0, 0, 0];

var myShapeLayer = myComp.layers.addShape();
var myShapeLayerContents = myShapeLayer.property("ADBE Root Vectors Group");
var myShapeGroup = myShapeLayerContents.addProperty("ADBE Vector Group");
var myEllipse = myShapeGroup.property("ADBE Vectors Group").addProperty("ADBE Vector Shape - Ellipse");
myEllipse.property("ADBE Vector Ellipse Size").setValue(myEllipseSize);
var myShapeFill = myShapeGroup.property("ADBE Vectors Group").addProperty("ADBE Vector Graphic - Fill");
myShapeFill.property("ADBE Vector Fill Color").setValue(myFillColor);

this.InterlaceComp.layer(1).name = "Interlace_Matte";


Return to posts index

Dan Ebberts
Re: How do I add an Rectangle shape to a Comp with script?
on Oct 25, 2011 at 3:21:25 pm

I can't test it right now, but I think all you need to do is change "Ellipse" to "Rectangle".

Dan



Return to posts index

taehyung kim
Re: How do I add an Rectangle shape to a Comp with script?
on Oct 26, 2011 at 12:21:01 am

Replace the last "rectangle" and "ellipse". But failed. I think value is wrong



But thank you. Dan


Return to posts index


Dan Ebberts
Re: How do I add an Rectangle shape to a Comp with script?
on Oct 26, 2011 at 12:35:56 am

You're right. It should be:

"ADBE Vector Shape - Rect"

It try it, but it looks like you only posted part of the script.

Dan



Return to posts index

taehyung kim
Re: How do I add an Rectangle shape to a Comp with script?
on Oct 26, 2011 at 1:16:42 am

oh~! awesome~!!

But still there is an error in this part.

var myRectangleSize = [0,0,footage.width,footage.height];
myRectangle.property("ADBE Vector Rectangle Size").setValue(myRectangleSize);

The second line of the error
(I had to fix 'Rectangle Size' = 'Rect Size'. but error.)

How do I replace?

In another line of no more Debuging error.


Return to posts index

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