How to compile a script (101)?

gary-o wrote on 8/6/2020, 10:16 AM

Sorry for the really basic question, I looked but couldn't find...

So I have a CS script that works in Vegas.

How do I then compile it into a DLL? I have Visual Studio Code with .NET, but I'm going round in circles trying to figure out how to create a project or build event or whatever the technical terms is.

Then I discovered that I must compile it using CSC.exe - but then I get an error saying that it doesn't recognize the Vegas library or objects.

Then I came across a website that says I must execute vegas70.exe -SCRIPT:scriptfilename. (Okay that was very out of date, so I tried doing the same with vegas180.exe -SCRIPT:filename). But that just loaded up the Vegas editor.

What am I missing?

Comments

jetdv wrote on 8/6/2020, 1:18 PM

I compile my DLLs straight from Visual Studio. Build - Build solution in the menu.

You also need the correct "entrypoint" such as:

public class EntryPoint
{
    private static VegasStreamImport.VegasStreamImportForm form;

    public void FromVegas(Vegas vegas)
    {
        form = new VegasStreamImport.VegasStreamImportForm(vegas);
        form.ShowDialog();
    }
}

This particular script loads the form and then will do whatever it's supposed to do after you set whatever needs to be set.