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.

 

 

 

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 😐

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

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.