Author Topic: Error when trying to export USDZ via Python API  (Read 641 times)

Hi all,

I have a been trying to export USDZ via Painter's python API. But I am getting an error that the specified resource is not found.

I am trying to use the example from the documentation (https://pasteall.org/YeKf).

In the above snippet, I substituted USD PBR Metal Roughness on line 18 in the name attribute as below:

Code: [Select]
export_preset = substance_painter.resource.ResourceID(
    context="allegorithmic", name="USD PBR Metal Roughness")

But when I try to run list_project_textures function, it returns an error that the specified resource could not be found.

Am I missing something here?

Please share some insight on this.

Thanks in advance!

You can use 'substance_painter.resource.Shelves.all()' to see your all shelves and choose one string to 'context'
if you use the common spexp, you could go to:
export_preset = substance_painter.resource.ResourceID(context="shelf", name="Corona")

In your json:
{
       ...,
        "defaultExportPreset": export_preset.url(),
      ...
}
Last Edit: May 11, 2021, 11:04:32 am