Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects CS4 AE Null Layer Script Error

  • CS4 AE Null Layer Script Error

    Posted by Andreas Sizynski on November 23, 2012 at 5:56 am

    I watched this video on VideoCopilot: https://www.videocopilot.net/tutorial/3d_stroke_effect/

    At 7:30, the narrator implements adobe script into after effects to parent a null layer’s position to that of a CCParticle effect layer.

    Here are the statements:

    x=thisComp.layer(“Null 1”).transform.position[0]-thisComp.width/2;
    x/thisComp.width

    y=thisComp.layer(“Null 1”).transform.position[1]-thisComp.height/2;
    y/thisComp.width

    z=thisComp.layer(“Null 1”).transform.position[2];
    z/thisComp.width

    However, when I enter in the Position Z statement, I get an AE Error Message: “After Effects warning: Bad argument: index 2 out of range for stream of dimension 2
    Expression disabled.

    Error occurred at line 1.
    Comp: “compName
    Layer:2 (‘particle2’)
    Property:’Position Z'”

    The other statements do not garner any error messages, nor indeed are they disabled. Why is this Position Z acting up?

    An Artist interested in the past, stuck in the present.

    Andreas Sizynski replied 13 years, 5 months ago 5 Members · 5 Replies
  • 5 Replies
  • Tudor “ted” jelescu

    November 23, 2012 at 7:45 am

    Post a screen shot with your Null layer position open and the expressions open as well.

    Tudor “Ted” Jelescu
    Senior VFX Artist

  • Vishesh Arora

    November 23, 2012 at 8:11 am

    Andreas

    Download the project file from the website and check whether the same error occurs there or not.

    If not, then carefully check the expression that you have used.

    Vishesh Arora
    3D and Motion Graphics Artist
    Films Rajendra

    Blog:
    https://digieffects.wordpress.com

    Demo Reel(3D):
    https://www.youtube.com/watch?v=lHPgIJU_BR8

  • Matthew Keane

    November 23, 2012 at 9:05 am

    Have you made sure that the ‘Null 1’ is set to be 3D? If AE is complaining that the position is a ‘stream of dimension 2’ then it sounds like it only has x,y coordinates, but no z, so the third dimension is out of bounds. Arrays in expressions start at zero so, position[0] is x, position[1] is y and position[2] is z.

    Matthew Keane

    Freelancer based in Paris, France
    – Motion Graphics, Video Editing & Effects, Watchout Programming & Live Operation.

  • Ridley Walker

    November 23, 2012 at 2:03 pm

    [Andreas Sizynski] “”After Effects warning: Bad argument: index 2 out of range for stream of dimension 2
    Expression disabled.

    Error occurred at line 1.
    Comp: “compName
    Layer:2 (‘particle2’)
    Property:’Position Z'””

    My suspicion is that you have not made the Null a 3D layer, so it has no position[2].

    Arrays (x,y,z) are counted from 0 as the first position in the array, 1 is the second position in the array and 2 is the third position.

    A 2D layer has 2 dimensions, position[0] and position[1].

    A 3D layer has 3 dimensions, position[0], position[1], and position[2].

  • Andreas Sizynski

    November 23, 2012 at 7:44 pm

    thanks for the headsup! rather silly mistake to overlook on my end.

    However, the particle color is grey and the options to change the birth and death color swatches are greyed out. Any idea why this might be?

    An Artist interested in the past, stuck in the present.

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