mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
support to validate multiple export channel filtering
This commit is contained in:
parent
6d03f7bd87
commit
fb2e41c9d8
1 changed files with 21 additions and 7 deletions
|
|
@ -30,13 +30,27 @@ class ValidateOutputMaps(pyblish.api.InstancePlugin):
|
|||
# it will generate without actually exporting the files. So we try to
|
||||
# generate the smallest size / fastest export as possible
|
||||
config = copy.deepcopy(config)
|
||||
if creator_attrs.get("exportChannel", []):
|
||||
for export_preset in config.get("exportPresets", {}):
|
||||
if not export_preset.get("maps"):
|
||||
raise PublishValidationError(
|
||||
"No Texture Map Exported with texture set:{}.".format(
|
||||
instance.name)
|
||||
)
|
||||
export_channel = creator_attrs.get("exportChannel", [])
|
||||
tmp_export_channel = copy.deepcopy(export_channel)
|
||||
if export_channel:
|
||||
for export_preset in config.get("exportPresets", {}):
|
||||
if not export_preset.get("maps", {}):
|
||||
raise PublishValidationError(
|
||||
"No Texture Map Exported with texture set:{}.".format(
|
||||
instance.name)
|
||||
)
|
||||
map_names = [channel_map["fileName"] for channel_map
|
||||
in export_preset["maps"]]
|
||||
for channel in tmp_export_channel:
|
||||
for map_name in map_names:
|
||||
if channel in map_name:
|
||||
tmp_export_channel.remove(channel)
|
||||
if tmp_export_channel:
|
||||
raise PublishValidationError(
|
||||
"No Channel(s) {} found in the texture set:{}".format(
|
||||
tmp_export_channel, instance.name
|
||||
))
|
||||
|
||||
parameters = config["exportParameters"][0]["parameters"]
|
||||
parameters["sizeLog2"] = [1, 1] # output 2x2 images (smallest)
|
||||
parameters["paddingAlgorithm"] = "passthrough" # no dilation (faster)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue