annotate Flip Events.cs @ 4:d32ae6be32a4

*: mass rename files committer: GitHub <noreply@github.com>
author Paper <37962225+mrpapersonic@users.noreply.github.com>
date Mon, 23 Jan 2023 23:35:06 -0500
parents screenflip.cs@32af787f8cb8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
1 #define VER_GEQ_14 // remove this for vegas 13
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
2 #if VER_GEQ_14
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
3 using ScriptPortal.Vegas;
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
4 #else
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
5 using Sony.Vegas;
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
6 #endif
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
7 using System.Windows.Forms;
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
8
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
9 public class EntryPoint {
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
10 public void FromVegas(Vegas vegas) {
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
11 foreach (Track track in vegas.Project.Tracks) {
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
12 int count = 1;
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
13 foreach (TrackEvent trackEvent in track.Events) {
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
14 if (trackEvent.Selected && trackEvent.IsVideo()) {
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
15 VideoEvent video = trackEvent as VideoEvent;
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
16 foreach (VideoMotionKeyframe keyframe in video.VideoMotion.Keyframes) {
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
17 VideoMotionVertex tl = keyframe.TopLeft,
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
18 tr = keyframe.TopRight,
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
19 bl = keyframe.BottomLeft,
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
20 br = keyframe.BottomRight;
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
21 VideoMotionBounds bh = new VideoMotionBounds(tl, tr, br, bl);
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
22 if (count == 2)
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
23 bh = new VideoMotionBounds(tr, tl, bl, br);
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
24 keyframe.Bounds = bh;
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
25 }
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
26 if (count == 2)
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
27 count = 0;
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
28 count += 1;
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
29 }
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
30 }
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
31 }
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
32 }
32af787f8cb8 Migrate files from gist
Paper <37962225+mrpapersonic@users.noreply.github.com>
parents:
diff changeset
33 }