Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Child in 3d space tracking

  • Child in 3d space tracking

    Posted by Ariel Levental on October 12, 2007 at 8:04 am

    hi, i don’t know if this question has been asked before but here it is.

    if i have an object(solid) that is parented to a null.
    and the null is rotating 360 degrees on it’s Y axis.
    since the Object is parented to the null it moves in a circle in 3d space.

    how can i retrieve the child’s position in 3d space so i can make something like a particle system emit from it.

    i’ve tried using toComp and toWorld with no luck…

    oh, and if it is all possible, can i get back just the X and Z position ???

    thank you in advance.

    Ariel

    Ariel Levental replied 18 years, 9 months ago 3 Members · 4 Replies
  • 4 Replies
  • Kevin Camp

    October 12, 2007 at 3:50 pm

    if you are using particular you can set the emitter to be a comp light named emitter and parent that light to the same null and the other layer is parented to (or even to the layer that’s parented to the null)

    but if you are using a system like particle world, it will be more difficult… like you i can’t get any positional values from the layer for the particle world producer to use. but there is a workaround, if nobody else knows how to get those values.

    use the old paste a mask path as a motion path method… less flexible but it should work.

    -create a new layer and a circular mask that is the diameter that you need.
    -hit ‘mm’ to reveal the mask properties, select the mask path and hit copy.
    -enable position keyframing, and paste. now you should have a layer that moves in a circle, but on the wrong plane (xy plane, rather than xz plane).
    -unparent the layer that was parented to the null, or create a new layer to replace that layer. then enable expressions for the position of that 3d layer, type a ‘[‘ then use the expression pickwhip to link it to the x pos value of the circle maks layer. type ‘,0,’ (that’s comma-zero-comma) and use the pickwhip to link to the y pos value.

    now your new layer should rotate in a circle similarly to the previous layer on an xz plane. but you need to link the particle world producer’s position to the layer’s position.

    -particle world’s coordinates are not in pixels and are base on the center of the layer… so they need to be adjusted… use the pickwhip to link the xpos of the producer to the xpos of the layer, then type a ‘(‘ at the front of the pickwhip value and ‘-360)/600’ at the end (these are ntsc sd comp values, yours may be a little different).
    -do the same for the zpos values, but change 360 to about 20, if you want to, do the same for ypos, but change the 360 to 240.

    that should link them up pretty well… i’m sorry i don’t have an easier solution, maybe someone else will…

    Kevin Camp
    Designer – KCPQ, KMYQ & KRCW

  • Dan Ebberts

    October 12, 2007 at 4:59 pm

    L = thisComp.layer(“Solid 1”);
    P = L.toWorld(L.anchorPoint);

    then P[0] gives you x and P[2} gives you z

    Dan

  • Kevin Camp

    October 12, 2007 at 7:04 pm

    that was far easier than my workaround…

    i’ve often run into problems trying to use layer space transorms. after seeing what you’ve done, it is most likely due to my limited knowlege of java… i haven’t been defining the object, just trying to say toWorld and pointing the layer property.

    thanks for the insight.

    passo, if you are using particle world, i think you will still need to come up with a conversion to particle world’s coordinant/measure system.

    Kevin Camp
    Designer – KCPQ, KMYQ & KRCW

  • Ariel Levental

    October 12, 2007 at 8:58 pm

    Dan and Kevin
    i just wanted to say thanks to you two.
    you always seem to get me out of the jam i’ve got myself into.

    thanks again

    Ariel

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