ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

What is the best way to get the anchor point to the center of a line in Video Copilot Saber?

COW Forums : Video Copilot

VIEW ALL   •   PRINT
Ashton Shaw
What is the best way to get the anchor point to the center of a line in Video Copilot Saber?
on Jul 7, 2020 at 4:22:19 pm
Last Edited By Ashton Shaw on Jul 7, 2020 at 4:30:49 pm

I'm trying to make this saber spin from the center while constantly having the anchor point between the two points (Core Start and Core End)



I prefer having to run an expression to do this but if there's another way please let me know!
Thanks in advanced!

I'm using this with the current expression (Placed in Transform > Anchor Point) provided

With error: "undefined value used in expression (could be an out of range array subscript )"

var x1 = effect("Saber")("Core Start")[0];
var x2 = effect("Saber")("Core End")[0];

var y1 = effect("Saber")("Core Start")[1];
var y2 = effect("Saber")("Core End")[1];

transform.anchorPoint([x1 / y1],[x2 / y2])


Return to posts index

Filip Vandueren
Re: What is the best way to get the anchor point to the center of a line in Video Copilot Saber?
on Jul 7, 2020 at 8:22:39 pm

It’s a simple average of the two values so, the Last line should be:

[x1+x2, y1+y2] / 2;

You can’t call the transform.anchorpoint as if it’s a method, and you also don’t need to set it equal to something for the expression to work.

Expressions only affect the property they are applied to, so the outcome of the last line of an expression- script is simply what is used as value for the property.

Alternatively, only using this should work too:

(effect("Saber")("Core Start") + effect("Saber")("Core End") )/2;



Return to posts index

Ashton Shaw
Re: What is the best way to get the anchor point to the center of a line in Video Copilot Saber?
on Jul 7, 2020 at 8:41:26 pm

No Way! It worked! Thanks so much! I hate when I overcomplicate things :P


Return to posts index

VIEW ALL   •   PRINT
© 2020 CreativeCOW.net All Rights Reserved
[TOP]