Forum Replies Created

Page 13 of 17
  • seedRandom sets a seed, and all code after that will use that seed when you call a property that requires a seed to start (random, wiggle, etc.). If you need to use multiple random seeds, i’ve used something like this before:

    seedRandom(index,true);
    X = wiggle(2,2);
    seedRandom(random(0,index*2),true);
    Y = wiggle(2,2);
    [X[0],Y[0]]

    A lot of people like to use the index to set a seed randomly, so that they can duplicate layers and it’s new random variables instantly. If I need to make sure that specific layers always use the same seeds no matter if I move them around (e,g, I have a character that needs to avoid a random swinging thing and that layer’s index might change as I animate), I will convert the layer names to digits and then use that, but it requires more computations so I don’t suggest it unless necessary.

    Alex Printz
    Mograph Designer

  • Also per your question, the amplitude is not being affected at all in that formula; if you want it to be, you’re going to want to add a random() to it as well; probably related to the frequency in some way.

    Alex Printz
    Mograph Designer

  • change the line

    seedRandom(index);
    to
    seedRandom(index,true);

    Alex Printz
    Mograph Designer

  • that is,

    if (thisComp.layer("Control").effect("Slider Control")("Slider").value == index) {100} else {0};

    Alex Printz
    Mograph Designer

  • ah okay, it was slider.value

    Alex Printz
    Mograph Designer

  • Alex Printz

    November 9, 2018 at 4:23 pm in reply to: Point on 2D plane, to point in 3D space

    Agreed with Kallehikki, 2D should only be used for some necessary effects, and the 3D layer should be clamped down to your map, and scripts should be pulling the 3D data to the 2D null and the camera. You should not be pushing 2D data back to the 3D null.

    Since there was too many steps/scripts to try and instruct, I just build a demo version for how I would do this.

    12881_mapparentedcamera.aep.zip

    Alex Printz
    Mograph Designer

  • Try changing it to thisLayer.index; I’m not really sure the change but I’m sure it has to do with how the new javascript engine requires a more precise reference. Index ought to call that layer’s index already, but there’s been a few smaller, undocumented changes already noticed.

    Alex Printz
    Mograph Designer

  • Alex Printz

    November 9, 2018 at 3:16 pm in reply to: pull layer’s comp name?

    Yeah that was really unexpected now that I’m looking at adobe reference page. Interesting that it can be referenced via the layer. Might have to play around with that some more.

    Alex Printz
    Mograph Designer

  • Alex Printz

    November 8, 2018 at 5:49 pm in reply to: pull layer’s comp name?

    Actually, it turns out that you can. After a bit of experimenting, you can grab the comp :

    L = comp("Comp 1").layer("Shape Layer 1");
    n = L.thisComp.name;

    Strangely, if you do this, you cannot grab the layer the same way:

    R = comp("Comp 1").layer("Shape Layer 1").content("Rectangle Path 1");
    n = R.thisLayer.name

    but you can do this:

    R = comp("Comp 1").layer("Shape Layer 1").content("Rectangle Path 1");
    n = R.propertyGroup(2).name

    Alex Printz
    Mograph Designer

  • Alex Printz

    November 7, 2018 at 5:26 pm in reply to: Controlling an object from another composition

    if the compositions have different dimensions, then there is no way to get them to align as there is no ‘correct’ alignment.

    What I would do is using the first position statement L.toWorld(L.anchorPoint) parent your layer to a copy of the target comp inside of the main comp.

    If you didn’t intend to have the target comp inside the main comp, make the target comp inactive (turn off eye), but then you can move the target comp around and align them correctly.

    Alex Printz
    Mograph Designer

Page 13 of 17

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