Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Multiply Position; “Must be a scalar”

  • Multiply Position; “Must be a scalar”

    Posted by Anders Hattne on March 2, 2019 at 5:44 pm

    …whatever that means..!
    I’ve had a google around, to no avail.
    Why won’t
    transform.position * [0, -1];
    not work?

    I’d have to do something like this to make that work..
    a = transform.position;
    [a[0], a[1]*-1]

    Is there no other way?

    Figure I’d get that cleared up after years of confusion…!

    http://www.ardillamedia.com

    Anders Hattne replied 7 years, 5 months ago 2 Members · 2 Replies
  • 2 Replies
  • Oleg Pirogov

    March 3, 2019 at 3:44 am

    Well, cause one of the arguments of * operation ‘must be a scalar’. Smth like that would work in Python but not in Javascript.

    [a[0], a[1]]*[1, -1] = [a[0], a[1]*(-1)] is element-wise multiplication. It exists in JS’s as math.dotMultiply(x, y) but is not implemented in AE’s expressions.

  • Anders Hattne

    March 4, 2019 at 12:05 pm

    ooohkay.. I googled “javascript scalar” (..and later “element-wise multiplication”).
    “A Scalar is a variable that holds an individual value.”

    That cleared that up!
    Thanks!

    http://www.ardillamedia.com

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy