💡 (Feature Request) Selectively Delete

m3lquixd wrote on 3/11/2023, 3:51 PM

A feature that I don't think will interest everyone, but I found it useful and combines with the Selectively Paste Attributes function. It would be a "Selectively Delete". It would work as follows: I would select several events on the timeline, I would click with the right button on the "Selectively Delete" option, there would appear the plugins that are applied to the selected events, then I could choose which ones I want to remove from all that I selected.

This video is just an example.
Ps. I don't want to mix the "Selectively Paste Attributes" I'm just showing that I could have a window like his.

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

Comments

jetdv wrote on 3/11/2023, 6:21 PM

This actually makes more sense and, yes, it can be done:

To list the available effects to remove means it won't be a 5 minute job to create like some of the other scripts you've requested. The biggest issue is it needs a form for selecting the effect(s) to be removed. Yes, it can be done but it will take a little time to work out the details.

jetdv wrote on 3/11/2023, 7:23 PM

I included the "form" code inside the main code block so it reads odd and there's lots of extra lines but I didn't have to build a DLL file this way...
 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ScriptPortal.Vegas;

namespace Remove_Selected_Effects
{
    public partial class frmRSE : Form
    {
        public Vegas myVegas;

        public frmRSE(Vegas vegas)
        {
            myVegas = vegas;
            InitializeComponent();

            foreach (Track myTrack in myVegas.Project.Tracks)
            {
                if (myTrack.IsVideo())
                {
                    foreach (TrackEvent evnt in myTrack.Events)
                    {
                        if (evnt.Selected)
                        {
                            VideoEvent vEvent = (VideoEvent)evnt;
                            foreach (Effect eff in vEvent.Effects)
                            {
                                string effName = eff.Description;
                                if (!cklEffects.Items.Contains(effName))
                                {
                                    cklEffects.Items.Add(effName, false);
                                }
                            }
                        }
                    }
                }
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            foreach (Track myTrack in myVegas.Project.Tracks)
            {
                if (myTrack.IsVideo())
                {
                    foreach (TrackEvent evnt in myTrack.Events)
                    {
                        if (evnt.Selected)
                        {
                            VideoEvent vEvent = (VideoEvent)evnt;
                            foreach (object itemChecked in cklEffects.CheckedItems)
                            {
                                string effName = itemChecked.ToString();
                                foreach(Effect eff in vEvent.Effects)
                                {
                                    if (effName == eff.Description)
                                    {
                                        vEvent.Effects.Remove(eff);
                                    }
                                }
                            }
                        }
                    }
                }
            }

            this.Close();
        }

        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.label1 = new System.Windows.Forms.Label();
            this.button1 = new System.Windows.Forms.Button();
            this.cklEffects = new System.Windows.Forms.CheckedListBox();
            this.SuspendLayout();
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(11, 24);
            this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(128, 13);
            this.label1.TabIndex = 1;
            this.label1.Text = "Select Effects to Remove";
            //
            // button1
            //
            this.button1.Location = new System.Drawing.Point(110, 262);
            this.button1.Margin = new System.Windows.Forms.Padding(2);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(151, 31);
            this.button1.TabIndex = 2;
            this.button1.Text = "Remove Effects";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // cklEffects
            //
            this.cklEffects.CheckOnClick = true;
            this.cklEffects.FormattingEnabled = true;
            this.cklEffects.Location = new System.Drawing.Point(14, 40);
            this.cklEffects.Name = "cklEffects";
            this.cklEffects.Size = new System.Drawing.Size(382, 214);
            this.cklEffects.TabIndex = 5;
            //
            // frmRSE
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(408, 304);
            this.Controls.Add(this.cklEffects);
            this.Controls.Add(this.button1);
            this.Controls.Add(this.label1);
            this.Margin = new System.Windows.Forms.Padding(2);
            this.Name = "frmRSE";
            this.Text = "Remove Selected Effects";
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.CheckedListBox cklEffects;
    }
}

public class EntryPoint
{
    private static Remove_Selected_Effects.frmRSE form;

    public void FromVegas(Vegas vegas)
    {
        form = new Remove_Selected_Effects.frmRSE(vegas);
        form.ShowDialog();
    }
}

 

m3lquixd wrote on 3/11/2023, 7:48 PM

Oh my God! I can't believe you created it. Thank you very much! This order was for the DEVs. It was a feature request lol but apparently I don't even need the request anymore. You do very well. Thanks for everything, I hope this script is useful for someone else, because it must have taken some work. I'm sorry I've been making so many requests and I'm sorry for the confusion about this request, but since you did... I just have to say thank you.
Obs. From what I've tested, the script is working perfectly.

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))