Author Topic: Query which maps are about to be exported  (Read 1175 times)

Hi all,

I've been wrangling with this for a while, I figured it'd be possible after the latest update but I'm not so sure anymore. Right now we have our depot set up to use Perforce, excellent. P4 makes files read only when they aren't checked out though, so in order to export maps from substance they need to be open for edit. Right. Currently we're just checking out the folder where the TIFFs in question live, export, then revert unchanged files. It's not an ideal solution imo but it works pretty well.

What I'd rather be doing is query what materials are checked in the exporter as the user is about to export, and check out those maps in p4 before the export occurs. But how can I get that information? Does it exist in the Javascript API? Python automation toolkit maybe?

Thanks for any help!

The API provides that information on the onExportAboutToStart callback, check the Plugin Skeleton example in the API docs.

What i don't know, is if the export process will wait for your own callback.. I assume it would, but I haven't tested it myself.

I'd spawn a subprocess / python call with a timer using that callback to test (standing in for some kind of check out process).

I've requested in the past, the ability to prevent the export process (if for some reason the check-out fails, or the plugin detects issues with the output.) Last I checked though, unfortunately you can't block the export that follows the onExportAboutToStart signal

Thank you Bradford! That's exactly what I needed.