On Sep 24, 2007, at 11:37 AM, Darrin Cardani wrote:
Here's my problem:
I try to develop some automatic functions to FCP (5.1.4) via Applescript and the XML Interchange Format:
I've got a folder full of images which should be placed one after another in the timeline. Every image should be in full screen mode or bigger. And the upper left corner of the scaled images should be equal to the upper left corner of the canvas.
I wrote some code in Applescript which creates the XML-projectfile. A repeat loop grabs the images, reads out the imagesize and calculates a scaling factor to fill the canvas. Then it inserts the appropriate XML-Code. Due to the scaling, some parts of the image overlap the canvas (sure!). So now I want the images to be automatically positioned in the upper left corner of the canvas.
Clancy, The easiest way to get that to happen is to put the anchor point at the upper left corner of the image. It should always be (-halfWidth, -halfHeight), I believe. So for DV footage, it would be (-360, -240). All scaling and rotation happens around the anchor point. So when you set the anchor point to the upper left corner and then scale, the upper left of the footage (or still) stays in the upper left of the canvas, and the scaling happens to the right and bottom. As someone else pointed out, the point values are possibly also stored as percentages of the canvas size (or footage size? I forget which - so check the XML docs to be sure).
Hi Clancy,
Yup, Trevor is correct. The position is a percentage. The allows the user to change out the frame size at XML import time in the sequence settings (like import something that was originally photoJPEG as HD) and have the postiioning all still correct on the new size. If they change out the media too it should still work..
I've written up a bug to indicate that the documentation should clarify this point. Darrin's advice is great -- one can figure out the meaning of the values by placing the point in question in handy places like the center, upper right, upper left. I tested with centering on the right side myself.
Thanks, Helena |