From 2cacba76fc79b966ce8638d3bbf1ad811d5ed56a Mon Sep 17 00:00:00 2001 From: delthas Date: Sun, 15 Apr 2018 00:30:37 -0400 Subject: [PATCH] add Scramble script --- Datamosh.cs | 4 ++-- Datamosh14.cs | 4 ++-- Layer.cs | 21 +++++++++++++++------ Layer14.cs | 4 ++-- README.md | 7 +++++++ Render.cs | 4 ++-- Render14.cs | 4 ++-- 7 files changed, 32 insertions(+), 16 deletions(-) diff --git a/Datamosh.cs b/Datamosh.cs index e767c2f..da8ff12 100644 --- a/Datamosh.cs +++ b/Datamosh.cs @@ -2,11 +2,11 @@ // quickly and automatically. // // Author: delthas -// Date: 2018-04-14 +// Date: 2018-04-15 // License: MIT // Source: https://github.com/delthas/vegas-datamosh // Documentation: https://github.com/delthas/vegas-datamosh -// Version: 1.1.1 +// Version: 1.2.0 // using System; diff --git a/Datamosh14.cs b/Datamosh14.cs index dd314c8..3601e8a 100644 --- a/Datamosh14.cs +++ b/Datamosh14.cs @@ -2,11 +2,11 @@ // quickly and automatically. // // Author: delthas -// Date: 2018-04-14 +// Date: 2018-04-15 // License: MIT // Source: https://github.com/delthas/vegas-datamosh // Documentation: https://github.com/delthas/vegas-datamosh -// Version: 1.1.1 +// Version: 1.2.0 // using System; diff --git a/Layer.cs b/Layer.cs index 649f202..9562182 100644 --- a/Layer.cs +++ b/Layer.cs @@ -2,11 +2,11 @@ // quickly and automatically. // // Author: delthas -// Date: 2018-04-14 +// Date: 2018-04-15 // License: MIT // Source: https://github.com/delthas/vegas-datamosh // Documentation: https://github.com/delthas/vegas-datamosh -// Version: 1.1.1 +// Version: 1.2.0 // using System; @@ -213,7 +213,10 @@ public void FromVegas(Vegas vegas) { Checked = defaultCheck }; var confirmation = new Button {Text = "OK", Left = 200, Width = 100, Top = 100}; - confirmation.Click += (sender, e) => { prompt.DialogResult = DialogResult.OK; prompt.Close(); }; + confirmation.Click += (sender, e) => { + prompt.DialogResult = DialogResult.OK; + prompt.Close(); + }; prompt.KeyPress += (sender, args) => { if (args.KeyChar != ' ') return; inputBox3.Checked = !inputBox3.Checked; @@ -231,6 +234,7 @@ public void FromVegas(Vegas vegas) { if (prompt.ShowDialog() != DialogResult.OK) { return; } + var count = (int) inputBox.Value; var offset = (int) inputBox2.Value; var render = inputBox3.Checked; @@ -244,12 +248,13 @@ public void FromVegas(Vegas vegas) { MessageBox.Show("Layer count must be > 0!"); return; } - + if (defaultCount != count) { Registry.SetValue( "HKEY_CURRENT_USER\\SOFTWARE\\Sony Creative Software\\Custom Presets", "LayerCount", count.ToString(), RegistryValueKind.String); } + if (defaultCheck != render) { Registry.SetValue( "HKEY_CURRENT_USER\\SOFTWARE\\Sony Creative Software\\Custom Presets", @@ -264,13 +269,15 @@ public void FromVegas(Vegas vegas) { for (var i = videoTrackIndex - 1; i >= 0 && current < count; i--) { var videoTrack = vegas.Project.Tracks[i] as VideoTrack; if (videoTrack == null) continue; - newEvents.Add((VideoEvent) videoEvent.Copy(videoTrack, Timecode.FromFrames(videoEvent.Start.FrameCount + baseOffset + (++current) * offset))); + newEvents.Add((VideoEvent) videoEvent.Copy(videoTrack, + Timecode.FromFrames(videoEvent.Start.FrameCount + baseOffset + (++current) * offset))); } for (; current < count;) { var videoTrack = vegas.Project.AddVideoTrack(); newTracks.Add(videoTrack); - newEvents.Add((VideoEvent) videoEvent.Copy(videoTrack, Timecode.FromFrames(videoEvent.Start.FrameCount + baseOffset + (++current) * offset))); + newEvents.Add((VideoEvent) videoEvent.Copy(videoTrack, + Timecode.FromFrames(videoEvent.Start.FrameCount + baseOffset + (++current) * offset))); } var start = videoEvent.Start; @@ -301,6 +308,7 @@ public void FromVegas(Vegas vegas) { MessageBox.Show("No folder selected"); return; } + finalFolder = dialog.FileName; } @@ -342,6 +350,7 @@ public void FromVegas(Vegas vegas) { foreach (var newEvent in newEvents) { newEvent.Track.Events.Remove(newEvent); } + foreach (var newTrack in newTracks) { vegas.Project.Tracks.Remove(newTrack); } diff --git a/Layer14.cs b/Layer14.cs index f26c7c5..da0f17b 100644 --- a/Layer14.cs +++ b/Layer14.cs @@ -2,11 +2,11 @@ // quickly and automatically. // // Author: delthas -// Date: 2018-04-14 +// Date: 2018-04-15 // License: MIT // Source: https://github.com/delthas/vegas-datamosh // Documentation: https://github.com/delthas/vegas-datamosh -// Version: 1.1.1 +// Version: 1.2.0 // using System; diff --git a/README.md b/README.md index 6818ba9..199bebd 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,13 @@ To use, make a selection in the timeline using I and O, then it will be rendered **The rendered file will support alpha/transparency, meaning you don't need to add a green screen and remove it after, the alpha is handled automatically.** +### Scramble +This simply scrambles multiple clips/events, by cutting them in subclips of length N, and shuffling the subclips. N is the ```Scramble size```, and is usually 1. + +To use, select several clips/events (they must be actually selected, not only in group-selected), then they will be scrambled automatically. + +*Clips starting and ending at the same time will be scrambled together, ie their subclips will be shuffled the same way.* + ## Tips *On most script window prompts, pressing ```enter``` confirms and pressing ```space``` toggles the checkbox (if present) so you don't even need to use your mouse most of the times.* diff --git a/Render.cs b/Render.cs index 3e7d766..301749a 100644 --- a/Render.cs +++ b/Render.cs @@ -2,11 +2,11 @@ // quickly and automatically. // // Author: delthas -// Date: 2018-04-14 +// Date: 2018-04-15 // License: MIT // Source: https://github.com/delthas/vegas-datamosh // Documentation: https://github.com/delthas/vegas-datamosh -// Version: 1.1.1 +// Version: 1.2.0 // using System; diff --git a/Render14.cs b/Render14.cs index 09f4b78..03657ae 100644 --- a/Render14.cs +++ b/Render14.cs @@ -2,11 +2,11 @@ // quickly and automatically. // // Author: delthas -// Date: 2018-04-14 +// Date: 2018-04-15 // License: MIT // Source: https://github.com/delthas/vegas-datamosh // Documentation: https://github.com/delthas/vegas-datamosh -// Version: 1.1.1 +// Version: 1.2.0 // using System;