Script running faster than extension?

W-Music wrote on 12/31/2020, 12:44 PM

I have recently started rewriting my scripts for creating Multitrack-Templates into an extension. (If you are reading this you probably saw the post I am referring to: https://www.vegascreativesoftware.info/us/forum/showcase-complex-video-wall-script-for-magix-vegas--126043/ )

 

I have noticed that while the script (being compiled by VEGAS first) ran through entirely without updating the GUI of VEGAS. Meaning: I didn't see anything in the preview window.

Now the same processes (only minimally slower by some switches/if-statements) seem to take longer and I can see the tracks being added and see them popping up one by one (even if pretty fast) on the preview window.

When scripting in Excel I would hold all calculations and updates for the duration of the script and then give it the go to recalculate everything after it has run. Is there a similar function to Vegas? A way to stop GUI-updates or the preview-rendering?

How are scripts and extensions treating different in this regard? i am assuming that the Undo-Block might be at fault for this?

Comments

jetdv wrote on 12/31/2020, 3:00 PM

You can force Vegas to update using the Vegas.UpdateUI(); command. But I'm not sure of a way to tell it to "not" update the screen. You could test the "undo" theory by having one great big "undo" around the entire routine vs having several smaller ones over individual sections. But I don't think that would really have anything to do with whether or not the screen updated.

W-Music wrote on 1/3/2021, 5:22 AM

I believe I have misled myself in this. Seems that the script is running much fast when the cursor isn't at the location where new events lead to a preview-screen update. I did not account for that and see no difference after all!