Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › Spray Can Rig using Particular

  • Spray Can Rig using Particular

    Posted by Christopher Johnstone on February 5, 2014 at 12:01 pm

    Hello,

    I am trying to make a spray can rig using particular.
    I have created a 3D locator for my emitter in particular.
    What I would like to do is use another 3D loccator to generate a vector direction for the spray?
    Can anyone shine a light on how to do this?

    Many thanks in advance … Chris

    Christopher Johnstone

    Christopher Johnstone replied 12 years, 7 months ago 2 Members · 5 Replies
  • 5 Replies
  • Kevin Camp

    February 6, 2014 at 6:00 pm

    if you are not using a custom particle, it’s pretty simple, but you’ll want to use a light as an emitter.

    first create a light, name it ‘Emitter’ (with a capital E) and make it a spot light (it will work with point, but spot is better suited for this).

    create a null, make it 3d and then use the expression pickwhip to link the spot light’s point of interest to the nulls position.

    then in particular, set the emiiter type as ‘light’ (it will automatically link to the light named ‘Emitter’), and set the direction to ‘directional’. the particle system will follow the position and direction of the spot light, the cone angle of the light will be the ‘spread’ of the emitter, and particle color will come from the light color (you can override it with the particle>set color property). you can even control the birth rate with the light’s intensity, which is based on a percentage of the set birth rate int particular.

    custom particle’s break a lot of that (at least in v1.5), the light still works, but the directional aspect is lost.

    if that’s the case, you’ll need two 3d nulls (you could use any 3d layers), one you’ll choose to be the emitter (in the emitter type, choose layer, then select the layer), and make it directional.

    on the 3d null that is now the emitter, add an expression like this to its orientation property:

    target = thisComp.layer(“Null 1”); // your layer name in the quotes
    lookAt(position, target.position)

    then in particular you need to use the expression pickwhip to link each of the xyz rotation properties to the corresponding xyz orientation property of the emitter null, which would look similar to this for x rotation:

    thisComp.layer(“Null 2”).transform.orientation[0]

    once that’s done for each, the emiiter should track the other 3d null.

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Christopher Johnstone

    February 7, 2014 at 12:27 pm

    Thanks Kevin! that has been a great help.
    There is a little problem with the orientation that I still cannot fathom.

    I have pasted the nearest thing I have got to a result bellow but this does not look right to me.

    What do you think is wrong?

    Many thanks – CJ

    // on Particular Emitter XRot node //
    - thisComp.layer("Null Can").transform.orientation[0]/2
    // on Particular Emitter YRot node //
    180 - thisComp.layer("Null Can").transform.orientation[1]
    // on Particular Emitter ZRot node //
    thisComp.layer("Null Can").transform.orientation[2]/2

    Christopher Johnstone

  • Kevin Camp

    February 7, 2014 at 4:50 pm

    is your ‘null can’ tracking your locator layer using the lookAt() expression?

    if so, you should just need the orientation of ‘null can’ in the rotation properties of emitter in particular…

    is the ‘null can’ parented to another layer? if so that may foul up the relationship… i’d have to look at that. using a light as an emitter would probably get around that issue.

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Kevin Camp

    February 7, 2014 at 5:23 pm

    sorry, it looks like i gave you bad advice by telling you to set up particular to use the ‘null can’ as a layer emitter.

    you want to set particular up with a point emitter and make it directional. then you need to link the point emitter’s position to “null can’s” position with expressions.
    so you could use something like this for xy position:

    target = thisComp.layer(“Null Can”);
    fromComp([target.position[0],target.position[1]])

    and this for z:

    thisComp.layer(“Null Can”).position[2]

    also, i tested the parenting of the light emitter to another 3d layer, and that did break the tracking too, so if you are parenting the ‘null can’ to another layer, you might reverse the parenting and parent the other can layers to the null can

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Christopher Johnstone

    February 10, 2014 at 10:44 am

    Thanks for coming back Kevin,
    Joy – I have got both types of Rig working now thanks to your help.

    Many, many thanks – CJ

    Christopher Johnstone

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