Link to the script : http://secretnetworkc2c.maximumrfan.ope ... nload=true
The code that has worked for me every time except for now is as followed:
var proj = app.project;
var undoStr = "MRFCameraRig Simple Version";
if (proj){
var myComp = app.project.activeItem;
if (myComp != null && (myComp instanceof CompItem)){
app.beginUndoGroup(undoStr);
var w = myComp.width /2 ;
var h = myComp.height /2 ;
var newCamera = myComp.layers.addCamera("MRFCamera",[w,h]);
newCamera.position.setValue([w,h]);
var myLayer = myComp.selectedLayers;
if (myLayer) {
var newNull = myComp.layers.addNull();
newNull.source.name = "MRFCameraRig";
newNull.threeDLayer = true;
newNull.shy = false;
newNull.enabled = true;
newCamera.parent = newNull;
var URC = newNull("Effects").addProperty("Checkbox Control");
URC.name = 'Use Rotation Controls';
URC.value = true
var pitch = newNull("Effects").addProperty("Angle Control");
pitch.name = 'X Rotation';
var heading = newNull("Effects").addProperty("Angle Control");
heading.name = 'Y Rotation';
var bank = newNull("Effects").addProperty("Angle Control");
bank.name = 'Z Rotation';
var tracking = newNull("Effects").addProperty("ADBE Slider Control");
tracking.name = 'Tracking (Zoom)';
tracking.slider.setValue(0);
var UPC = newNull("Effects").addProperty("Checkbox Control");
UPC.name = 'Use Position Controls'
var xPosition = newNull("Effects").addProperty("ADBE Slider Control");
xPosition.name = 'X Position';
xPosition.slider.setValue([w]);
var yPosition = newNull("Effects").addProperty("ADBE Slider Control");
yPosition.name = 'Y Position';
yPosition.slider.setValue([h]);
var zPosition = newNull("Effects").addProperty("ADBE Slider Control");
zPosition.name = 'Z Position';
zPosition.slider.setValue(0);
var camPositionExpression = 'UPC = effect("Use Position Controls")("Checkbox"); \r x = effect("X Position")("Slider"); \r y = effect("Y Position")("Slider"); \r z = effect("Z Position")("Slider"); \r cPV = value; \r dPV = value; \r if(UPC == 0){cPV = dPV} else {cPV = [x, y, z]};'
newNull.position.expression = camPositionExpression;
var positionExpression = 'value - [0, 0,cameraOption.zoom] + [0, 0,thisComp.layer("MRFCameraRig").effect("Tracking (Zoom)")("Slider")];';
newCamera.position.expression = positionExpression;
var orientationExpression = 'URC = effect("Use Rotation Controls")("Checkbox"); \r x = effect("X Rotation")("Angle"); \r y = effect("Y Rotation")("Angle"); \r z = effect("Z Rotation")("Angle"); \r cRV = value; \r dRV = value; \r if(URC == 0){cRV = dRV} else {cRV = [x, y, z];}';
newNull.orientation.expression = orientationExpression;
alert("Created by MRFPlugins." + "\r" +
"©2010-2012 Fiber Optic Shoe." + "\r" +
"Inspired by a tutorial on Maltaanon.com." + "\r" +
"http://www.youtube.com/maximumrfan." + "\r" +
"http://www.twitter.com/mdogtwilighter." + "\r" +
"Thanks to the people on aenhancers.com who helped me get this thing working correctly!", "MRFCameraRig"
);
app.endUndoGroup();
} else {
alert("Select a layer for crying out loud!", "MRFCameraRig");
}
} else {
alert("Select a comp to use the script silly!", "MRFCameraRig");
}
}
else
{
alert("Make a new project to use this awesometacular script!", "MRFCameraRig");
}
}
If you want to edit the script, please reply with a link to the script.
