Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Substance Painter: Support for exporting maps/layer stacks with specific channels #532

Merged

Conversation

moonyuet
Copy link
Member

@moonyuet moonyuet commented May 21, 2024

Changelog Description

This PR is to add support for exporting outputs with specific channels defined in the settings and the users can choose to export layer with use_selection being enabled.
image
image
User can add/define their channel map in the ayon project setting, once they add their maps, it would show up in the multiselection options of export channel.
You need to specify your channel type and the name of your channel type(of which name extension you set in your export presets)
image

Additional info

  • Update SubstancePainter Addon 0.1.2 to test this PR
  • Export Layer Stack by selection is only compatible with substance painter 10.0.0
  • Layer Stack Export only works when both export channel and use selections being enabled.
    The template below showed the setting does not support for exporting specific channels
  • Export specific channels are not supported for the templates from the export-preset-generator due to the limitation of Substance API (currently asking Substance Painter support in substance discord now to see if they would support in the next version)
"2D View",
"Document channels + Normal + AO (No Alpha)",  
"Document channels + Normal + AO (With Alpha)", 
"Sketchfab",  
"Substance 3D Stager",
 "USD PBR Metal Roughness", 
"glTF PBR Metal Roughness",  
"glTF PBR Metal Roughness + Displacement texture (experimental)" 

Testing notes:

Without layer stack

  1. Create Texture Set with your preferred template
  2. Choose your export channel
  3. Publish
  4. Only your chosen export channel is being published

With selected layer stack

  1. Create Texture Set with your preferred template with your selected layer stack with the use_selection being enabled.
  2. Choose your export channel
  3. Publish
  4. Only your selected layer stack with your chosen export channel being published

General

  1. Create Texture Set
  2. Export Channel without any input
  3. Publish
  4. All channels should be published correctly

@moonyuet moonyuet requested a review from BigRoy May 21, 2024 10:43
@ynbot
Copy link
Contributor

ynbot commented May 21, 2024

@ynbot ynbot added type: enhancement Improvement of existing functionality or minor addition size/S host: Substance Painter labels May 21, 2024
@moonyuet moonyuet requested a review from LiborBatek May 21, 2024 10:43
@moonyuet moonyuet marked this pull request as ready for review May 21, 2024 11:41
client/ayon_core/hosts/substancepainter/api/lib.py Outdated Show resolved Hide resolved
client/ayon_core/hosts/substancepainter/api/lib.py Outdated Show resolved Hide resolved
client/ayon_core/hosts/substancepainter/api/lib.py Outdated Show resolved Hide resolved
client/ayon_core/hosts/substancepainter/api/lib.py Outdated Show resolved Hide resolved
client/ayon_core/hosts/substancepainter/api/lib.py Outdated Show resolved Hide resolved
client/ayon_core/hosts/substancepainter/api/lib.py Outdated Show resolved Hide resolved
client/ayon_core/hosts/substancepainter/api/lib.py Outdated Show resolved Hide resolved
Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made bunch of misc tests with different conditions for publish of the texture set.

All three occasions works well as I was able to produce standard full publish of texture set, also just picked channel like base color or roughness and finally also test with Use Selected option.

There is also no malfunction when mutliple publish instances present...again all good!

image

moonyuet and others added 2 commits May 23, 2024 19:22
@moonyuet moonyuet requested a review from LiborBatek May 24, 2024 13:46
Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All seems working well in any circumstances, wether its just selection, cherrypicked channel types or non existing channels, user gets proper Validation for each occasion informing user whats going on aka wrong...

Screenshot 2024-05-28 103228

Screenshot 2024-05-28 103254

And finally all products succesfully produced!

Screenshot 2024-05-28 103200

Screenshot 2024-05-28 103443

@moonyuet
Copy link
Member Author

@iLLiCiTiT can you check on the code?

@moonyuet moonyuet requested review from antirotor and BigRoy May 28, 2024 09:51
@moonyuet moonyuet requested a review from BigRoy May 28, 2024 12:19
Copy link
Member

@antirotor antirotor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

went quickly through the code, looks fine but I couldn't test it

Copy link
Collaborator

@BigRoy BigRoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside of the open comments the code looks good. I did not do a test run as I do not have Substance Painter available to me currently but the code looks good aside of aforementioned notes.

@LiborBatek LiborBatek self-requested a review May 29, 2024 07:44
Copy link
Member

@LiborBatek LiborBatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did make last round of stress tests also including UDIM tiles and removing/adding custom channel type and all working nicely!

It also works well with new or adjusted Texture Export Preset user creates... so all good!

image

@moonyuet moonyuet merged commit 77867de into develop May 29, 2024
1 check passed
@moonyuet moonyuet deleted the enhancement/AY-5104_Substance-selective-export-of-layers branch May 29, 2024 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
host: Substance Painter size/S type: enhancement Improvement of existing functionality or minor addition
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants