Alex Printz
Forum Replies Created
-
Alex Printz
November 15, 2018 at 4:14 pm in reply to: How do I use seedRandom with a Sine or Cos function to make a pendulum swing start position random?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 -
Alex Printz
November 14, 2018 at 9:56 pm in reply to: How do I use seedRandom with a Sine or Cos function to make a pendulum swing start position random?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 -
Alex Printz
November 14, 2018 at 9:49 pm in reply to: How do I use seedRandom with a Sine or Cos function to make a pendulum swing start position random?change the line
seedRandom(index);
to
seedRandom(index,true);Alex Printz
Mograph Designer -
Alex Printz
November 9, 2018 at 7:57 pm in reply to: AE2019 – Why does using “index” in an if statement throw an undefined value error?that is,
if (thisComp.layer("Control").effect("Slider Control")("Slider").value == index) {100} else {0};Alex Printz
Mograph Designer -
Alex Printz
November 9, 2018 at 7:56 pm in reply to: AE2019 – Why does using “index” in an if statement throw an undefined value error?ah okay, it was slider.value
Alex Printz
Mograph Designer -
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 -
Alex Printz
November 9, 2018 at 3:21 pm in reply to: AE2019 – Why does using “index” in an if statement throw an undefined value error?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 -
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 -
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.namebut you can do this:
R = comp("Comp 1").layer("Shape Layer 1").content("Rectangle Path 1");
n = R.propertyGroup(2).nameAlex Printz
Mograph Designer -
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