The Final Cut Pro XML Interchange Format lets you modify or update open projects using the elements uuid and updatebehavior. As well, you can use the itemhistory element to track the edit history of a clipitem.
The uuid and updatebehavior Elements
The itemhistory Element
The uuid element uniquely and persistently identifies individual components (clips, bins, and sequences) in a project. Since it is saved with the project file, you can use it to track detailed changes during your workflow.
Important: A uuid entry is only guaranteed uniqueness on a per project basis. If you copy a clip from one project to another, the uuid entry for the clip remains the same. Likewise, if you export a clip and then import it into a different project, the uuid entry is unchanged. If you then modify the clip in one project, the clip in the other project has a matching UUID but is no longer identical. The UUID has ceased to be a unique identifier.
The updatebehavior element allows you to modify UUID-identified components in an open project. The target component in a project can be a clip, bin, or sequence. As well, you can use updatebehavior to modify metadata in a QuickTime file. (See “Managing QuickTime Metadata”)
A target component is identified by its uuid entry. For example, here is a XML snippet that replaces a clip in the Browser:
Listing 3-21 Replacing a Clip in the Browser
<?xml version="1.0" encoding="UTF-8"?> |
<!DOCTYPE xmeml> |
<xmeml version="4"> |
<clip id="clip2 "> |
<uuid>7ACBD5FC-C166-40F9-AE36-55B39476D8E6</uuid> |
<updatebehavior>replaceiffound</updatebehavior> |
<!--Information about the replacement clip --> |
</clip> |
When this snippet is imported, Final Cut Pro looks for a component in the project with a matching UUID. If it finds one, it replaces the component with the clip specified in the interchange format document. (In this case, the replacement clip appears at the topmost level of the Browser.) If it doesn’t find the target clip, nothing happens.
To replace a clip in a bin, you have to specify the bin and all its contents. For example, Listing 3-22 replaces a clip in Bin 1.
Listing 3-22 Replacing a Clip in a Bin
<?xml version="1.0" encoding="UTF-8"?> |
<!DOCTYPE xmeml> |
<xmeml version="4"> |
<bin> |
<uuid>4FDDECFA-D312-4272-8DE8-BE98E4BA5F92</uuid> |
<updatebehavior>replaceiffound</updatebehavior> |
<name>Bin 1</name> |
<children> |
<clip id="clip2 "> |
<uuid>7ACBD5FC-C166-40F9-AE36-55B39476D8E6</uuid> |
<updatebehavior>add</updatebehavior> |
<!-- Information about the replacement clip --> |
</clip> |
</bin> |
Similarly, to replace a particular clipitem in a sequence, you must replace the entire sequence.
The way you specify the location of the replacement component in the import document has precedence. For example, if the target clip is in Bin 1 and if you import a snippet such as Listing 3-21 Final Cut Pro removes the clip from Bin 1 and puts the replacement clip at the top level of the Browser.
The desired behavior at the time of import is specified by the entry for updatebehavior. The valid entries are:
replaceiffoundreplaceoraddaddifnotfoundadduuid entry is present, changes the uuid entry of the imported object.removeThe first time you export the XML for a clipitem, Final Cut creates a UUID for the item. If you modify the clipitem and export it again, Final Cut generates a new UUID for the item. The element itemhistory encodes a list of the UUIDs associated with a particular clipitem. The top UUID in the list is the current UUID for the item and is guaranteed to be unique. The rest of the list is a historical record of the UUIDs associated with the item. (The bottom UUID item in the list is the initial UUID generated for the clipitem or the UUID of the original item from which the current item was derived.)
For example, suppose you export a clipitem for the first time. It is assigned an initial UUID:
<itemhistory> |
<uuid>3510A3C8-5C79-4AA4-9A81-38B40397C0DC </uuid> |
</itemhistory> |
You then blade the clipitem and export both items. The XML for the first item is:
<itemhistory> |
<uuid>CC70F2BC-1777-4FF6-8846-58A8A3D2DA0E</uuid> |
<uuid>3510A3C8-5C79-4AA4-9A81-38B40397C0DC</uuid> |
</itemhistory> |
The XML for the second item is:
<itemhistory> |
<uuid>DD30375E-5CF3-4EB7-B209-36624768C4BB</uuid> |
<uuid>3510A3C8-5C79-4AA4-9A81-38B40397C0DC</uuid> |
</itemhistory> |
The common final UUID for the two items shows that they have a common origin.
Last updated: 2007-11-14