FORUMS: list search recent posts

Script: Resize Comp

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
John Gate
Script: Resize Comp
on Feb 27, 2019 at 3:27:20 pm

Hi there,

If i resize (height and width) of a comp from comp settings, it resizes fine.

However when i try to resize it with script like this
comp.width = newWidth;
comp.height = newHeight;

it resizes differently. I tried to google but couldnt find any script that resizes like comp settings panel.

please advise
Thanks


Return to posts index

Dave LaRonde
Re: Script: Resize Comp
on Feb 27, 2019 at 6:31:45 pm

There's a script that resizes comps that comes with After Effects. You should find it & use it.

I don't know what it's called -- never had to use it.

Dave LaRonde
Promotion Producer
KGAN (CBS) & KFXA (Fox) Cedar Rapids, IA


Return to posts index

John Gate
Re: Script: Resize Comp
on Feb 27, 2019 at 6:46:53 pm

Thank you for your reply,

I tried it and it works good but i want to just set a width only and height to remain same.
When i used this included script, and chose width, it automatically resized the height too.

I hope someone have delt with this situation with scripting here.


Return to posts index


Walter Soyka
Re: Script: Resize Comp
on Feb 27, 2019 at 7:08:19 pm

You should do the same thing that "Scale Composition.jsx" does -- use a null to manipulate the entire scene:

1) Create a new 3D null.
2) Step through all layers in the comp, and make all unparented layers a child of the null. (Pick up bonus points if you fix a bug in Scale Composition by correctly handling locked layers!)
3) Resize the comp as you have above.
4) Move the null half the difference in width to the right.
5) Delete the 3D null.

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

Dave LaRonde
Re: Script: Resize Comp
on Feb 27, 2019 at 9:26:35 pm

-- OR --
Just go Layer > Transform > Fit to Comp Width

Dave LaRonde
Promotion Producer
KGAN (CBS) & KFXA (Fox) Cedar Rapids, IA


Return to posts index

Walter Soyka
Re: Script: Resize Comp
on Feb 27, 2019 at 10:55:00 pm

That will resize the layers to maximum width, not re-position them within the new width of the comp.

The problem that John is having is that when you change the comp size through the comp settings window, the default behavior puts the anchor of that resize in the center of the comp. When you change the size of a comp via scripting, it works as if you set the resize anchor to the upper left corner.

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


John Gate
Re: Script: Resize Comp
on Feb 28, 2019 at 9:29:49 am

Thank you for your response
@Walter, You, Sir a genius


Return to posts index

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