Problem with exportSequenceFrame()

Is there an issue or bug with “exportSequenceFrame()”? I run the following and it even tells me that the export is true/successful. However, no matter the location I choose, or the changes I make to the arguments, I cannot get it to work.

async function exportSequence() {
  try {
  const project = await ppro.Project.getActiveProject();
  const sequence = await project.getActiveSequence();
  console.log(sequence);
  const frameSize = await sequence.getFrameSize();
  console.log(frameSize);
  const time = await ppro.TickTime.createWithSeconds(2);
  console.log(time);
  const test = await ppro.Exporter.exportSequenceFrame(sequence, time, "C:/temp/export.png", "C:/temp/", frameSize.width, frameSize.height);
  console.log(test === true);
  console.log(test);
  console.log("EXPORT should be complete");
  } catch(e) {
    console.log(e);
  }
}

These console logs show me all good info as well:

Sequence {guid: Guid, name: "1"}
main.js:32 RectF {width: 1080, height: 1920}
main.js:34 TickTime {seconds: 2, ticks: "508032000000", ticksNumber: 508032000000}
main.js:36 true
main.js:37 true

Hi!

Could you please adjust the third parameter for exportSequenceFrame to just use the filename and try again?

Like:
const test = await ppro.Exporter.exportSequenceFrame(sequence, time, "export.png", "C:/temp/", frameSize.width, frameSize.height);

We will use third and fourth parameter together for the output file path, so using absolute path for third parameter might lead to issue.

Please let me know if this is still not working, and we will improve on making our API return more accurate result for the future.

Thanks for trying out UXP!

Thanks for the reply! I had tried this before, assuming it was a typo in the documentation. But unfortunately it doesn’t work and the return from “exportSequenceFrame” gives me false. Does this indicate it is bugged?

Can you try

const test = await ppro.Exporter.exportSequenceFrame(sequence, time, "export.png", "C:\temp", frameSize.width, frameSize.height); instead?

I think we are having some issue for handling windows path with / as path separator. We will investigate further when possible. Please let me know if it is still not working.

Ok, so “C:\temp” didn’t work, however “C:\temp” did work thanks! One slightly annoying thing is that it is doubling the “.png” in the exported file name, and will do the same for .jpg etc.

1 Like

I’m confused; what, exactly, didn’t work?

The text editor reduced my double slash to single! It should be \\ not \