Re: Scope of id attributes
site_archiver@lists.apple.com Delivered-To: pro-apps-dev@lists.apple.com Hey Bruce, Lotsa good questions! Best Luck! Helena On Jul 24, 2008, at 11:44 AM, Bruce Sharpe wrote: But if id attributes have no existence outside of the XML, then how do I create an affiliate clip in XML? It needs to refer to a masterclipid. As an experiment, I exported an affiliate clip as XML and sure enough it has a masterclipid value that is not defined anywhere else in the XML. If I export the whole project then I can see the clip with that id value. Bruce On Thu, Jul 24, 2008 at 10:00 AM, Gregory Clarke <greg@intelligentassistance.com> wrote: Of course, we could be wrong... Greg Thanks, Greg. I think I get the concept of the id, but my question is, if I create one in a component and then import the XML to a project, will there be a problem if the id I have created happens to be the same as one that already existed in the project? Case 2: But it is also possible that the id values that I see when I export the project do exist in the project regardless of whether it has been exported or not. In that case, not only do I need to avoid conflicts when I create an id, but I may be able to reference other project elements through their id. Unless I hear otherwise I am going to assume that Case 1 is true. Bruce On Thu, Jul 24, 2008 at 9:03 AM, Gregory Clarke <greg@intelligentassistance.com> wrote: Hi Bruce, The explanation of the id Attribute on p16 of the Final Cut Pro XML should help - it's meant for sharing common info, so it's not meant to be unique. Here's the example from the PDF: Hope that helps, Greg On Jul 24, 2008, at 12:23 AM, Bruce Sharpe wrote: Bruce _______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/pro-apps-dev/greg%40intelligentassist... _______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/pro-apps-dev/hju%40apple.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Pro-apps-dev mailing list (Pro-apps-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/pro-apps-dev/site_archiver%40lists.ap... Your approach is right (number (3) anyway), and Gregory Clarke is also right. Ids live only for the duration of an XML file, and in that XML file they are unique. Certainly if you have played around with a project and exported the XML a few times throughout that, you'll see the id change. The masterclip is identified in the XML via the masterclipid, but internally we use other methods to persist the relationship. You can think of the id attribute as a pointer to the object. All of the above being said, how do you use it practically? If you make up a uuid and use it as a 'id' attribute, you won't need to inspect the project to look to make sure your id value will be distinct. OR, you can look at the id attribute on the master clip you'd like to connect an affiliate clip with, and use that. So, barring some new definitive information about this, my strategy will be to: (1) Either not create any new ids, or (2) examine the project XML and choose id values that are distinct from those already used. (3) In any case, if I want to create an affiliate clip, I will assume that it is safe to refer to the masterclipid that shows up in the export of an existing clip. I agree with you that case 1 is probably true. And here's why: don't forget that in FCP a clip is not actually a piece of media, but rather a pointer to a piece of media. Analogous to a QuickTime reference movie rather than a video file. So my guess is that the id attribute is just an XML representation of that same pointer "link" and doesn't exist in the FCP project because QuickTime handles that. Case 1: It is possible that there is no concept of id in a project, it only exists in XML imports and exports. In that case there is no problem. For example, the clip information for a video track in a sequence may be identical to the clip information in an audio track in the same sequence. Rather than repeating this information for both tracks, you can encode it once and then reference the information using the id attribute. Suppose I am creating a clip, sequence or other object in XML with the intention of importing it into an existing project. I want to use id attributes in my object. Do I need to be careful not to conflict with any ids that are already in use in the project? This email sent to greg@intelligentassistance.com This email sent to hju@apple.com This email sent to site_archiver@lists.apple.com
participants (1)
-
Helena Ju