Copy link to clipboard
Copied
Hi, I'm working on a panel for Premiere Pro and I'm working on metadata, especially fieldType.
I need to find the field type of the sequence, which works like this:
var timelineFieldType = app.project.activeSequence.getSettings().videoFieldType;
which returns a code (0 for progressive, 1 or 2 for interlaced), which is perfect.
Now I need to find the fieldType of each clip in the sequence, which I do like this:
var kPProPrivateProjectMetadataURI = "http://ns.adobe.com/premierePrivateProjectMetaData/1.0/";
var xmp = new XMPMeta(videoTracks[0].clips[0].projectItem.getProjectMetadata());
var currentClipFieldType = xmp.getProperty(kPProPrivateProjectMetadataURI, "Column.PropertyText.FieldOrder");
But this method doesn't return a code, but a label. For example in French, for a progressive video it says "Aucune Trame".
My problem is that my panel has to work in several languages, so the label will change, so I'm wondering if there's any way to retrieve a clip's fieldType as an integer (the same way as the sequence's fieldType) instead of a label?
Thanks
You can get the projectItem associated with the trackItems in your sequence, then get its footage interpretation (which includes field settings).
var firstProjectItemInProject = app.project.rootItem.children[0];
if (first){
var interp = firstProjectItemInProject.getFootageInterpretation();
if (interp){
var fieldType = interp.fieldType;
}
}
> Could this be a version problem?
Possible, but doubtful; we haven't changed this API in years. 🙂
Here's how I'm seeing successful changes to the field setting:
0 Launch PPro.
1 New empty project.
2 Import valid media; in my case, I imported an .mxf file with no fields (progressive).
3 Run script
Interim result: -1
4 Context click the media in the project panel, select Modify --> Interpret Footage...
5 In the resulting dialog, set Field Order to conform to "Upper field f
Copy link to clipboard
Copied
You can get the projectItem associated with the trackItems in your sequence, then get its footage interpretation (which includes field settings).
var firstProjectItemInProject = app.project.rootItem.children[0];
if (first){
var interp = firstProjectItemInProject.getFootageInterpretation();
if (interp){
var fieldType = interp.fieldType;
}
}
Copy link to clipboard
Copied
This code seems to return "-1" in all casess (clip progressive or interlaced)
Copy link to clipboard
Copied
?! Bizarre. How/where are you changing the projectItem's field type interpretation?
I've confirmed that interp.fieldType correctly updates to different field settings, when changes are made in the Interpret Footage dialog for a given projectItem..
Copy link to clipboard
Copied
I haven't changed the fieldType of the project Item. I've just added a few clips to my timeline, some progressive and some interlaced, and I'm trying to access their fieldType from the code. I didn't do any special processing
But I still get "-1" with the fieldType of the footage interpretation for all my project items. But when accessing the project item's metadata, the fieldType is correct, but as a label, as I said in my first post.
A colleague has also tested it, and has the same problem.
Could this be a version problem?
Copy link to clipboard
Copied
> Could this be a version problem?
Possible, but doubtful; we haven't changed this API in years. 🙂
Here's how I'm seeing successful changes to the field setting:
0 Launch PPro.
1 New empty project.
2 Import valid media; in my case, I imported an .mxf file with no fields (progressive).
3 Run script
Interim result: -1
4 Context click the media in the project panel, select Modify --> Interpret Footage...
5 In the resulting dialog, set Field Order to conform to "Upper field first", click OK.
6 Run script
Result: 1
7 Context click the media in the project panel, select Modify --> Interpret Footage...
8 In the resulting dialog, set Field Order to conform to "Lower field first", click OK.
9 Run script
Result: 2
Updated script:
var firstProjectItemInProject = app.project.rootItem.children[0];
if (firstProjectItemInProject){
var interp = firstProjectItemInProject.getFootageInterpretation();
if (interp){
var fieldType = interp.fieldType;
if (fieldType){
alert(firstProjectItemInProject.name + " field setting = " + fieldType + ".");
}
}
}
Copy link to clipboard
Copied
>I haven't changed the fieldType of the project Item. I've just added a few clips to my timeline, some progressive and some interlaced, and I'm trying to access their fieldType from the code.
Understood; I did change the fieldType, to confirm that the API does provide accurate info. 🙂
Copy link to clipboard
Copied
I tested it by modifying the footage interpretation and it does indeed work. indeed
I'd misunderstood what the footageInterpretation object was actually doing. I thought it would return the real field type of the video file, not the setting in Premiere. Mybad for the mistake
Thanks!
Copy link to clipboard
Copied
If we returned the settings from the actual media file, there would be no way for extensions to match the behavior users have specified, within PPro.