Comments

jetdv wrote on 3/24/2012, 2:06 PM
Well, I guess you could use the "Rotating Picture" option in Excalibur and set the beginning and ending sizes both to 100 and the beginning and ending rotations both to 90 degrees.
Tom Pauncz wrote on 3/24/2012, 2:08 PM
Why not just set 'Output Rotation' in Project Properties and then use track motion to rotate and resize the events?
Tom
essami wrote on 3/24/2012, 2:59 PM
I can't use track motion because Vegas handles that footage differently on render. I need to do renders of the project both for screens that handle vertical footage and for screens that are just tilted 90 degrees.

If you don't believe me just try it :) Its a PITA!
Former user wrote on 3/24/2012, 3:21 PM
Would it look good if you rendered to an intermediate file normally, and then rendered that whole thing rotated?

Dave T2
Chienworks wrote on 3/24/2012, 4:34 PM
Assuming they're all the same format, use pan/crop to rotate the first one. Then Ctrl-C to copy it. Then right-mouse-button click on the next clip and from the popup menu choose Select events to end. Then right-mouse-button click again and choose Paste event attributes.

The pan/crop settings from the first clip will be duplicated on all the rest.

Faster than using a script!
johnmeyer wrote on 3/24/2012, 6:05 PM
You can't use paste attributes if your source event contains any fX. Much more important, if you have keyframed any of the existing events, doing the copy/paste attributes will completely hose all your keyframes.

I just created a script that will rotate all pan/crop keyframes in all selected events. If no events are selected, it will rotate ALL events.

The rotation variable is set to rotate 90 degrees counterclockwise. To change rotation, open the script in Notepad and change the following:

var RotationDegrees = 90;

to something other than 90 (negative numbers should work for rotation in the other direction).

To use, copy the code below (everything after the word "code block"), paste into Notepad, and save with the extension "js".

I tested this extensively for ten seconds ...

[edit] Point of clarification: this script adds the specified rotation to whatever rotation was already present; it does not replace the existing rotation for each keyframe. If you have not assigned any rotation, this distinction is unimportant.

// Rotate counterclockwise on all selected video events.
// No selection = ALL
// Cobbled together by John Meyer (no testing)
// Copyright March 24, 2012

import System.Windows.Forms;
import Sony.Vegas;

// Change the following line to get different roations
var RotationDegrees = 90;

var zero : int = 0;
var cSelected = GetSelectionCount (MediaType.Video);
var cTracks = Vegas.Project.Tracks.Count;
var ii;
var Rotation = (RotationDegrees) * (Math.PI)/180;

for (ii = zero; ii < cTracks; ii ++)
{
var track = Vegas.Project.Tracks[ii];

if (! track.IsVideo())
{
continue;
}

var eventEnum : Enumerator = new Enumerator(track.Events);

while ( ! eventEnum.atEnd() )
{
var trackEvent : TrackEvent = eventEnum.item();

if ( !cSelected || trackEvent.Selected )
{
var mediaStream = GetActiveMediaStream (trackEvent);

if (mediaStream)
{
var videoStream = VideoStream (mediaStream);
var videoEvent = VideoEvent(eventEnum.item());
var keyframes = videoEvent.VideoMotion.Keyframes;
var cKeyframes = keyframes.Count;
var jj;

for (jj = zero; jj < cKeyframes; jj ++)
{
RotateEvent (keyframes[jj], Rotation);
}
}
}

eventEnum.moveNext();
}
}


Vegas.UpdateUI();



function GetSelectionCount (mediaType)
{
var cTracks = Vegas.Project.Tracks.Count;
var cSelected = zero;
var ii;

for (ii = zero; ii < cTracks; ii ++)
{
var track = Vegas.Project.Tracks[ii];

if (track.MediaType == mediaType)
{
var eventEnum : Enumerator = new Enumerator(track.Events);

while ( ! eventEnum.atEnd() )
{
if (eventEnum.item().Selected)
{
cSelected ++;
}

eventEnum.moveNext();
}
}
}

return cSelected;
}

function GetActiveMediaStream (trackEvent : TrackEvent)
{
try
{
if ( ! trackEvent.ActiveTake.IsValid())
{
throw "empty or invalid take";
}

var media = Vegas.Project.MediaPool.Find (trackEvent.ActiveTake.MediaPath);

if (null == media)
{
throw "missing media";
}

var mediaStream = media.Streams.GetItemByMediaType (MediaType.Video, trackEvent.ActiveTake.StreamIndex);

return mediaStream;
}
catch (e)
{
//MessageBox.Show(e);
return null;
}
}

function RotateEvent (keyframe : VideoMotionKeyframe, Rotation)
{
var rotation = keyframe.Rotation;

try
{
keyframe.RotateBy (Rotation);
}

catch (e)

{
// restore original settings on error
MessageBox.Show("Rotation failed");
}
}





essami wrote on 3/26/2012, 3:06 PM
Hi,

Thanks for the trouble John. However I need the rotation done in media properties as it doesn't work for my purposes when done with pan & crop.

This is not easy to explain I see but let me try again.

I have shot footage with my camera tilted 90 degrees counterclockwise. It will be presented in both screens that are merely tilted 90 degrees and in systems that are built to display vertical footage. So I need to be able to render footage out that is 1920x1080 and also footage that is 1080x1920.

If you don't trust me that pan & crop doesn't work in this situation just try it for yourself and you'll see what happens. :)

I guess the easiest thing for me is to render to an intermediate file and tilt that as necessary in a new Vegas project.

Just really curious that no one has ever had to do a project like this...

Sami
ForumAdmin wrote on 3/26/2012, 3:17 PM
Hi Sami, have you tried the following?

1) Go to Project Media, Ctrl+A to select all.
2) Right-click any file, choose Rotate 90° Counterclockwise (or Clockwise, as the case may be).

Forgive me if I overlooked something obvious...

Paddy
SCS
johnmeyer wrote on 3/26/2012, 10:50 PM
I think Paddy's suggestion should work just fine. If not, I can modify my script to exchange the Height and Width variables. I think you'll find that once the event is rotated, exchanging those will give you what you want.

However, Paddy's suggestion does work (I tried it) and should only take a few seconds.
essami wrote on 4/10/2012, 4:07 AM
Paddy! Thank you!! Exactly what I was looking for :D