Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions toWorld Speed value?

  • toWorld Speed value?

    Posted by Gage Ullman on June 22, 2010 at 10:24 pm

    I’m trying to return the speed of an layer that is parented to another layer. That is, the speed of the child layer relative to the world. I can’t figure the syntax out. I would have assumed something like this:

    thisLayer.toWorld(thisLayer.position.speed)

    I keep getting an error that says “First argument to toWorld must be a vector of length 2 or 3.”

    um… so yeah. Any thoughts?

    Also, I guess I should say what I’m trying to do, incase there’s just a better way to do it. I’ve got a branch, it’s sort of blowing up and down in the wind (rotationally), and I have a couple leaves attached to it. And I want the leaves closer to the end of the branch to rotate farther than the ones closer to the base of it whenever the branch moves. So I figured the relative toWorld speed would be the best value to use to augment the rotation.

    Any thoughts?

    Dan Ebberts
    replied 15 years, 10 months ago
    2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    June 23, 2010 at 12:26 am

    .speed only works with properties (like position), not with arrays like those created by the layer space transforms. This should get you close:

    p1 = toWorld(anchorPoint);
    p0 = toWorld(anchorPoint,time-.01);
    spd = length(p1,p0)*100

    Dan

  • Gage Ullman

    June 23, 2010 at 12:31 am

    thank you so much. The last part of that… the *100 part… where does that number come from? Is it because we’re looking at the difference of position over on hundredth of a second? Actually, just needed to say that out loud to myself. Thank you!

  • Dan Ebberts

    June 23, 2010 at 12:34 am

    Sometimes it helps to talk it out. 🙂

    Dan

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