private void renderOtherTemplate_Click(object sender, EventArgs e) { if (selectionBox.Checked) { Timecode loopRegionStart = vegas.Transport.LoopRegionStart; Timecode loopRegionLength = vegas.Transport.LoopRegionLength; if (loopRegionStart == null || loopRegionLength == null) { MessageBox.Show("No loop region found.", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } Region newRegion = new Region(loopRegionStart, loopRegionLength); vegas.Project.Regions.Add(newRegion); RenderArgs loopRenderArgs = new RenderArgs(); string outputFileName = Path.GetFileNameWithoutExtension(vegas.Project.FilePath); if (addTemplateNameBox.Checked) { // Assuming you have a method to get the selected template from the ComboBox RenderTemplate selectedTemplate = otherTemplatesCombo.SelectedItem as RenderTemplate; if (selectedTemplate != null) { outputFileName += "_" + selectedTemplate.Name; loopRenderArgs.RenderTemplate = selectedTemplate; } } outputFileName += ".mp4"; string outputFilePath = Path.Combine(renderDirectory, outputFileName); loopRenderArgs.OutputFile = GetUniqueFileName(outputFilePath, overwriteBox.Checked); loopRenderArgs.Start = loopRegionStart; loopRenderArgs.Length = loopRegionLength; SaveProjectAsBackup(); MuteAudioIfChecked(); RenderAudioTracksOnly(); RenderVideoTracksOnly(); vegas.Render(loopRenderArgs); UnmutePreviouslyMutedIfChecked(); vegas.Project.Regions.Remove(newRegion); vegas.UpdateUI(); CollectMediaIfChecked(); OpenRenderFolder(outputFilePath); } else if (regionsBox.Checked) { int counter = 1; foreach (Region region in vegas.Project.Regions) { string regionLabel = !string.IsNullOrEmpty(region.Label) ? region.Label : $"{Path.GetFileNameWithoutExtension(vegas.Project.FilePath)}_Region_{counter++}"; RenderArgs renderArgs = new RenderArgs(); string outputFileName = regionLabel; if (addTemplateNameBox.Checked) { // Assuming you have a method to get the selected template from the ComboBox RenderTemplate selectedTemplate = otherTemplatesCombo.SelectedItem as RenderTemplate; if (selectedTemplate != null) { outputFileName += "_" + selectedTemplate.Name; renderArgs.RenderTemplate = selectedTemplate; } } outputFileName += ".mp4"; string outputFilePath = Path.Combine(renderDirectory, outputFileName); renderArgs.OutputFile = GetUniqueFileName(outputFilePath, overwriteBox.Checked); renderArgs.Start = region.Position; renderArgs.Length = region.Length; SaveProjectAsBackup(); RenderAudioTracksOnly(); RenderVideoTracksOnly(); MuteAudioIfChecked(); vegas.Render(renderArgs); UnmutePreviouslyMutedIfChecked(); vegas.UpdateUI(); CollectMediaIfChecked(); OpenRenderFolder(outputFilePath); } } }
in this script first thing i can't figure out a simple thing which is file extension should be same as rendering template.
if i select to render mp3 then it should be .mp3 and if it is mp4 png or whatever it should be as per template.
and secondly
look at this
i test it it runs ok but i want when that combo box before render other templates has not template selected then renderOtherTemplates should be disable. fade out like i did with others but cant apply on this.
my combo box name is otherTemplatesCombo and render other tempates buttons name is renderOtherTemplate.
code is provided above.
please help in these both issues.
thanks