Sync between pre-comp and main comp

Moderators: Disciple, zlovatt

Post Reply
User avatar
lloydalvarez
Enhancement master
Posts: 460
Joined: June 17th, 2004, 9:27 am
Location: New York City, NY
Contact:

I have a main comp that has pre-comps that start staggered in time. The pre-comps have elements that i would like to be animated using sound keys, but the sound keys output is in the main comp. When i link the items in the pre-comp to the sound keys output, it always goes to frame 1 instead of where it is shifted in time in the main comp. is there a way to tell it to sync relative to it's time in the main comp?

(kind of like the sync time of all related items pref I guess)

thanks,

Lloyd
byronnash
Posts: 321
Joined: July 7th, 2004, 2:30 pm
Location: Charlotte, NC
Contact:

You'll have to use the startTime property and find how much it's offset by in the main comp. Then use valueAtTime and subtract or add your difference in the precomp.

something like this (this is not syntax accurate)

Code: Select all

offset = mainComp.preCompLayer.startTime - compStartTime;
soundKeylayer.value.valueAtTime(time - offset)


I hope that didn't confuse you too much. If you are still stuck let me know.
User avatar
lloydalvarez
Enhancement master
Posts: 460
Joined: June 17th, 2004, 9:27 am
Location: New York City, NY
Contact:

that works.. thanks!
Post Reply