Merge pull request #602 from ynput/enhancement/AY-5687_Substance-review-attribute

Substance Painter: add review attributes in texture creator
This commit is contained in:
Kayla Man 2024-06-10 20:30:11 +08:00 committed by GitHub
commit 4a871c360d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View file

@ -46,6 +46,7 @@ class CreateTextures(Creator):
creator_attributes = instance_data.setdefault( creator_attributes = instance_data.setdefault(
"creator_attributes", dict()) "creator_attributes", dict())
for key in [ for key in [
"review",
"exportPresetUrl", "exportPresetUrl",
"exportFileFormat", "exportFileFormat",
"exportSize", "exportSize",
@ -143,6 +144,10 @@ class CreateTextures(Creator):
} }
return [ return [
BoolDef("review",
label="Review",
tooltip="Mark as reviewable",
default=True),
EnumDef("exportChannel", EnumDef("exportChannel",
items=export_channel_enum, items=export_channel_enum,
multiselection=True, multiselection=True,

View file

@ -124,7 +124,6 @@ class CollectTextureSet(pyblish.api.InstancePlugin):
staging_dir = os.path.dirname(first_filepath) staging_dir = os.path.dirname(first_filepath)
representation["tags"] = ["review"] representation["tags"] = ["review"]
representation["stagingDir"] = staging_dir representation["stagingDir"] = staging_dir
# Clone the instance # Clone the instance
product_type = "image" product_type = "image"
image_instance = context.create_instance(image_product_name) image_instance = context.create_instance(image_product_name)
@ -136,6 +135,9 @@ class CollectTextureSet(pyblish.api.InstancePlugin):
image_instance.data["productType"] = product_type image_instance.data["productType"] = product_type
image_instance.data["family"] = product_type image_instance.data["family"] = product_type
image_instance.data["families"] = [product_type, "textures"] image_instance.data["families"] = [product_type, "textures"]
if instance.data["creator_attributes"].get("review"):
image_instance.data["families"].append("review")
image_instance.data["representations"] = [representation] image_instance.data["representations"] = [representation]
# Group the textures together in the loader # Group the textures together in the loader