Skip to content

Commit

Permalink
add Scramble script
Browse files Browse the repository at this point in the history
  • Loading branch information
delthas committed Apr 15, 2018
1 parent 728ac6c commit 2cacba7
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Datamosh.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions Datamosh14.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
21 changes: 15 additions & 6 deletions Layer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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",
Expand All @@ -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;
Expand Down Expand Up @@ -301,6 +308,7 @@ public void FromVegas(Vegas vegas) {
MessageBox.Show("No folder selected");
return;
}

finalFolder = dialog.FileName;
}

Expand Down Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions Layer14.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.*

Expand Down
4 changes: 2 additions & 2 deletions Render.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions Render14.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2cacba7

Please sign in to comment.