Discussion:
AE syntax for inverse of scale function..?
(too old to reply)
K***@adobeforums.com
2008-10-17 11:34:23 UTC
Permalink
I'm applying an effect to a moving object. The effect can only be applied to a static object.

I've stabilised the object, along with its rotation and scale, and then added the effect. Now I've created a pre-comp with the effect in and used pickwicks from the pre-comp back to the original motion tracker data to reverse the stabilisation (such as adding *-1 to the rotation expression to reverse the rotation).

I'm now a bit perprlexed about what I write to reverse the scale. *-1 yields an upside down image. Well of couse it would, doh! But 1/scale (which in effect is what I need) yields a syntax error.

Anyone know what I should do here?

Cheers!
D***@adobeforums.com
2008-10-17 15:55:18 UTC
Permalink
Try this:

[1/scale[0],1/scale[1]]*10000

Dan
K***@adobeforums.com
2008-10-17 16:40:43 UTC
Permalink
Thanks.

But, uh, where do I put it? I do the twirly from one scale to another and get an expression box. Just put it in there?
D***@adobeforums.com
2008-10-17 18:19:18 UTC
Permalink
I'm not sure what you're doing exactly. Where did you put the one that generated the syntax error?
K***@adobeforums.com
2008-10-19 10:05:16 UTC
Permalink
Thanks Dan,

How do I describe this? (and I'm sorry if I've not been 100% clear but I've still got my 'L' plates on)

I have a project with a movie imported. I motion stabilised it and then pre-composed it.

If I have both the original and precomp menus open. I alt click on the parameters that have been key framed in the comp window and with the pickwick link them to the original: comp position to original anchor, anchor to position, rotate to rotate (with *-1 added). I can now apply effects in the comp window that stay locked on to the original.

This all works well, but I've come unstuck with the scale. If I pickwick that I get a doubling of the scaling. There's a dialog box that ends with transform.scale (or was it transformscale?)

Adding your [1/scale[0],1/scale[1]]*10000 yields a syntax error (and did you mean square brackets? Though I've tried curved brackets and still get an error). The expression on its own is accepted, but I see no result.

How do I reverse the scaling?

Have I clarified this? I'm sure it's a simple fix (once you know how!) but the manual doesn't help, nor googling, nor any of the books I have here...

Still, there's a silver lining: a problem like this does force you to learn.

Many thanks
R***@adobeforums.com
2008-10-19 13:08:30 UTC
Permalink
Let's see if I get this. You've got a movie in Comp 1 that you stabilized using position, rotation, and scale. You pre-compose the stabilized movie layer giving and applied your effect in Movie Pre-comp. Now you want to put the motion back into the Movie Pre-comp layer in your Comp 1.

To re-introduce motion that was removed you apply the stabilized position to the anchor point, the stabilized anchor point to the position, the reciprocal of the stabilized scale to the scale, and the opposite of the stabilized rotation to the rotation.

I think you've got it for the most part, but your error is probably introduced because you haven't defined the scale of the stabilized layer properly. It might be easier to write the expression for scale like this:

movie = comp("Movie Pre-comp").layer("Movie");
x = 10000/movie.scale[0];
y = 10000/movie.scale[1];
[x, y]

You could also use Dan's expression if you wrote it like this:

movie = comp("Movie Pre-comp").layer("Movie");
[1/movie.scale[0],1/movie.scale[1]]*10000

Do you see what I mean? You must define where you are getting the values from. I think that starting your expressions with definitions simplifies writing and debugging a great deal. This is especially true when your trying to pull values from other comps.The movie = comp("Movie Pre-comp").layer("Movie") definition makes it much simpler to refer to the properties of that layer and the expressions are easier to understand.

So the whole thing would look like this:
K***@adobeforums.com
2008-10-22 07:32:44 UTC
Permalink
That's been very useful.

Many thanks!

Loading...