Simple Vegas extension example?

fould12 wrote on 3/9/2017, 10:12 PM

I have been trying to make my own Vegas extension with C#, but I don't know how to give custom commands such as copying a track event, or setting the fade of an event, or changing its position. I have a feeling I need to use the CustomCommand class, but I don't know exactly how to use it.

I've seen some source code and examples that work, but they're either too simple that they don't show you anything besides making a simple window, or so complex that it is almost impossible to know how anything works.

Is there an example [or collection of examples] that show how to do something as simple as making a form that has a button, and pressing that button will do something like, say, duplicate an event?

Comments

Bruggeling wrote on 3/10/2017, 4:14 PM

Just like you I am at the very beginning of writing extensions for Vegas. As usual the easy things are *well* documented, but when you try to do something more complicated you are on your own. The people who have solved all the problems probably are selling their solution, and don't want to make their code available.

To make it even more difficult (in a way) I am writing the software in a new language (x#) I want to learn because the compiler and the readability of the code are way better than c#. The docs are also very wanting, although there is a forum with a lot of very active and helpful people. It really is a good language to develop in.

I have written an extension that shows the lengths of all selected events, that automatically shows the video and the audio durations, with and without fade-over times.

What I am busy doing now is writing code that lets me click a button while the movie is playing. Every time I push the code remembers the time, afterwards the software can create markers on those points. The goal is to be able to edit films on complex rythms, so I would play the music at half speed and click where the scenes should change.

I leave you with an image of what I have accomplished so far. If you are interested in the code, I could post it, to give you an idea. The button I want to use for my end goal is already visible.

 

 

 

Main cameras Panasonic S5, still using some FZ1000

Windows 11
Processor AMD Ryzen 7 3700X 8-Core Processor 4.20 GHz
GPU NVidia Geforce RTX 2070 super
RAM 32,0 GB

Main disk M2 2 Terabyte, other disks SSD on SATA, some on USB.

fould12 wrote on 3/10/2017, 6:15 PM

Thanks for the reply, that is very interesting. I was thinking of making a short tutorial showing how to do basic things like edit events, add plugins, or specifying dialog or toolbar menu button, etc. I might do it as soon as I figure out how to do all those things myself. :)

I've been browsing the forums for a while and found out how to do most of what I needed, so I don't really need examples as much now. It would be nice if there was some sort of example collection that people could add to and reference, though, so that people don't have to look through the forums like you and me.

JohnnyRoy wrote on 3/10/2017, 6:34 PM

Have you looked at the MAGIX Tools For Developers web page? On there you will find download links for the Script SDK and Script FAQ. Understanding this is critical for developing script extensions.

~jr

Bruggeling wrote on 3/11/2017, 10:08 AM

Hahaha, just realised that I was programming something that is already available in Vegas... By just pressing the "M" key I achieve what I was trying to write. Never too late to read the manual I guess 😐

Main cameras Panasonic S5, still using some FZ1000

Windows 11
Processor AMD Ryzen 7 3700X 8-Core Processor 4.20 GHz
GPU NVidia Geforce RTX 2070 super
RAM 32,0 GB

Main disk M2 2 Terabyte, other disks SSD on SATA, some on USB.

fould12 wrote on 3/12/2017, 6:56 PM

Have you looked at the MAGIX Tools For Developers web page? On there you will find download links for the Script SDK and Script FAQ. Understanding this is critical for developing script extensions.

I have, but there was only a few bare minimum complete examples, without showing how to do anything very advanced in a complete project example. It was very helpful, but it didn't give me everything I needed (for example, it mentions nothing about needing an UndoBlock to edit project properties, at least from what I could find).

wwaag wrote on 3/15/2017, 11:02 PM

Here is an example of what I think you want. You actually end up with a working extension. You can download the code and see how it works.

https://code.msdn.microsoft.com/windowsapps/Dockable-usercontrol-for-1daf9540#content

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

JohnnyRoy wrote on 3/16/2017, 11:53 AM

@wwaag The most valuable thing on that page was actually link to the old Sony SDK:

http://www.sonycreativesoftware.com/download/link?id=4746.1

This has lots of good examples including the source for a complete working dockable control. The CHANGES.txt file explains using the Undo block. That's the only place that it's documented.

~jr

fould12 wrote on 3/17/2017, 4:03 PM

Here is an example of what I think you want. You actually end up with a working extension. You can download the code and see how it works.

https://code.msdn.microsoft.com/windowsapps/Dockable-usercontrol-for-1daf9540#content

Thanks, that shows a few things that I was wondering about, like the UndoBlock and using media generation and OFX effects. It still doesn't have everything, but it is useful.

 

The CHANGES.txt file explains using the Undo block. That's the only place that it's documented.

~jr

I didn't check the changes file, I didn't realize how much information it had. I think I'll check that out too.