FORUMS: list search recent posts

writing a simple script to set null object anchor point in the center?

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Allison Sabelli
writing a simple script to set null object anchor point in the center?
on Jul 18, 2010 at 6:21:51 pm

Hi everyone, I need some little help here, I'm very new to AE and scripting is unknown territory, however I'm learning by looking at other scripts and reading a lot. However I'm a little stuck here with the anchor point.

I'm trying to write a simple script that adds a null object to a scene and set its size and its anchor point right in the center, so far I got everything I need but the anchor point :\

here is what i got
-----------------
var nw = 50;
var nh = 50;
var myNull = myComp.layers.addNull();
myNull.source.name = "My NUll";
myNull.source.width = nw; // getting this right :)
myNull.source.height = nh;
myNull.source.anchorPoint = ???; //I know should be an array for [x,y,z] but I get errors if i try.
myNull.threeDLayer = true;
------------------

I might be doing this all wrong, I don't know ahhaha but how do i set the anchor point to be in the center?.

Any help is very much appreciated, thanks


Return to posts index

Andy George
Re: writing a simple script to set null object anchor point in the center?
on Jul 18, 2010 at 7:33:51 pm

Hi Allison,

Just FYI You might get a better response posting this over at the expressions forum.

-Andy George
Senior Editor
http://www.chiselindustries.com


Return to posts index

Dave LaRonde
Re: writing a simple script to set null object anchor point in the center?
on Jul 19, 2010 at 2:57:16 pm

Actually, I don't know if messing with a null object's anchor point is necessary or desirable. It just takes a little getting used to -- it's always in the upper-left.

If you can give me an instance where you absolutely need to do it, I'll gladly change my tune.

Dave LaRonde
Sr. Promotion Producer
KCRG-TV (ABC) Cedar Rapids, IA


Return to posts index


Darby Edelen
Re: writing a simple script to set null object anchor point in the center?
on Jul 19, 2010 at 8:07:56 pm

[Allison Sabelli] "myNull.source.anchorPoint = ???; //I know should be an array for [x,y,z] but I get errors if i try.
myNull.threeDLayer = true;"


I'm not familiar with scripting in AE, but I hope I know enough about general programming to help :)

I'd say you want to set the layer to be 3D before you attempt to set the anchor point to a 3D vector. A 2D null object may not allow for a 3rd component in the anchor point.

That's the only thing I can think of from a non-AE scripting specific perspective.

Darby Edelen


Return to posts index

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