• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Simple Project Metadata change

New Here ,
Apr 14, 2018 Apr 14, 2018

Copy link to clipboard

Copied

Hello,

I'm trying to update the "Description" field of a sequence but I'm stuck on the last step.

I know there's a function in the example panel that does it, but in all fairness it's quite a complicated read for an inexperienced coder like me and I'm trying to simplify it to suit my needs (and actually understand how it works).

I'm basically doing this:

function addNote(activeSeq, note) {

var xmp = new XMPMeta(activeSeq.projectItem.getProjectMetadata())

xmp.setProperty(kPProPrivateProjectMetadataURI, 'Column.PropertyText.Description', note);

activeSeq.projectItem.setProjectMetadata(xmp);

}

It takes in the activeSequence and a user input new description. I can check that the getProjectMetadata works fine, I can read the Description property, update it with setProperty, and I can check the new property was updated in the xmp variable, but the setProjectMetadata doesn't seem to work.

From this: Project Item object — Premiere Pro Scripting Guide 1.0 documentation

it seems like the setProjectMetadata method takes one argument, and that argument has the same format as the result of the getProjectMetadata, so I'm not sure what isn't working. In the example panel the xmp variable is serialized first, which I've tried too and don't understand, and the setXMPMetadata takes 2 arguments.

Thanks for your help.

TOPICS
SDK

Views

1.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Employee , Apr 17, 2018 Apr 17, 2018

Also...are you passing an array indicating which fields have modified values, like PProPanel does?

Samples/Premiere.jsx at master · Adobe-CEP/Samples · GitHub

Votes

Translate

Translate
Engaged ,
Apr 15, 2018 Apr 15, 2018

Copy link to clipboard

Copied

Hi,

please verify your script against the method proposed at https://github.com/Adobe-CEP/Samples/blob/a64797c6308c6c336f125c48615ceafc9636058d/PProPanel/jsx/PPR... , most importantly making sure you're initializing the ExternalObject, otherwise XMP metadata won't work at all.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 16, 2018 Apr 16, 2018

Copy link to clipboard

Copied

Yes I'm initialising the ExternalObject. It all works aside from the last step of setProjectMetadata.

If I add an alert:

alert(xmp.getProperty(kPProPrivateProjectMetadataURI, 'Column.PropertyText.Description'))

after the setProjectMetadata, I do get the new value that I got from the user prompt earlier.

The issue seems to be the last line, which doesn't actually update the ProjectMetadata. I've tried both with and without serializing, and I get the same non-result, with no error being thrown to help me.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Apr 16, 2018 Apr 16, 2018

Copy link to clipboard

Copied

PProPanel's modifyProjectMetadata() works correctly, right?

https://github.com/Adobe-CEP/Samples/blob/master/PProPanel/jsx/PPRO/Premiere.jsx#L765

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Apr 17, 2018 Apr 17, 2018

Copy link to clipboard

Copied

Also...are you passing an array indicating which fields have modified values, like PProPanel does?

Samples/Premiere.jsx at master · Adobe-CEP/Samples · GitHub

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 25, 2018 Apr 25, 2018

Copy link to clipboard

Copied

Thanks Bruce, the issue was indeed not passing the array of modified values. My code works like this:

function addNotes(activeSeq, note) {

    var xmp = new XMPMeta(activeSeq.projectItem.getProjectMetadata());

    xmp.setProperty(kPProPrivateProjectMetadataURI, 'Column.PropertyText.Description', note);

    var xmpAsString = xmp.serialize()

    activeSeq.projectItem.setProjectMetadata(xmpAsString, ['Column.PropertyText.Description']);

}

Might I suggest updating the docs so that it indicates the setProjectMetadata function needs that second argument? The example panel is useful for some things but while I saw that 2nd argument in it, I had no idea what it was for. When trying to build a simple function, looking at a more complicated version of it isn't really ideal and the docs are much more useful.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Apr 26, 2018 Apr 26, 2018

Copy link to clipboard

Copied

LATEST

Updated.

Related: Yikes, looks like I have some more doc work to do.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines