Forum Replies Created

  • I am getting tolerable render times, with about 5 seconds per HD frame for 600 trees so far….thanks for the extra tips. The times are not too different from what I was getting with particular, so I cant complain.

  • Perfect!
    That fixed all of my issues! Only mistake you made from memory was that the alpha is #4 in the array and so you have to use [3].
    It only took a day and night of beating my head against the wall and some generous help. I have learned more about expressions doing this damned problem….
    Thanks again!

  • Ahha!
    You gave me all the right clues and with some fudging to make it 3d, it works great! My only issue is that I had to mix up the positions as y became z. I am sure it is because the island has been rotated -90 to make it a flat plane. This fix of mixing the y and z works fine except now i have to adjust the light falloff expressions and im feeling sloppy. Anyway, you remain my Expressions hero. I send all my students to your site when they start to think they know everything about AE. For anyone in the future that wants to populate an island with trees, try this in the position attribute:
    (note that 3000×6000 was the size of my island layer, and -110 was the vertical position I needed each tree to be to just touch the ground)

    L = thisComp.layer(“islandlayer”);
    seedRandom(index,true);

    while(true){

    i= random(0,3000);
    j= random(0, 6000);
    pos = [i,j,-110];
    if (L.sampleImage([i,j])[3] > 0) break;
    }
    pos

  • Hmm. You have provided some good clues. I see where the two for loops in the collision test could look for the alpha. I am curious tho that if I turn off the opacity of the off island trees manually or with this script, will it still tie up processor time? I am looking to add 1000-2000 of these trees add if I am paying for the invisable ones, it would suck render time. Can an expression turn off the visibility switch or should I try to force a new seed for any tree that lands in the water?
    (I never feel like I am accomplishing anything unless I am pushing AE to its limits, hehehe)

  • close, but I think the opacity is one value for the entire layer. Is there an attribute than can look at the alpha channel at any given point? It is an illustrator file layer serving as the island map, and i want to make sure the trees randomly place themselves on the land. ( I did try your suggestion but to no avail. Thank you for puzzling thru this with me.

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