Comments

Selina wrote on 4/20/2022, 2:50 AM

Il faut un script. J'en suis sûr que @jetdv pourait vous aider, si cela lui intéresse ?

Operating System
    Windows 10 Pro 64-bit
CPU
    Intel Core i7 2600K @ 3.40GHz    32 °C
    Sandy Bridge 32nm Technology
RAM
    32.0GB Dual-Channel DDR3 @ 784MHz (10-10-10-27)
Motherboard
    MSI P67A-G45 (MS-7673) (SOCKET 0)    37 °C
Graphics
    D2342P (1920x1080@60Hz)
    D2342P (1920x1080@60Hz)
    1023MB NVIDIA GeForce GTX 560 Ti (MSI)    36 °C
Storage
    465GB SAMSUNG HD502HJ (SATA )    26 °C
    0B SAMSUNG HD204UI (RAID )
    1863GB Western Digital WDC WD20EURS-73TLHY0 (SATA )    28 °C
    953GB Intel Raid 0 Volume (RAID )
    298GB Western Digital WD 3200BEV External USB Device (USB (SATA) )    32 °C
Optical Drives
    HL-DT-ST BD-RE BH10LS30
Audio
    Realtek High Definition Audio
  Plantronics Blackwire 3220 Series
  TASCAM US-122L

jetdv wrote on 4/20/2022, 8:24 AM

Take a look at this tutorial:

It shows how to add a velocity envelope and add points to that envelope.

You would need to change the velocity envelope to whatever type of envelope you are using but the process of adding a new point on the envelope will be the same.

 

xcxz-a wrote on 5/24/2022, 2:49 AM

@jetdv Is there a script tutorial to add Easings to all Vegas keyframes/envelops? like these easing curves proposed by @Selina : https://www.vegascreativesoftware.info/us/forum/vegas-built-in-easings--134830/#ca842366

jetdv wrote on 5/24/2022, 7:19 AM

@xcxz-a A script can definitely change the keyframe "smoothness" type between Fast, Linear, None, Sharp, Slow, and Smooth. Do you have a specific case you'd like to see turned into a tutorial?

xcxz-a wrote on 5/24/2022, 7:51 AM

@xcxz-a A script can definitely change the keyframe "smoothness" type between Fast, Linear, None, Sharp, Slow, and Smooth. Do you have a specific case you'd like to see turned into a tutorial?


@jetdv Yes, I want add bounce fade type between two keyframes, is it possible? Can this be done by scripting discrete keyframes?

Math function is :

Below you see the code of this easing function written in TypeScript. The variable x represents the absolute progress of the animation in the bounds of 0 (beginning of the animation) and 1 (end of animation).

function easeOutBounce(x: number): number {

const n1 = 7.5625;
const d1 = 2.75;

if (x < 1 / d1) {
return n1 * x * x;
} else if (x < 2 / d1) {
return n1 * (x -= 1.5 / d1) * x + 0.75;
} else if (x < 2.5 / d1) {
return n1 * (x -= 2.25 / d1) * x + 0.9375;
} else {
return n1 * (x -= 2.625 / d1) * x + 0.984375;
}

}

 

jetdv wrote on 5/24/2022, 7:55 AM

@xcxz-a, it appears you're simply adding a transition. The only options for keyframes are what I listed above. This appears to be a new transition using the new "GL Transition".

xcxz-a wrote on 5/24/2022, 8:04 AM

@jetdv No, I want to add any curve to any keyframe, as long as we know the expression for the curve.

That's what @Selina calls easing. Is it possible by scripting?

jetdv wrote on 5/24/2022, 12:14 PM

@xcxz-a, so this is only in Pro-Type Titler?

xcxz-a wrote on 5/24/2022, 12:22 PM

@jetdv No, I hope it in OFX, track motion, pan/crop, mask, envelop, velocity.

jetdv wrote on 5/24/2022, 1:11 PM

@xcxz-a, so you don't have an actual project so I can see what's being done to the keyframes. As far as I know, a keyframe can only be Fast, Linear, None, Sharp, Slow, or Smooth. There's no code that can be applied to a keyframe. Those are the only six options. And, yes, a script can set one of those six options. If you are going beyond those six option, please show me an actual project that is doing that so I can then investigate what can be seen/done using a script.

xcxz-a wrote on 5/24/2022, 1:22 PM

@jetdv Do you mean this :

jetdv wrote on 5/24/2022, 1:29 PM

@xcxz-a, so, based on what I'm seeing there, you're using a Transition Envelope and are adding a lot of points to that envelope. You're wanting to know if a script can manipulate the transition envelope?

As "Tweener" is a part of Vegasaur and that's a script (custom command), yes the transition envelope can be manipulated with a script.

xcxz-a wrote on 5/24/2022, 1:36 PM

You're wanting to know if a script can manipulate the transition envelope?

@jetdv Can I through scripting put a lot of points on the keyframe based on the curve of the known expression, so that the shape of the keyframe curve resembles that curve of the known expression?

