I want to know how we can manipulate a keyframe in an animtion director based on a user input value.
Example: i have a Quad animation, moving position in x from 0 to 100 in 50 frames. I now want to move the same position in 200 frames based on a user text input where i type in 200 (or any random number that i want) without going to the animation director and manually adjusting the keyframes.
I know this can be achieved thru scripting but was wondering if its possible thru VL also (taking a long shot on this :-) ). But if it is possible thru scripting ONLY then can i get the precise script (i am absolute zero in scripting)
Scripting is probably the way to go, although I don't know what it would be (don't know much scripting either).
I was curious however, and tried building something in Visual Logic and kind of got something going. The attached project is set to 30 frames/sec so you may need to adjust some numbers in VL. Keep in mind this is not 100% accurate.
Simple scene with a white quad starting at Xpos 0 and going to Xpos 960 in 30 frames. Basic idea is using the Scene Director Position block to change the actual frame that's online by lowering/increasing that value to slow/speed the scene up. Since this project is in 30 fps I made the quad animation 30 frames.
Here's how it works. The default animation time is 1 second (30 frames), say you wanted to slow it to 2 seconds, you would need 60 frames. First use a timer block and make it start when the scene comes on (used an null event to make it work) and then divide that by 30 for the frame. Then divide 60 (Retime text field) by the framerate (30) for the retimed percent and then finally divide those two numbers (frame/retimed percent). This will half the speed for the scene.
However like I said this isn't 100% accurate, if you look in sequence mode you'll see there's a scene with the retime field at 120 to make the animation 4 seconds long. When played the animation finishes just before 4 seconds and also the frames say 133.33 instead of 120. So I'm not sure if my math is wrong somewhere or what.
Hi GAURAV.Try the script below. Set it into the input text object.
Dim quad As xpBaseObject
Dim anim As xpAnimController
anim.Duration = CInt(Text)
anim.SetKeyFramePosition(quad, 0, 0, 0, 0, KeyInterpolation.ki_Linear, Axis.Axis_X)
anim.SetKeyFramePosition(quad, CInt(Text), 500, 0, 0, KeyInterpolation.ki_Linear, Axis.Axis_X)
Passionate about live production, Ross Video designs, manufactures and delivers dependable technology and services that power exceptional live video productions seen by billions of viewers around the world every day.
62 Auriga DriveNepean, OntarioCanada, K2E 7W6
Phone+1 613 228-0688Emailcommunity@rossvideo.com