How can i move keyframes via scripts.

iEmby wrote on 2/15/2024, 11:34 PM

i want to move keyframes of pan & crop or any other event fx.
how can i do that with script?

PROCESSOR
     

Operating System: Windows 11 Pro 64-bit (Always Updated)
System Manufacturer: ASUS
12th Gen Intel(R) Core(TM) i7-12700 (20 CPUs), ~2.1GHz - 4.90GHz
Memory: 32GB RAM
Page File: 11134MB used, 7934MB Available
DirectX Version: DirectX 12

-----------------------------------------------

MOTHERBOARD

 

ASUS PRIME H610-CS D4
Intel® H610 (LGA 1700)
Ready for 12th Gen Intel® Processors
Micro-ATX Motherboard with DDR4
Realtek 1 Gb Ethernet
PCH Heatsink
PCIe 4.0 | M.2 slot (32Gbps) 
HDMI® | D-Sub | USB 3.2 Gen 1 ports
SATA 6 Gbps | COM header
LPT header | TPM header
Luminous Anti-Moisture Coating
5X Protection III
(Multiple Hardware Safeguards
For all-round protection)

-----------------------------------------------
EXTERNAL GRAPHIC CARD

-----------------------------------------------

INTERNAL GRAPHIC CARD (iGPU)

------------------------------------------------

LED - MONITOR

Monitor Name: Generic PnP Monitor
Monitor Model: HP 22es
Monitor Id: HWP331B
Native Mode: 1920 x 1080(p) (60.000Hz)
Output Type: HDMI

-----------------------------------------------

STORAGE DRIVE

Drive: C:
Free Space: 182.3 GB
Total Space: 253.9 GB
File System: NTFS
Model: WD Blue SN570 1TB (NVMe)

---------------O----------------

My System Info (PDF File).

https://drive.google.com/open?id=1-eoLmuXzshTRH_8RunAYAuNocKpiLoiV&usp=drive_fs

 

Also Check

Some useful creations by me including VEGAS Scripts

https://getopensofts.blogspot.com/

 

My YouTube Channel Dedicated to Only VEGAS Pro Tutorials

EDITROOM : My YouTube Channel (For VEGAS Tutorials)

Comments

Phil_P wrote on 2/16/2024, 3:26 AM

Hi,

There is some discussion about that here:

https://www.vegascreativesoftware.info/us/forum/insert-track-motion-points-at-exact-time-separation--144126/

If you read through it you will find links to Ed's tutorials and also a ton of code that I recently wrote.

If the finished code would be any use to you, please let me know.

It depends on what exactly what you want to do. How you want to move them etc. If it is just positioning, this is pretty easy.

jetdv wrote on 2/16/2024, 8:54 AM

