Mailing List AE-List@media-motion.tv ? Message #48713
From: Brian Behm <flabbyironman@gmail.com>
Subject: Re: [AE] Offset along motion path?
Date: Sun, 28 Apr 2013 16:16:05 -0500
To: After Effects Mail List <AE-List@media-motion.tv>
OK. I've got that up and working. I gave the null object motion path a loopOutDuration so that I could have the driver go around and around the track. Now the next problem I'm trying to squash is how to get the object to auto-orient around the path. Normal auto orientation doesn't seem to be working since it's grabbing it's position from the slider instead of position. 

Dan, I'm looking at your auto-orientation script here http://forums.adobe.com/message/5196644
(pasted for convenience)

L = thisComp.layer("other layer");

u = fromWorldVec(L.toWorldVec([1,0,0]));

v = fromWorldVec(L.toWorldVec([0,1,0]));

w = normalize(fromWorldVec(L.toWorldVec([0,0,1])));

sinb = clamp(w[0],-1,1);

b = Math.asin(sinb);

cosb = Math.cos(b);

if (Math.abs(cosb) > .0005){

  c = -Math.atan2(v[0],u[0]);

  a = -Math.atan2(w[1],w[2]);

}else{

  a = (sinb < 0 ? -1 : 1)*Math.atan2(u[1],v[1]);

  c = 0;

}

[radiansToDegrees(a),radiansToDegrees(b),radiansToDegrees(c)]


I'm not sure how to pass the value from the original expression over to the auto-orientation expression. My initial thought was to pass the value derived from the first expression over to L in the second expression. But watching what happens to L in the equation it seems like it wants the layer itself to pull coordinates from After Effects world space. Any suggestions? 

Brian Behm | Art Director
Rooster Teeth Productions
636 Ralph Ablanedo
Austin, TX  78748
office 512-480-0336
mobile 512-965-7914


On Sun, Apr 28, 2013 at 3:43 PM, Brian Behm <flabbyironman@gmail.com> wrote:
that makes sense. Hadn't thought about driving it through an expression/slider combo. 

Thanks, Dan. 

Brian


On Sun, Apr 28, 2013 at 3:38 PM, Dan Ebberts <debberts@comcast.net> wrote:
If you paste the path into a Null’s position, you’ll get a motion path with a duration of 2 seconds. Then if you have a slider going from 0 to 100 to represent percentage of travel along the path, you can you use an expression like this for your triangle:
 
s = (your slider value);
thisComp.layer(“Null 1”).transform.position.valueAtTime(2*s/100)
 
Something like that.
 
Dan
 
From: Brian Behm
Sent: Sunday, April 28, 2013 1:28 PM
Subject: [AE] Offset along motion path?
 
Hey everybody,
   quick question that's been confounding me. I have a race track simulation I'm developing for an info graphic and I have two representative triangles that I want to animate along the path. Because they're going different speeds, I want to be able to parent them to the path but not lock them into a specific time so that I can animate the offset along the path. Sort of like how Trapcode 3D stroke can animate along a portion of the path.
 
I know I can paste motion paths into After Effects, but that doesn't solve what I want it to do. Is there a way to constrain motion to a path without constraining it to a specific time?
 
Brian
 

Brian Behm | Art Director
Rooster Teeth Productions
636 Ralph Ablanedo
Austin, TX  78748
office 512-480-0336
mobile 512-965-7914




--
not getting enough of my blather?
check out http://flabbyironman.blogspot.com
or my portfolio at http://behmcreative.com



--
not getting enough of my blather?
check out http://flabbyironman.blogspot.com
or my portfolio at http://behmcreative.com
 
Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to ListMaster