Not only ransition envelope but also OFX keyframe, track motion keyframe, pan/crop keyframe, mask keyframe, other envelop keyframe, velocity keyframe.

jetdv wrote on 5/24/2022, 1:46 PM

@xcxz-a Are you wanting to use a set function? Or wanting to be able to enter that function or any other separate function in order to determine the keyframes? (i.e. you want to be able to enter the actual function separately similar to what you did above - not built-in as part of the original script?)

I think I'm starting to get a better understanding of what you're trying to accomplish.

And in this specific example, you're passing the "x" value (which, in your example, appears to basically be "time" of the first time is 0 and the last time is 1 so the fraction would be calculated) and it's returning the "y" value. Will that change where you pass a "time" and it returns "x and y" or you pass "y" and it returns "x"? And what about "x, y, and z" options?

xcxz-a wrote on 5/24/2022, 9:04 PM

@xcxz-a Are you wanting to use a set function?

@jetdv That's ideal.

And in this specific example, you're passing the "x" value (which, in your example, appears to basically be "time" of the first time is 0 and the last time is 1 so the fraction would be calculated) and it's returning the "y" value. Will that change where you pass a "time" and it returns "x and y" or you pass "y" and it returns "x"? And what about "x, y, and z" options?

Take "y=x^3" for example. I think "time" is "x", also is "frame". "y" is keyframe value.

Is it possible to add "y=x^3" curve to transition envelop, ofx keyframe, track motion keyframe, pan/crop keyframe, mask keyframe, other envelop keyframe, velocity keyframe.?

jetdv wrote on 5/25/2022, 8:59 AM

@xcxz-a, I'm going to say that answer should be yes. I'll do a little investigating - part of which will be figuring out exactly what should be changed on those keyframes - which will be different depending on the type of keyframe it is. For example, Velocity - will be a speed change. Pan/Crop, could be a position change or could be a size change or even could be a rotation change. Transition would be how far in the transition it is?

There's still a lot of clarifications that need to be made.

xcxz-a wrote on 5/25/2022, 9:06 AM

@jetdv

@xcxz-a, I'm going to say that answer should be yes. I'll do a little investigating - part of which will be figuring out exactly what should be changed on those keyframes - which will be different depending on the type of keyframe it is. For example, Velocity - will be a speed change. Pan/Crop, could be a position change or could be a size change or even could be a rotation change. Transition would be how far in the transition it is?

There's still a lot of clarifications that need to be made.

That's crazy! Incredibly complex!

jetdv wrote on 5/25/2022, 12:00 PM

@xcxz-a, you mean something like this?

In this case, I am simply passing the fractional frame value to the function you listed above. Then I am taking the returned value, multiplying it by the original "CenterX" of Pan/Crop, and then moving it from the original location to this new "X" position. So the center of the the video is actually bouncing against the left edge.

jetdv wrote on 5/25/2022, 12:10 PM

Modified function...
 

        public float easeOutBounce(float x)
        {
            float n1 = 7.5625f;
            float d1 = 2.75f;

            if (x < 1 / d1)
            {
                return n1 * x * x;
            }
            else if (x < 2 / d1)
            {
                return n1 * (x -= 1.5f / d1) * x + 0.75f;
            }
            else if (x < 2.5 / d1)
            {
                return n1 * (x -= 2.25f / d1) * x + 0.9375f;
            }
            else
            {
                return n1 * (x -= 2.625f / d1) * x + 0.984375f;
            }
        }

 

xcxz-a wrote on 5/25/2022, 7:29 PM

@xcxz-a, you mean something like this?

In this case, I am simply passing the fractional frame value to the function you listed above. Then I am taking the returned value, multiplying it by the original "CenterX" of Pan/Crop, and then moving it from the original location to this new "X" position. So the center of the the video is actually bouncing against the left edge.

@jetdv Oh, yes that is! Besides looking a little slow, I'm sure a lot of Vegas users will be interested if there's a improved tutorial!

jetdv wrote on 5/25/2022, 8:52 PM

@xcxz-a, of course that was over the entire length of the event. It would go faster if the event was shorter. I was just using the event length as the length to use. This was, basically, just a "proof of concept" test.

So what changes would you like to see to really make it more useful? Obviously, sliding half way off the screen is not what we're looking for. So I could increase the distance (to full width instead of half width) and, possibly, start it off the edge of the screen instead? I'll play a little more tomorrow.

xcxz-a wrote on 5/25/2022, 9:39 PM

@jetdv It would be nice to make a bouncy ball as a demo

jetdv wrote on 5/26/2022, 9:22 AM

Still on the original concept. This time starting off the screen to the right and "bouncing" in to create a "transition".

In this case, I shortened the upper clip to be the width I wanted for the "transition" and then expanded it back after running the script.

jetdv wrote on 5/26/2022, 10:02 AM

@xcxz-a And a bouncing ball bouncing across the screen...

This is the image used in this test but you can't see it because it's a white ball on a transparent background so it's white against white on this forum with no background color.

and that same image on the timeline in VEGAS before running the script.