@iEmby Make sure you do look through some of my older tutorials. For Pan/Crop, it's really fairly easy:

            foreach(Track myTrack in myVegas.Project.Tracks)
            {
                if (myTrack.IsVideo())
                {
                    foreach(VideoEvent vevnt in myTrack.Events)
                    {
                        if (vevnt.Selected)
                        {
                            //Pan/Crop
                            if (vevnt.VideoMotion.Keyframes.Count > 1)
                            {
                                VideoMotionKeyframe kf = vevnt.VideoMotion.Keyframes[vevnt.VideoMotion.Keyframes.Count - 1];
                                kf.Position = vevnt.Length;
                            }

So it just checks to see how many Pan/Crop keyframes there are and if more than one, it will load the last one and move it to the "length" of the event. You might need to do more error checking as, theoretically, there could be keyframes after the length of the event and this is just picking up the "last" one. But I think this will work for you in most cases.

Effects... that's a different story. First of all, you can only do this with OFX effects so that's the first check. Then you have to go through every parameter and determine if it's been automated. If it HAS been automated, how many keyframes does it have? If more than one, then pick the last one and move it to the "length" of the event. However, every parameter type has it's own type of keyframes!

So to specifically look at every parameter of every OFX effect of the video event and move the last keyframe to the event length no matter what type of parameter it is...

                            //effects
                            foreach(Effect eff in vevnt.Effects)
                            {
                                if (eff.IsOFX)
                                {
                                    OFXEffect ofx = eff.OFXEffect;
                                    foreach (OFXParameter ofxparm in ofx.Parameters)
                                    {
                                        if ((ofxparm.Name != "Presets") && (ofxparm.Label != "Preset") && (ofxparm.ParameterType.ToString() != "Page") && (ofxparm.ParameterType.ToString() != "Group") && (ofxparm.ParameterType.ToString() != "PushButton"))
                                        {
                                            if (ofxparm.IsAnimated)
                                            {
                                                switch (ofxparm.ParameterType.ToString())
                                                {
                                                    case "RGB":
                                                        {
                                                            OFXRGBParameter p1 = (OFXRGBParameter)ofx[ofxparm.Name];
                                                            if (p1.Keyframes.Count > 1)
                                                            {
                                                                OFXRGBKeyframe k1 = p1.Keyframes[p1.Keyframes.Count - 1];
                                                                k1.Time = vevnt.Length;
                                                            }
                                                            break;
                                                        }
                                                    case "RGBA":
                                                        {
                                                            OFXRGBAParameter p1 = (OFXRGBAParameter)ofx[ofxparm.Name];
                                                            if (p1.Keyframes.Count > 1)
                                                            {
                                                                OFXRGBAKeyframe k1 = p1.Keyframes[p1.Keyframes.Count - 1];
                                                                k1.Time = vevnt.Length;
                                                            }
                                                            break;
                                                        }
                                                    case "Double":
                                                        {
                                                            OFXDoubleParameter p2 = (OFXDoubleParameter)ofx[ofxparm.Name];
                                                            if (p2.Keyframes.Count > 1)
                                                            {
                                                                OFXDoubleKeyframe k1 = p2.Keyframes[p2.Keyframes.Count - 1];
                                                                k1.Time = vevnt.Length;
                                                            }
                                                            break;
                                                        }
                                                    case "Double2D":
                                                        {
                                                            OFXDouble2DParameter p2 = (OFXDouble2DParameter)ofx[ofxparm.Name];
                                                            if (p2.Keyframes.Count > 1)
                                                            {
                                                                OFXDouble2DKeyframe k1 = p2.Keyframes[p2.Keyframes.Count - 1];
                                                                k1.Time = vevnt.Length;
                                                            }
                                                            break;
                                                        }
                                                    case "Double3D":
                                                        {
                                                            OFXDouble3DParameter p2 = (OFXDouble3DParameter)ofx[ofxparm.Name];
                                                            if (p2.Keyframes.Count > 1)
                                                            {
                                                                OFXDouble3DKeyframe k1 = p2.Keyframes[p2.Keyframes.Count - 1];
                                                                k1.Time = vevnt.Length;
                                                            }
                                                            break;
                                                        }
                                                    case "Integer":
                                                        {
                                                            OFXIntegerParameter p2 = (OFXIntegerParameter)ofx[ofxparm.Name];
                                                            if (p2.Keyframes.Count > 1)
                                                            {
                                                                OFXIntegerKeyframe k1 = p2.Keyframes[p2.Keyframes.Count - 1];
                                                                k1.Time = vevnt.Length;
                                                            }
                                                            break;
                                                        }
                                                    case "Integer2D":
                                                        {
                                                            OFXInteger2DParameter p2 = (OFXInteger2DParameter)ofx[ofxparm.Name];
                                                            if (p2.Keyframes.Count > 1)
                                                            {
                                                                OFXInteger2DKeyframe k1 = p2.Keyframes[p2.Keyframes.Count - 1];
                                                                k1.Time = vevnt.Length;
                                                            }
                                                            break;
                                                        }
                                                    case "Integer3D":
                                                        {
                                                            OFXInteger3DParameter p2 = (OFXInteger3DParameter)ofx[ofxparm.Name];
                                                            if (p2.Keyframes.Count > 1)
                                                            {
                                                                OFXInteger3DKeyframe k1 = p2.Keyframes[p2.Keyframes.Count - 1];
                                                                k1.Time = vevnt.Length;
                                                            }
                                                            break;
                                                        }
                                                    case "Choice":
                                                        {
                                                            OFXChoiceParameter p3 = (OFXChoiceParameter)ofx[ofxparm.Name];
                                                            if (p3.Keyframes.Count > 1)
                                                            {
                                                                OFXChoiceKeyframe k1 = p3.Keyframes[p3.Keyframes.Count - 1];
                                                                k1.Time = vevnt.Length;
                                                            }
                                                            break;
                                                        }
                                                    case "Boolean":
                                                        {
                                                            OFXBooleanParameter p4 = (OFXBooleanParameter)ofx[ofxparm.Name];
                                                            if (p4.Keyframes.Count > 1)
                                                            {
                                                                OFXBooleanKeyframe k1 = p4.Keyframes[p4.Keyframes.Count - 1];
                                                                k1.Time = vevnt.Length;
                                                            }
                                                            break;
                                                        }
                                                    case "String":
                                                        {
                                                            OFXStringParameter p5 = (OFXStringParameter)ofx[ofxparm.Name];
                                                            if (p5.Keyframes.Count > 1)
                                                            {
                                                                OFXStringKeyframe k1 = p5.Keyframes[p5.Keyframes.Count - 1];
                                                                k1.Time = vevnt.Length;
                                                            }
                                                            break;
                                                        }
                                                    case "Custom":
                                                        {
                                                            OFXCustomParameter p5 = (OFXCustomParameter)ofx[ofxparm.Name];
                                                            if (p5.Keyframes.Count > 1)
                                                            {
                                                                OFXCustomKeyframe k1 = p5.Keyframes[p5.Keyframes.Count - 1];
                                                                k1.Time = vevnt.Length;
                                                            }
                                                            break;
                                                        }
                                                    default:
                                                        {
                                                            break;
                                                        }
                                                }
                                            }
                                        }
                                    }
                                }
                            }

 

iEmby wrote on 2/17/2024, 1:41 AM

@iEmby Make sure you do look through some of my older tutorials. For Pan/Crop, it's really fairly easy:

            foreach(Track myTrack in myVegas.Project.Tracks)
            {
                if (myTrack.IsVideo())
                {
                    foreach(VideoEvent vevnt in myTrack.Events)
                    {
                        if (vevnt.Selected)
                        {
                            //Pan/Crop
                            if (vevnt.VideoMotion.Keyframes.Count > 1)
                            {
                                VideoMotionKeyframe kf = vevnt.VideoMotion.Keyframes[vevnt.VideoMotion.Keyframes.Count - 1];
                                kf.Position = vevnt.Length;
                            }

thanks sir it worksssss

u r always GOD to me ,, thanks

PROCESSOR
     

Operating System: Windows 11 Pro 64-bit (Always Updated)
System Manufacturer: ASUS
12th Gen Intel(R) Core(TM) i7-12700 (20 CPUs), ~2.1GHz - 4.90GHz
Memory: 32GB RAM
Page File: 11134MB used, 7934MB Available
DirectX Version: DirectX 12

-----------------------------------------------

MOTHERBOARD

 

ASUS PRIME H610-CS D4
Intel® H610 (LGA 1700)
Ready for 12th Gen Intel® Processors
Micro-ATX Motherboard with DDR4
Realtek 1 Gb Ethernet
PCH Heatsink
PCIe 4.0 | M.2 slot (32Gbps) 
HDMI® | D-Sub | USB 3.2 Gen 1 ports
SATA 6 Gbps | COM header
LPT header | TPM header
Luminous Anti-Moisture Coating
5X Protection III
(Multiple Hardware Safeguards
For all-round protection)

-----------------------------------------------
EXTERNAL GRAPHIC CARD

-----------------------------------------------

INTERNAL GRAPHIC CARD (iGPU)

------------------------------------------------

LED - MONITOR

Monitor Name: Generic PnP Monitor
Monitor Model: HP 22es
Monitor Id: HWP331B
Native Mode: 1920 x 1080(p) (60.000Hz)
Output Type: HDMI

-----------------------------------------------

STORAGE DRIVE

Drive: C:
Free Space: 182.3 GB
Total Space: 253.9 GB
File System: NTFS
Model: WD Blue SN570 1TB (NVMe)

---------------O----------------

My System Info (PDF File).

https://drive.google.com/open?id=1-eoLmuXzshTRH_8RunAYAuNocKpiLoiV&usp=drive_fs

 

Also Check

Some useful creations by me including VEGAS Scripts

https://getopensofts.blogspot.com/

 

My YouTube Channel Dedicated to Only VEGAS Pro Tutorials

EDITROOM : My YouTube Channel (For VEGAS Tutorials)

Phil_P wrote on 2/17/2024, 2:01 AM

@jetdv is indeed the Yoda of Vegas Scripting:

Always pass on what you have learned

- Yoda

😀😍

iEmby wrote on 2/17/2024, 2:38 AM

sir but for effects i think i am doing something wrong

look at my code's starting rest of all is all yours.
it is not giving any error
but also not moving last key

i tested it on Black & While Effect

PROCESSOR
     

Operating System: Windows 11 Pro 64-bit (Always Updated)
System Manufacturer: ASUS
12th Gen Intel(R) Core(TM) i7-12700 (20 CPUs), ~2.1GHz - 4.90GHz
Memory: 32GB RAM
Page File: 11134MB used, 7934MB Available
DirectX Version: DirectX 12

-----------------------------------------------

MOTHERBOARD

 

ASUS PRIME H610-CS D4
Intel® H610 (LGA 1700)
Ready for 12th Gen Intel® Processors
Micro-ATX Motherboard with DDR4
Realtek 1 Gb Ethernet
PCH Heatsink
PCIe 4.0 | M.2 slot (32Gbps) 
HDMI® | D-Sub | USB 3.2 Gen 1 ports
SATA 6 Gbps | COM header
LPT header | TPM header
Luminous Anti-Moisture Coating
5X Protection III
(Multiple Hardware Safeguards
For all-round protection)

-----------------------------------------------
EXTERNAL GRAPHIC CARD

-----------------------------------------------

INTERNAL GRAPHIC CARD (iGPU)

------------------------------------------------

LED - MONITOR

Monitor Name: Generic PnP Monitor
Monitor Model: HP 22es
Monitor Id: HWP331B
Native Mode: 1920 x 1080(p) (60.000Hz)
Output Type: HDMI

-----------------------------------------------

STORAGE DRIVE

Drive: C:
Free Space: 182.3 GB
Total Space: 253.9 GB
File System: NTFS
Model: WD Blue SN570 1TB (NVMe)

---------------O----------------

My System Info (PDF File).

https://drive.google.com/open?id=1-eoLmuXzshTRH_8RunAYAuNocKpiLoiV&usp=drive_fs

 

Also Check

Some useful creations by me including VEGAS Scripts

https://getopensofts.blogspot.com/

 

My YouTube Channel Dedicated to Only VEGAS Pro Tutorials

EDITROOM : My YouTube Channel (For VEGAS Tutorials)

iEmby wrote on 2/17/2024, 2:59 AM

also for this if u can sir
i create a script for copy image seqence to current project location in PNG seqence folder.

also link it with them.

please tell me where i am wrong sir.

PROCESSOR
     

Operating System: Windows 11 Pro 64-bit (Always Updated)
System Manufacturer: ASUS
12th Gen Intel(R) Core(TM) i7-12700 (20 CPUs), ~2.1GHz - 4.90GHz
Memory: 32GB RAM
Page File: 11134MB used, 7934MB Available
DirectX Version: DirectX 12

-----------------------------------------------

MOTHERBOARD

 

ASUS PRIME H610-CS D4
Intel® H610 (LGA 1700)
Ready for 12th Gen Intel® Processors
Micro-ATX Motherboard with DDR4
Realtek 1 Gb Ethernet
PCH Heatsink
PCIe 4.0 | M.2 slot (32Gbps) 
HDMI® | D-Sub | USB 3.2 Gen 1 ports
SATA 6 Gbps | COM header
LPT header | TPM header
Luminous Anti-Moisture Coating
5X Protection III
(Multiple Hardware Safeguards
For all-round protection)

-----------------------------------------------
EXTERNAL GRAPHIC CARD

-----------------------------------------------

INTERNAL GRAPHIC CARD (iGPU)

------------------------------------------------

LED - MONITOR

Monitor Name: Generic PnP Monitor
Monitor Model: HP 22es
Monitor Id: HWP331B
Native Mode: 1920 x 1080(p) (60.000Hz)
Output Type: HDMI

-----------------------------------------------

STORAGE DRIVE

Drive: C:
Free Space: 182.3 GB
Total Space: 253.9 GB
File System: NTFS
Model: WD Blue SN570 1TB (NVMe)

---------------O----------------

My System Info (PDF File).

https://drive.google.com/open?id=1-eoLmuXzshTRH_8RunAYAuNocKpiLoiV&usp=drive_fs

 

Also Check

Some useful creations by me including VEGAS Scripts

https://getopensofts.blogspot.com/

 

My YouTube Channel Dedicated to Only VEGAS Pro Tutorials

EDITROOM : My YouTube Channel (For VEGAS Tutorials)

jetdv wrote on 2/17/2024, 8:13 AM

@iEmby, I know it works - I've already created a tutorial from it working. I tested using the "crop" effect but it should also work fine with the "Black and White" effect.

Why don't you switch to Visual Studio (instead of Visual Studio Code) as it will provide you more features such as code completion!

Based on what I'm seeing of your code, you're never getting the "selected video events". I don't see you going through the list of tracks and the list of events on those tracks to find the "selected events". You're creating a "SelectedVideoEvents" list but you're not populating that list so it has nothing to go through. In short, it's working properly - it just has nothing to work on.

You would need to change the top of "SetLastKey" to something like this:

            List<VideoEvent> SelectedVideoEvents = new List<VideoEvent>;

            foreach (Track myTrack in vegas.Project.Tracks)
            {
                if (myTrack.IsVideo())
                {
                    foreach (VideoEvent vevnt in myTrack.Events)
                    {
                        if (vevnt.Selected)
                        {
                            SelectedVideoEvents.Add(vevnt);
                        }
                    }
                }
            }

Or you need to put the above in "GetSelectedVideoEvents" but then you would actually need to call that routine from "SetLastKey" which you are not currently doing.

The full script that does both Pan/Crop and Effects:

using System;
using System.Collections.Generic;
using System.Collections;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Drawing;
using System.Runtime;
using System.Xml;
using ScriptPortal.Vegas;

namespace Test_Script
{
    public class Class1
    {
        public Vegas myVegas;

        public void Main(Vegas vegas)
        {
            myVegas = vegas;

            foreach(Track myTrack in myVegas.Project.Tracks)
            {
                if (myTrack.IsVideo())
                {
                    foreach(VideoEvent vevnt in myTrack.Events)
                    {
                        if (vevnt.Selected)
                        {
                            //Pan/Crop
                            if (vevnt.VideoMotion.Keyframes.Count > 1)
                            {
                                VideoMotionKeyframe kf = vevnt.VideoMotion.Keyframes[vevnt.VideoMotion.Keyframes.Count - 1];
                                kf.Position = vevnt.Length;
                            }

                            //effects
                            foreach(Effect eff in vevnt.Effects)
                            {
                                if (eff.IsOFX)
                                {
                                    OFXEffect ofx = eff.OFXEffect;
                                    foreach (OFXParameter ofxparm in ofx.Parameters)
                                    {
                                        if ((ofxparm.Name != "Presets") && (ofxparm.Label != "Preset") && (ofxparm.ParameterType.ToString() != "Page")
                                            && (ofxparm.ParameterType.ToString() != "Group") && (ofxparm.ParameterType.ToString() != "PushButton"))
                                        {
                                            if (ofxparm.IsAnimated)
                                            {
                                                switch (ofxparm.ParameterType.ToString())
                                                {
                                                    case "RGB":
                                                        {
                                                            OFXRGBParameter p1 = (OFXRGBParameter)ofx[ofxparm.Name];
                                                            if (p1.Keyframes.Count > 1)
                                                            {
                                                                OFXRGBKeyframe k1 = p1.Keyframes[p1.Keyframes.Count - 1];
                                                                k1.Time = vevnt.Length;
                                                            }
                                                            break;
                                                        }
                                                    case "RGBA":
                                                        {
                                                            OFXRGBAParameter p1 = (OFXRGBAParameter)ofx[ofxparm.Name];
                                                            if (p1.Keyframes.Count > 1)
                                                            {
                                                                OFXRGBAKeyframe k1 = p1.Keyframes[p1.Keyframes.Count - 1];
                                                                k1.Time = vevnt.Length;
                                                            }
                                                            break;
                                                        }
                                                    case "Double":
                                                        {
                                                            OFXDoubleParameter p2 = (OFXDoubleParameter)ofx[ofxparm.Name];
                                                            if (p2.Keyframes.Count > 1)
                                                            {
                                                                OFXDoubleKeyframe k1 = p2.Keyframes[p2.Keyframes.Count - 1];
                                                                k1.Time = vevnt.Length;
                                                            }
                                                            break;
                                                        }
                                                    case "Double2D":
                                                        {
                                                            OFXDouble2DParameter p2 = (OFXDouble2DParameter)ofx[ofxparm.Name];
                                                            if (p2.Keyframes.Count > 1)
                                                            {
                                                                OFXDouble2DKeyframe k1 = p2.Keyframes[p2.Keyframes.Count - 1];
                                                                k1.Time = vevnt.Length;
                                                            }
                                                            break;
                                                        }
                                                    case "Double3D":
                                                        {
                                                            OFXDouble3DParameter p2 = (OFXDouble3DParameter)ofx[ofxparm.Name];
                                                            if (p2.Keyframes.Count > 1)
                                                            {
                                                                OFXDouble3DKeyframe k1 = p2.Keyframes[p2.Keyframes.Count - 1];
                                                                k1.Time = vevnt.Length;
                                                            }
                                                            break;
                                                        }
                                                    case "Integer":
                                                        {
                                                            OFXIntegerParameter p2 = (OFXIntegerParameter)ofx[ofxparm.Name];
                                                            if (p2.Keyframes.Count > 1)
                                                            {
                                                                OFXIntegerKeyframe k1 = p2.Keyframes[p2.Keyframes.Count - 1];
                                                                k1.Time = vevnt.Length;
                                                            }
                                                            break;
                                                        }
                                                    case "Integer2D":
                                                        {
                                                            OFXInteger2DParameter p2 = (OFXInteger2DParameter)ofx[ofxparm.Name];
                                                            if (p2.Keyframes.Count > 1)
                                                            {
                                                                OFXInteger2DKeyframe k1 = p2.Keyframes[p2.Keyframes.Count - 1];
                                                                k1.Time = vevnt.Length;
                                                            }
                                                            break;
                                                        }
                                                    case "Integer3D":
                                                        {
                                                            OFXInteger3DParameter p2 = (OFXInteger3DParameter)ofx[ofxparm.Name];
                                                            if (p2.Keyframes.Count > 1)
                                                            {
                                                                OFXInteger3DKeyframe k1 = p2.Keyframes[p2.Keyframes.Count - 1];
                                                                k1.Time = vevnt.Length;
                                                            }
                                                            break;
                                                        }
                                                    case "Choice":
                                                        {
                                                            OFXChoiceParameter p3 = (OFXChoiceParameter)ofx[ofxparm.Name];
                                                            if (p3.Keyframes.Count > 1)
                                                            {
                                                                OFXChoiceKeyframe k1 = p3.Keyframes[p3.Keyframes.Count - 1];
                                                                k1.Time = vevnt.Length;
                                                            }
                                                            break;
                                                        }
                                                    case "Boolean":
                                                        {
                                                            OFXBooleanParameter p4 = (OFXBooleanParameter)ofx[ofxparm.Name];
                                                            if (p4.Keyframes.Count > 1)
                                                            {
                                                                OFXBooleanKeyframe k1 = p4.Keyframes[p4.Keyframes.Count - 1];
                                                                k1.Time = vevnt.Length;
                                                            }
                                                            break;
                                                        }
                                                    case "String":
                                                        {
                                                            OFXStringParameter p5 = (OFXStringParameter)ofx[ofxparm.Name];
                                                            if (p5.Keyframes.Count > 1)
                                                            {
                                                                OFXStringKeyframe k1 = p5.Keyframes[p5.Keyframes.Count - 1];
                                                                k1.Time = vevnt.Length;
                                                            }
                                                            break;
                                                        }
                                                    case "Custom":
                                                        {
                                                            OFXCustomParameter p5 = (OFXCustomParameter)ofx[ofxparm.Name];
                                                            if (p5.Keyframes.Count > 1)
                                                            {
                                                                OFXCustomKeyframe k1 = p5.Keyframes[p5.Keyframes.Count - 1];
                                                                k1.Time = vevnt.Length;
                                                            }
                                                            break;
                                                        }
                                                    default:
                                                        {
                                                            break;
                                                        }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

public class EntryPoint
{
    public void FromVegas(Vegas vegas)
    {
        Test_Script.Class1 test = new Test_Script.Class1();
        test.Main(vegas);
    }
}

 

jetdv wrote on 2/17/2024, 8:15 AM

@iEmby, I've not really done much with image sequences. Is that code currently copying all of the files? What is it that you're wanting it to do that it's not doing?

iEmby wrote on 2/17/2024, 9:05 AM

@iEmby, I've not really done much with image sequences. Is that code currently copying all of the files? What is it that you're wanting it to do that it's not doing?

Sir i just want to copy imageseqence if any exist in my media pool in a folder named PNG Sequence which should be located at my current project folder.
and my project's mediapool imagesequence should also get connected to this copied imageseqence for future use.

PROCESSOR
     

Operating System: Windows 11 Pro 64-bit (Always Updated)
System Manufacturer: ASUS
12th Gen Intel(R) Core(TM) i7-12700 (20 CPUs), ~2.1GHz - 4.90GHz
Memory: 32GB RAM
Page File: 11134MB used, 7934MB Available
DirectX Version: DirectX 12

-----------------------------------------------

MOTHERBOARD

 

ASUS PRIME H610-CS D4
Intel® H610 (LGA 1700)
Ready for 12th Gen Intel® Processors
Micro-ATX Motherboard with DDR4
Realtek 1 Gb Ethernet
PCH Heatsink
PCIe 4.0 | M.2 slot (32Gbps) 
HDMI® | D-Sub | USB 3.2 Gen 1 ports
SATA 6 Gbps | COM header
LPT header | TPM header
Luminous Anti-Moisture Coating
5X Protection III
(Multiple Hardware Safeguards
For all-round protection)

-----------------------------------------------
EXTERNAL GRAPHIC CARD

-----------------------------------------------

INTERNAL GRAPHIC CARD (iGPU)

------------------------------------------------

LED - MONITOR

Monitor Name: Generic PnP Monitor
Monitor Model: HP 22es
Monitor Id: HWP331B
Native Mode: 1920 x 1080(p) (60.000Hz)
Output Type: HDMI

-----------------------------------------------

STORAGE DRIVE

Drive: C:
Free Space: 182.3 GB
Total Space: 253.9 GB
File System: NTFS
Model: WD Blue SN570 1TB (NVMe)

---------------O----------------

My System Info (PDF File).

https://drive.google.com/open?id=1-eoLmuXzshTRH_8RunAYAuNocKpiLoiV&usp=drive_fs

 

Also Check

Some useful creations by me including VEGAS Scripts

https://getopensofts.blogspot.com/

 

My YouTube Channel Dedicated to Only VEGAS Pro Tutorials

EDITROOM : My YouTube Channel (For VEGAS Tutorials)

iEmby wrote on 2/17/2024, 9:17 AM

@iEmby, I know it works - I've already created a tutorial from it working. I tested using the "crop" effect but it should also work fine with the "Black and White" effect.

Why don't you switch to Visual Studio (instead of Visual Studio Code) as it will provide you more features such as code completion!

Based on what I'm seeing of your code, you're never getting the "selected video events". I don't see you going through the list of tracks and the list of events on those tracks to find the "selected events". You're creating a "SelectedVideoEvents" list but you're not populating that list so it has nothing to go through. In short, it's working properly - it just has nothing to work on.

You would need to change the top of "SetLastKey" to something like this:

            List<VideoEvent> SelectedVideoEvents = new List<VideoEvent>;

            foreach (Track myTrack in vegas.Project.Tracks)
            {
                if (myTrack.IsVideo())
                {
                    foreach (VideoEvent vevnt in myTrack.Events)
                    {
                        if (vevnt.Selected)
                        {
                            SelectedVideoEvents.Add(vevnt);
                        }
                    }
                }
            }

Sir heartly thanks for sharing your knowledge and support. it works.

PROCESSOR
     

Operating System: Windows 11 Pro 64-bit (Always Updated)
System Manufacturer: ASUS
12th Gen Intel(R) Core(TM) i7-12700 (20 CPUs), ~2.1GHz - 4.90GHz
Memory: 32GB RAM
Page File: 11134MB used, 7934MB Available
DirectX Version: DirectX 12

-----------------------------------------------

MOTHERBOARD

 

ASUS PRIME H610-CS D4
Intel® H610 (LGA 1700)
Ready for 12th Gen Intel® Processors
Micro-ATX Motherboard with DDR4
Realtek 1 Gb Ethernet
PCH Heatsink
PCIe 4.0 | M.2 slot (32Gbps) 
HDMI® | D-Sub | USB 3.2 Gen 1 ports
SATA 6 Gbps | COM header
LPT header | TPM header
Luminous Anti-Moisture Coating
5X Protection III
(Multiple Hardware Safeguards
For all-round protection)

-----------------------------------------------
EXTERNAL GRAPHIC CARD

-----------------------------------------------

INTERNAL GRAPHIC CARD (iGPU)

------------------------------------------------

LED - MONITOR

Monitor Name: Generic PnP Monitor
Monitor Model: HP 22es
Monitor Id: HWP331B
Native Mode: 1920 x 1080(p) (60.000Hz)
Output Type: HDMI

-----------------------------------------------

STORAGE DRIVE

Drive: C:
Free Space: 182.3 GB
Total Space: 253.9 GB
File System: NTFS
Model: WD Blue SN570 1TB (NVMe)

---------------O----------------

My System Info (PDF File).

https://drive.google.com/open?id=1-eoLmuXzshTRH_8RunAYAuNocKpiLoiV&usp=drive_fs

 

Also Check

Some useful creations by me including VEGAS Scripts

https://getopensofts.blogspot.com/

 

My YouTube Channel Dedicated to Only VEGAS Pro Tutorials

EDITROOM : My YouTube Channel (For VEGAS Tutorials)

iEmby wrote on 2/19/2024, 12:55 PM

@jetdv how can i make a numbers of buttons script openable just like Vegasaur icon. Like click and choose what to do?

this is my running script

 

and this is my code looks like

 

according to my code.. how much work i need to do to make it like Vegasaur icon behaviour.
like this


please help in this sir.
 

PROCESSOR
     

Operating System: Windows 11 Pro 64-bit (Always Updated)
System Manufacturer: ASUS
12th Gen Intel(R) Core(TM) i7-12700 (20 CPUs), ~2.1GHz - 4.90GHz
Memory: 32GB RAM
Page File: 11134MB used, 7934MB Available
DirectX Version: DirectX 12

-----------------------------------------------

MOTHERBOARD

 

ASUS PRIME H610-CS D4
Intel® H610 (LGA 1700)
Ready for 12th Gen Intel® Processors
Micro-ATX Motherboard with DDR4
Realtek 1 Gb Ethernet
PCH Heatsink
PCIe 4.0 | M.2 slot (32Gbps) 
HDMI® | D-Sub | USB 3.2 Gen 1 ports
SATA 6 Gbps | COM header
LPT header | TPM header
Luminous Anti-Moisture Coating
5X Protection III
(Multiple Hardware Safeguards
For all-round protection)

-----------------------------------------------
EXTERNAL GRAPHIC CARD

-----------------------------------------------

INTERNAL GRAPHIC CARD (iGPU)

------------------------------------------------

LED - MONITOR

Monitor Name: Generic PnP Monitor
Monitor Model: HP 22es
Monitor Id: HWP331B
Native Mode: 1920 x 1080(p) (60.000Hz)
Output Type: HDMI

-----------------------------------------------

STORAGE DRIVE

Drive: C:
Free Space: 182.3 GB
Total Space: 253.9 GB
File System: NTFS
Model: WD Blue SN570 1TB (NVMe)

---------------O----------------

My System Info (PDF File).

https://drive.google.com/open?id=1-eoLmuXzshTRH_8RunAYAuNocKpiLoiV&usp=drive_fs

 

Also Check

Some useful creations by me including VEGAS Scripts

https://getopensofts.blogspot.com/

 

My YouTube Channel Dedicated to Only VEGAS Pro Tutorials

EDITROOM : My YouTube Channel (For VEGAS Tutorials)

jetdv wrote on 2/19/2024, 4:13 PM

I did Excalibur differently:

Basically, you need to create a menu system instead of a bunch of buttons. Each button would be a menu header and then each option inside the button would need to become a sub-menu instead of another button.