Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions problem in script for Trapcode particular!!!

  • problem in script for Trapcode particular!!!

    Posted by Shahrokh Jahanzadeh on February 17, 2013 at 8:45 pm

    Hey guys,
    I`m trying to write a script for trapcode particular but I have a problem here…
    I created a solid but when i`m trying to set it to this:

    it sets to this one:

    I used this codes:

    var mySolid = app.project.activeItem.layers.addSolid([1,1,1], "my solid", compWidth, compHeight, 1);
    var particle = mySolid.Effects.addProperty("Particular");
    particle.property("Particles/sec").setValue(200);
    particle.property("Velocity").setValue(0);
    particle.property("Velocity Random [%]").setValue(0);
    particle.property("Velocity Distribution").setValue(0.5);
    particle.property("Velocity from Motion [%]").setValue(0);

    particle.property("Life [sec]").setValue(5);
    particle.property("Particle Type").setValue(6);
    particle.property("Layer").setValue(2);

    the problem is in the last line!!!!!!!!
    there is 2 Layer list, first: Emitter > Layer Emitter > Layer
    Second: Particle > Texture > Layer
    when I use this code it sets to first, not second
    I want to set it in the second layer
    How can I fix it???

    Thanks

    -Shahrokh

    Shahrokh Jahanzadeh replied 13 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    February 18, 2013 at 4:41 pm

    Because there are two properties with the same name, to get to the second one you need to access it by match name, which is unique for each parameter. I would change the last line to this:

    particle.property(“tc Particular-0066”).setValue(2);

    Dan

  • Shahrokh Jahanzadeh

    February 18, 2013 at 4:50 pm

    thank you very much Dan

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