-
Camera Swap Script Trouble
{ // create undo group app.beginUndoGroup("Swap Camera Position"); // select the active item in the project window alert("Make sure you have a comp selected and it is has a camera called Camera 1"); // variable for the comp var activeComp = app.project.activeItem; var poiX = activeComp.layer("Camera 1").transform.pointOfInterest[0]; var poiY = activeComp.layer("Camera 1").transform.pointOfInterest[1]; var poiZ = activeComp.layser("Camera 1").transform.pointOfInterest[2]; var camX = activeComp.layer("Camera 1").transform.position[0]; var camY = activeComp.layer("Camera 1").transform.position[1]; var camZ = activeComp.layer("Camera 1").transform.position[2]; activeComp.layer("Camera 1").transform.position[0] = poiX; activeComp.layer("Camera 1").transform.position[1] = poiY; activeComp.layer("Camera 1").transform.position[2] = poiZ; activeComp.layer("Camera 1").transform.pointOfInterest[0] = camX; activeComp.layer("Camera 1").transform.pointOfInterest[1] = camY; activeComp.layer("Camera 1").transform.pointOfInterest[2] = camZ; app.endUndoGroup(); }Okay – I’m new to writing scripts/expressions.. but I’m trying. I wanted a script that would swap the position and pointofinterest of my camera.
At first I couldn’t get it to recognize the layer I had selected, but I think I got it to recognize a layer named Camera 1 at least, so I went with that – but… it doesn’t do anything. I know I must be assigning the position value incorrectly but after about six variations and a long internet search, I’m out of ideas… help appreciated, thank you.