How can we match project properties with media properties via script?

iEmby wrote on 8/25/2024, 4:17 PM

How can we match project properties with media properties via script?

like first remember current project properties then set same as any particular media then after a process revert back to current project properties.

 

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

jetdv wrote on 8/26/2024, 2:51 PM

I'm not exactly sure which properties you want to match. But create a variable for each one and set that variable to the current value. Then change the current value to the event value. Finally change it back to the saved value. For example:
 

            //save the current values
            int saveHeight = myVegas.Project.Video.Height;
            int saveWidth = myVegas.Project.Video.Width;
            double savePAR = myVegas.Project.Video.PixelAspectRatio;

            //Set the values to that of the desired event
            VideoEvent vEvent = (VideoEvent)evnt;
            VideoStream vs = (VideoStream)vEvent.ActiveTake.Media.Streams.GetItemByMediaType(MediaType.Video, vEvent.ActiveTake.StreamIndex);
            myVegas.Project.Video.Height = vs.Height;
            myVegas.Project.Video.Width = vs.Width;
            myVegas.Project.Video.PixelAspectRatio = vs.PixelAspectRatio;

            //Do the needed processing

            //Now reset them back
            myVegas.Project.Video.Height = saveHeight;
            myVegas.Project.Video.Width = saveWidth;
            myVegas.Project.Video.PixelAspectRatio = savePAR;

 

jetdv wrote on 8/26/2024, 2:55 PM

jetdv wrote on 8/27/2024, 10:26 AM

Then you can actually match the project to a specific media like this:

myVegas.Project.MatchProjectSettingsWithMedia(evnt.ActiveTake.Media);