FORUMS: list search recent posts

Create a new solid with composition size with javascript

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Mário Pereira
Create a new solid with composition size with javascript
on Oct 29, 2016 at 5:04:32 pm

Hi all,

I've searched everywhere and I can't find a proper solution for what I want to accomplish.

I created a script that creates a new solid in my active composition that is automatically named "matte" and has the RGB values set to "0 255 0", also it changes the layer label color automatically, the javascript is as follows:

app.project.activeItem.layers.addSolid([0,255,0], "matte", 1920, 1080, 1).label = 16;

I would like the width, height and aspect ration of this layer to be whatever the active composition size is instead of it having a pre-defined value, can anyone help?

Thanks in advance!

Mário Pereira


Return to posts index

Walter Soyka
Re: Create a new solid with composition size with javascript
on Oct 31, 2016 at 1:05:02 pm

width = app.project.activeItem.width;
height = app.project.activeItem.height;
pixelAspect = app.project.activeItem.pixelAspect;
app.project.activeItem.layers.addSolid([0,255,0], "matte", width, height, pixelAspect).label = 16;


Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Mário Pereira
Re: Create a new solid with composition size with javascript
on Nov 1, 2016 at 12:56:28 am

Thank you very much Walter thats exactly what I needed ?

Regards!

Mário Pereira


Return to posts index


Paola Cuellar
Re: Create a new solid with composition size with javascript
on Nov 1, 2016 at 1:23:44 am

I am having problems with compositions too. I bought a video template where you can just replace pictures but two of the compositions is linked to one picture so when i replace one picture for one composition it changes the other composition as well and I cant find out or can find any help online.

Can you help me?


Return to posts index

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