Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions “must be scalar” error

  • “must be scalar” error

    Posted by Dagur Maunason on May 27, 2019 at 2:06 pm

    Hi all,

    I’m trying to have a layers scaling follow a Slider control, which works just fine, even with a time offset for the child layers in point implemented. The last functionality I want is to multiply the incoming value from the master with whatever value the child was originally set to, so that the processed animation ends up at for example 80%, instead of 100%. When I input the solution below I get an error stating “one argument to mul() must be scalar”. I’ve tried to searching for an answer but to no avail.

    Any help would be greatly appreciated!

    offset = thisLayer.inPoint;
    orgValue = transform.scale;
    animValue = thisComp.layer("Anim Master").transform.scale.valueAtTime(time - offset);
    newValue = orgValue*animValue;
    newValue

    Dagur Maunason replied 6 years, 11 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dagur Maunason

    May 27, 2019 at 2:28 pm

    I just managed to finally hack a solution together that works, but if anyone know a cleaner/smarter way to do this please enlighten me! And also to know how to do this for example for a 3d layers position would be awesome aswell ☺

    Cheers!

    offset = thisLayer.inPoint;
    orgValueDiff = 100-transform.scale;
    animValue = thisComp.layer("Anim Master").transform.scale.valueAtTime(time - offset);
    newValue = animValue-orgValueDiff;
    [newValue[0], newValue[1]-100]

  • Tomas Bumbulevičius

    May 28, 2019 at 2:48 pm

    Dagur – for 3D, you just need to add another dimension, with an array index of 2.

    [newValue[0], newValue[1]-100, newValue[2]]

    Find out more:
    After Effects Tutorials: motion design, expressions, scripting.
    Boxer – Dynamic Text Boxes Template with a Live Preview

  • Dagur Maunason

    May 29, 2019 at 3:18 am

    Thank you Tomas!

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