AE ENHANCERS

Expressions/Scripts/Presets
It is currently Thu Sep 02, 2010 3:48 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Increment Rotation At Markers
PostPosted: Mon May 12, 2008 10:27 am 
Offline
User avatar

Joined: Thu Jun 17, 2004 9:27 am
Posts: 381
Location: New York City, NY
This expression will increase (and animate) the rotation by the user defined number or degrees at every marker on the layer. If you set the duration to anything more than 0 the rotation will animate into the marker. In other words it will start the rotation f frames before the marker and it will finish the rotation at the marker.

Code:

f=5; //duration in frames of rotation, set to zero if you want it to click
d=20; //degrees to rotate


f=framesToTime(f, fps = 1.0 / thisComp.frameDuration);
n = 0;
if (marker.numKeys > 0){
  n = marker.nearestKey(time).index;
  if (time > marker.key(n).time && n < marker.numKeys){
   n++;
  }
r=(d*(n-1)) + value;
linear (time,marker.key(n).time-f,marker.key(n).time,r,r+d);
}


-Lloyd

_________________
You can find all my AE scripts here: http://aescripts.com


Top
 Profile  
 
 Post subject: Re: Increment Rotation At Markers
PostPosted: Wed May 14, 2008 8:34 am 
Offline
User avatar

Joined: Thu Jun 17, 2004 9:27 am
Posts: 381
Location: New York City, NY
This expression will oscillate rotation back and forth at markers:

Code:
f=5; //duration in frames of rotation, set to zero if you want it to click
d=20; //degrees to rotate

r=value;
f=framesToTime(f, fps = 1.0 / thisComp.frameDuration);
n = 0;
if (marker.numKeys > 0){
  n = marker.nearestKey(time).index;
if (n%2) {d=d*-1; r=r-d;}
linear (time,marker.key(n).time-f,marker.key(n).time,r,r+d);
}

_________________
You can find all my AE scripts here: http://aescripts.com


Top
 Profile  
 
 Post subject: Re: Increment Rotation At Markers
PostPosted: Mon Jun 16, 2008 11:27 am 
Offline
User avatar

Joined: Sat Jun 05, 2004 8:05 am
Posts: 132
Location: Los Angeles, CA
Hey Lloyd

This might come in handy for me on a current project. How would you combine this with a wiggle? ie if I wanted the wiggle to increase based on your script?

Thanks
Alex


Top
 Profile  
 
 Post subject: Re: Increment Rotation At Markers
PostPosted: Mon Jun 16, 2008 12:01 pm 
Offline
User avatar

Joined: Thu Jun 17, 2004 9:27 am
Posts: 381
Location: New York City, NY
you want the amount of wiggle to increase at each marker?

_________________
You can find all my AE scripts here: http://aescripts.com


Top
 Profile  
 
 Post subject: Re: Increment Rotation At Markers
PostPosted: Mon Jun 16, 2008 12:15 pm 
Offline
User avatar

Joined: Sat Jun 05, 2004 8:05 am
Posts: 132
Location: Los Angeles, CA
Yes, sorry if I wasn't clear. I'm basically trying to find ways to control the evolution of a wiggle parametrically, ie without keyframes from a slider. Markers are one good way I hadn't thought of...

Thanks!
Alex


Top
 Profile  
 
 Post subject: Re: Increment Rotation At Markers
PostPosted: Mon Jun 16, 2008 1:36 pm 
Offline
User avatar

Joined: Thu Jun 17, 2004 9:27 am
Posts: 381
Location: New York City, NY
Code:
freq=24; //wiggle frequency in frames per second
s=0; //wiggle start amount
d=20; //amount to increase wiggle at each marker
f=15;  //duration in frames of transition to next amount, set to zero if you want it to click

f=framesToTime(f, fps = 1.0 / thisComp.frameDuration);
n = value;
if (marker.numKeys > 0){
  n = marker.nearestKey(time).index;
  if (time > marker.key(n).time && n < marker.numKeys){
   n++;
  }
r=(d*(n-1))+s;
a=linear (time,marker.key(n).time-f,marker.key(n).time,r,r+d);
wiggle(freq,a);

}

_________________
You can find all my AE scripts here: http://aescripts.com


Top
 Profile  
 
 Post subject: Re: Increment Rotation At Markers
PostPosted: Tue Jun 17, 2008 9:43 am 
Offline
User avatar

Joined: Mon Apr 30, 2007 5:55 am
Posts: 156
Location: United States, Ohio
Can this be used with audio somehow?

Ideally to rotate on the beat. I often have the raw tracks for music, such as only the kick or only the snare fairly well isolated.

_________________
"Up And Atom

No...No

Up And At Them!"


Top
 Profile  
 
 Post subject: Re: Increment Rotation At Markers
PostPosted: Tue Jun 17, 2008 10:15 am 
Offline
User avatar

Joined: Thu Jun 17, 2004 9:27 am
Posts: 381
Location: New York City, NY
totally, that's what I wrote it for in the first place.. simply place markers on your layer at every beat..

if you want a more automated way to do that, you can reference this tutorial by Dan: http://www.motionscript.com/design-guid ... igger.html

and feed my expression the threshold time instead of the marker time. But in my experience i get better results when I mark the beats myself.. at least use Trapcode's soundkeys which can let you isolate frequencies better.

-lloyd

_________________
You can find all my AE scripts here: http://aescripts.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group