View Full Version : Multiple Animations of Subtitle
jjones3535a
16th July 2009, 16:58
Hi,
I've been able to create a simple clip with a subtitle that animates the text from one position to another using this script:
bg = BlankClip(length=25, width=Width, height=Height, fps=fr, color=$000000, pixel_type=cs, audio_rate=ar)
title=bg.Animate(0,10,"Subtitle", \
"Hello World!",100,100,0,25,"Comic Sans MS",40,$00FF00,$000000,5,0,0,\
"Hello World!",100,400,0,25,"Comic Sans MS",40,$00FF00,$000000,5,0,0)
return title
The subtitle starts at 100,100 and ends at 100,400 (so it drops straight down). My question is, how would I then have the subtitle text move to another position, say to the center?
I tried adding another .Animate call changing the frame start/end, and the x,y coords but that didn't work.
Any suggestions? Do I need to use another technique to achieve multiple animations?
Thanks.
kemuri-_9
16th July 2009, 18:26
unlike ApplyRange which limits the evaluation to the specific range you specify,
Animate applies the start and end values beyond the frames you specify, which is the problem you're experiencing
if you want to limit the animation to a specific frame range to chain animations together, you're going to need to trim properly:
BlankClip(length=25, width=640, height=480, fps=30, fps_denominator=1001, color=$000000, pixel_type="YV12", audio_rate=48000)
#scroll down the left side
p1 = Animate(0,10,"Subtitle", \
"Hello World!",100,100,0,25,"Comic Sans MS",40,$00FF00,$000000,5,0,0,\
"Hello World!",100,400,0,25,"Comic Sans MS",40,$00FF00,$000000,5,0,0).trim(0,10)
#bottom left corner -> center
p2 = Animate(11,20,"Subtitle", \
"Hello World!",100,400,0,25,"Comic Sans MS",40,$00FF00,$000000,5,0,0,\
"Hello World!",Width()/2,Height()/2,0,25,"Comic Sans MS",40,$00FF00,$000000,5,0,0).trim(11,0)
# combine parts
p1 + p2
Animate could be more convenient if it had a bool option to control applying only to the frame range it's animating or beyond that (like it currently does)
Gavino
16th July 2009, 18:43
I tried adding another .Animate call changing the frame start/end, and the x,y coords but that didn't work.
How did you do it exactly? Something like this should work:
title = ... #as before
title=title.Animate(100,110,"Subtitle", \
"Hello Again World!",100,400,100,125,"Comic Sans MS",40,$00FF00,$000000,5,0,0,\
"Hello Again World!",320,240,100,125,"Comic Sans MS",40,$00FF00,$000000,5,0,0)
return title
Note you need to change the frame numbers in both Animate itself and for both Subtitle parameter lists inside the Animate (shown in blue above).
kemuri-_9: There's no need to Trim to limit the animation to a specific frame range because the Subtitle parameters themselves already limit the extent of the Subtitle.
jjones3535a
16th July 2009, 19:05
Great thanks. I've got it now. Chaining the .Animate calls worked. I must have had the wrong frame start/end in the 2nd call. Here's what I have now. I animate the 1st subtitle down for the first 10 frames, then pauses for 5 frames, then Animates again (changing the text this time) to another position.
title=bg.Animate(0,10,"Subtitle", \
"Hello World!",100,100,0,15,"Comic Sans MS",40,$00FF00,$000000,5,0,0,\
"Hello World!",100,400,0,15,"Comic Sans MS",40,$00FF00,$000000,5,0,0)
title=title.Animate(16,30,"Subtitle", \
"Hello Again World!",100,400,16,50,"Comic Sans MS",40,$00FF00,$000000,5,0,0,\
"Hello Again World!",320,240,16,50,"Comic Sans MS",40,$00FF00,$000000,5,0,0)
return title
Gavino thanks for the help.
kemuri-_9
16th July 2009, 19:13
kemuri-_9: There's no need to Trim to limit the animation to a specific frame range because the Subtitle parameters themselves already limit the extent of the Subtitle.
yes, my mistake, i generally don't use Subtitle, so i had forgotten about that capability....
but i still think that Animate should have the ability to prevent applying beyond the animation range...
i don't think this would be too hard to accomplish by adding in a new boolean parameter.
Gavino
16th July 2009, 20:19
but i still think that Animate should have the ability to prevent applying beyond the animation range...
i don't think this would be too hard to accomplish by adding in a new boolean parameter.
I agree this would be useful as it's often the way one wants to use Animate - basically a variant of Animate that behaves like ApplyRange.
And it would indeed be easy to implement because Animate and ApplyRange already share mostly the same code.
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.