Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions “array piece can’t expand to more than one value”

  • “array piece can’t expand to more than one value”

    Posted by Brock Jolet on January 31, 2011 at 5:57 pm

    I’m trying to wiggle the x, y, and z values of a null separately. Also, I’m pulling the initial values of x and y from another source, but I get this error message:

    After Effects warning: array piece can’t expand to more than one value
    Expression disabled.

    Error occurred at line 0.
    Comp: ‘Comp 1’
    Layer: 1 (‘grounding’)
    Property: ‘Position’

    This is the code I’m trying to use:

    x = thisComp.layer("CORE").effect("Form")("Postition XY")[0];
    y = thisComp.layer("CORE").effect("Form")("Postition XY")[1];
    z = thisComp.layer("CORE").effect("Form")("Position Z");
    wa = effect("WiggleAmt")("Slider");
    wf = effect("WiggleFreq")("Slider");
    w = wiggle(wf, wa);
    x = value;
    y = w;
    z = wiggle(1,100);
    [x, y, z]

    I had this code split between two areas and it worked fine. i.e. I declared and wiggled x and y in one code.

    x = effect("Form")("Postition XY")[0];
    y = effect("Form")("Postition XY")[1];
    wa = effect("WiggleAmt")("Slider");
    wf = effect("WiggleFreq")("Slider");
    w = wiggle(wf, wa);
    x = value[0];
    y = w[1];
    [x, y]

    Then in a separate area wiggled z.

    wiggle(1,100)

    How do I successfully put all of the code into one bunch?

    Originally, I just had the wiggle code applied directly to the effect’s attributes, but I’m trying to apply the code to a null so that I can link to the values with multiple instances of the effect.

    x = thisComp.layer("CORE").effect("Form")("Postition XY")[0];
    y = thisComp.layer("CORE").effect("Form")("Postition XY")[1];
    z = thisComp.layer("CORE").effect("Form")("Position Z");
    wa = effect("WiggleAmt")("Slider");
    wf = effect("WiggleFreq")("Slider");
    w = wiggle(wf, wa);
    x = value;
    y = w;
    z = wiggle(1,100);
    [x, y, z]

    James Peres replied 12 years, 1 month ago 3 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    January 31, 2011 at 6:33 pm

    Try it this way:

    x = thisComp.layer(“CORE”).effect(“Form”)(“Postition XY”)[0];
    y = thisComp.layer(“CORE”).effect(“Form”)(“Postition XY”)[1];
    z = thisComp.layer(“CORE”).effect(“Form”)(“Position Z”);
    wa = effect(“WiggleAmt”)(“Slider”);
    wf = effect(“WiggleFreq”)(“Slider”);
    w = wiggle(wf, wa);
    x = value[0];
    y = w[1];
    z = wiggle(1,100)[2];
    [x, y, z]

    Dan

  • Brock Jolet

    January 31, 2011 at 7:21 pm

    Thanks! This appears to have solved the issue.

  • James Peres

    October 16, 2013 at 5:32 pm

    Hey Dan, could you offer a little explanation as to what was wrong with the original? Just curious, I’m having similar problems but can’t figure out how your solution worked.

    Thanks!


    James

    Mac Pro 4,1 Quad Core 2.66

  • Dan Ebberts

    October 16, 2013 at 5:42 pm

    For the final value, AE expects an array of three numbers (x, y, and z). The original expression had “value” as the x component and wiggle() results as the y and z components. These are all three-element arrays themselves, which won’t work. My solution was just to pick the appropriate element of each array to construct the final value array.

    Dan

  • James Peres

    April 11, 2014 at 7:33 pm

    Makes sense, thanks for the clarification Dan!


    James

    Mac Pro 4,1 Quad Core 2.66

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