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

Substance Painter 10.1 Python JS API does not support optional arguments

Community Beginner ,
Sep 22, 2024 Sep 22, 2024

Copy link to clipboard

Copied

Starting in Subtance Painter 10.1 suddenly it seems that the `'alg.mapexport.getPathsExportDocumentMaps` javascript command requires the `stackPaths` argument which has always been optional and is still depicted as optional in the documentation:

 

369315902-7071ce7e-81b6-4981-b630-79c312a5982a.png

 

For example this fails:

```python

substance_painter.js.evaluate('alg.mapexport.getPathsExportDocumentMaps("export-preset-generator://viewport2d", "/path/to", "png")')

```

 

Stack trace:

```python

RuntimeError: TypeError: Passing incompatible arguments to C++ functions from JavaScript is not allowed.

 

At:

C:\Program Files/Adobe/Adobe Substance 3D Painter/resources/python/modules\substance_painter\js.py(56): evaluate

<string>(2): <module>

```

 

But this works:

```python

substance_painter.js.evaluate('alg.mapexport.getPathsExportDocumentMaps("export-preset-generator://viewport2d", "/path/to", "png", [])')

```

 

Even though the first command worked fine in Substance Painter 10.0 and below.

 

---

 

For more details, see [this issue](https://github.com/ynput/ayon-substance-painter/issues/13).

 

Bug Unresolved
TOPICS
Bugs & Crashes , Scripting

Views

74

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
no replies

Have something to add?

Join the conversation
Resources