Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - bsilvaLS

Pages: [1]
1
Hello!

I'm using the Python API to export textures with a config dictionary as described in the docs. It works as expected until I add uvTiles to the filters in the exportList. The export outputs the maps for the first texture set in the list, and then silently just stops.

If I remove the uvTiles entry from the filter dicts, all the maps export as expected.

This is the config dict I'm using. All I get are the maps for textureSetA. Are there any issues I haven't spotted with the format?

(I'm on v6.2.1 on Windows 10.)

Thanks!

Code: [Select]
{'defaultExportPreset': 'resource://allegorithmic/PBR Metallic Roughness',
 'exportList': [{'filter': {'outputMaps': ['$mesh_$textureSet_BaseColor(.$udim)',
                                           '$mesh_$textureSet_Roughness(.$udim)',
                                           '$mesh_$textureSet_Metallic(.$udim)',
                                           '$mesh_$textureSet_Normal(.$udim)',
                                           '$mesh_$textureSet_Height(.$udim)',
                                           '$mesh_$textureSet_Emissive(.$udim)'],
                            'uvTiles': [[0, 1]]},
                 'rootPath': 'textureSetA'},
                {'filter': {'outputMaps': ['$mesh_$textureSet_BaseColor(.$udim)',
                                           '$mesh_$textureSet_Roughness(.$udim)',
                                           '$mesh_$textureSet_Metallic(.$udim)',
                                           '$mesh_$textureSet_Normal(.$udim)',
                                           '$mesh_$textureSet_Height(.$udim)',
                                           '$mesh_$textureSet_Emissive(.$udim)'],
                            'uvTiles': [[0, 0]]},
                 'rootPath': 'textureSetB'},
                {'filter': {'outputMaps': ['$mesh_$textureSet_BaseColor(.$udim)',
                                           '$mesh_$textureSet_Roughness(.$udim)',
                                           '$mesh_$textureSet_Metallic(.$udim)',
                                           '$mesh_$textureSet_Normal(.$udim)',
                                           '$mesh_$textureSet_Height(.$udim)',
                                           '$mesh_$textureSet_Emissive(.$udim)'],
                            'uvTiles': [[1, 0]]},
                 'rootPath': 'textureSetC'},
                {'filter': {'outputMaps': ['$mesh_$textureSet_BaseColor(.$udim)',
                                           '$mesh_$textureSet_Roughness(.$udim)',
                                           '$mesh_$textureSet_Metallic(.$udim)',
                                           '$mesh_$textureSet_Normal(.$udim)',
                                           '$mesh_$textureSet_Height(.$udim)',
                                           '$mesh_$textureSet_Emissive(.$udim)'],
                            'uvTiles': [[0, 1], [0, 3]]},
                 'rootPath': 'textureSetD'}],
 'exportParameters': [{'parameters': {'bitDepth': '8',
                                      'dithering': False,
                                      'fileFormat': 'png',
                                      'paddingAlgorithm': 'infinite',
                                      'sizeLog2': 9}}],
 'exportPath': '/some/directory/for/textures',
 'exportPresets': [],
 'exportShaderParams': True}

and then simply calling with:

Code: [Select]
result = substance_painter.export.export_project_textures(config)

2
I'd like the option to raise the Export Textures dialog from the Python API, with some information pre-filled. Is this possible? I know it was possible in JS with alg.mapexport.showExportDialog but I need to do it from Python.

Also, in the export dialog, there is the "Save settings" button, which must put the current settings and overrides somewhere in the project. Is there a way to access these via the Python API? I'd really like to use them as a starting point for a custom export.

Thanks!

3
Substance PainterSubstance Painter - Scripting - Python Events for Export?
 on: April 30, 2020, 10:55:21 pm 
I noticed the events supported by the Python API don't include onExport*, like you have in the QML/JS API. Is there a plan to support those (and more) in the future?

4
Hey! First let me also express thanks for releasing the Python API! It's very exciting and will be hugely helpful. And you're already on Python 3, so thanks for pushing that forward. :)

I'm wondering a couple things about the substance_painter.export.export_project_textures method, specifically.

First, is there any way to access the settings saved by the new "Save Settings" button in the export dialog? I'd like to be able to call the export from Python, but by default have it use whatever the user saved there last. I suppose this could also be some way to get the equivalent of the exportList and exportParameters objects in the JSON -- is that possible?

Secondly, does the defaultExportPreset need to be defined in the exportPresets JSON object, or can it be the name of a preset loaded from an .spexp file?


5
Hello! I'm working on a plug-in, and having some trouble getting project settings to persist. I'm still looking for issues in my code, but I also want to make sure I understand this correctly --

From within my plug-in, if I use the standard:
Code: [Select]
alg.project.settings.setValue("someKey", "VALUE")
then if I save the project, close and re-open Substance Painter, re-open the project, and have my plug-in call:
Code: [Select]
alg.project.settings.value("someKey")
I should get "VALUE" back, correct? Because the setting is baked into the spp file, correct?

I'm getting an undefined value right now.

Any info much appreciated!

6
Hello! I pulled in the plug-in skeleton, and am doing a bit of post-processing in the onExportFinished callback using the subprocess module. I'd like to show regular progress, ideally with an AlgProgressBar.

But, it seems like the callback itself is blocking -- even if I just do simple alg.log calls, they don't show up until the entire function is finished.

Is this expected? Is there a way I can get the main window and/or one of my plug-in windows to update while processing? I'm not sure how threading is being handled under the hood.

Thanks!

7
Hello!

I'm finding the framing of my iRay renders changes depending on the size of the window/viewport, whether or not I have "Override viewport resolution" enabled. I'm looking through a camera imported through an FBX, and when I change the size of the window, the framing changes even though the camera properties don't. It does also show in the rendered image when I "Save render..."

Is there a way to lock this to correctly frame according to the camera?

8
I could have sworn I've done this before with an Alembic file -- I have shading groups assigned (at face-level) in Maya. I'm exporting an Alembic file and writing out facesets. I can see the facesets when I load the Alembic elsewhere (like Houdini).

But, when I try to load the Alembic file into Substance Painter, I get these errors in the log:

Quote
[Scene 3D] Alembic: Ignoring object with unknown or unsupported schema: AbcGeom_FaceSet_v1

So it's not creating texture sets based on my shading groups. Please help!

Pages: [1]