Publish from Substance Painter : output several resolutions

Hi,

Let’s say I have a Substance Painter textureSet (resolution = 2048).
At publish time, it outputs 2048 textures, all right.

Now, what if I need, for each output textures, 3 representations of the same image ? 2048, 1024, 512

This thread is helpful :

But I have no luck so far : Representation 'png' has no colorspace data.

Here is what I tried :

oiio_1

oiio_2

For the Target Colorspace field, I tried Output - sRGB , and I tried to leave it empty, but it does not help.
For the Product types field, I tried image, I got this :

DEBUG: Skipped instance. None of profiles in presets are for Host: "substancepainter" | Product types: "textureSet" | Product names: "textureSetSurfacingRoughMain1" | Task name "surfacingRough" | Task type "Surfacing"
DEBUG: Looking for matching profile for: hosts: "substancepainter" | product_types: "workfile" | product_names: "workfileSurfacingRough" | task_names: "surfacingRough" | task_types: "Surfacing"
DEBUG: "workfile" not found in "product_types": ['image']
DEBUG: None of profiles match your setup. hosts: "substancepainter" | product_types: "workfile" | product_names: "workfileSurfacingRough" | task_names: "surfacingRough" | task_types: "Surfacing"
DEBUG: Skipped instance. None of profiles in presets are for Host: "substancepainter" | Product types: "workfile" | Product names: "workfileSurfacingRough" | Task name "surfacingRough" | Task type "Surfacing"
DEBUG: Looking for matching profile for: hosts: "substancepainter" | product_types: "image" | product_names: "textureSurfacingRoughMain1.base" | task_names: "surfacingRough" | task_types: "Surfacing"
DEBUG: Profile selected: {'product_types': ['image'], 'hosts': ['substancepainter'], 'task_types': [], 'task_names': [], 'product_names': [], 'delete_original': False, 'outputs': [{'name': 'png', 'extension': 'png', 'transcoding_type': 'colorspace', 'colorspace': 'Output - sRGB', 'display_view': {'display': '', 'view': ''}, 'oiiotool_args': {'additional_command_args': ['--resize', '50%']}, 'tags': [], 'custom_tags': []}]}
DEBUG: repre (1): `png`
DEBUG: Representation 'png' has no colorspace data. Skipped.
DEBUG: Looking for matching profile for: hosts: "substancepainter" | product_types: "image" | product_names: "textureSurfacingRoughMain1.materialParams" | task_names: "surfacingRough" | task_types: "Surfacing"
DEBUG: Profile selected: {'product_types': ['image'], 'hosts': ['substancepainter'], 'task_types': [], 'task_names': [], 'product_names': [], 'delete_original': False, 'outputs': [{'name': 'png', 'extension': 'png', 'transcoding_type': 'colorspace', 'colorspace': 'Output - sRGB', 'display_view': {'display': '', 'view': ''}, 'oiiotool_args': {'additional_command_args': ['--resize', '50%']}, 'tags': [], 'custom_tags': []}]}
DEBUG: repre (1): `png`
DEBUG: Representation 'png' has no colorspace data. Skipped.
DEBUG: Looking for matching profile for: hosts: "substancepainter" | product_types: "image" | product_names: "textureSurfacingRoughMain1.normal" | task_names: "surfacingRough" | task_types: "Surfacing"
DEBUG: Profile selected: {'product_types': ['image'], 'hosts': ['substancepainter'], 'task_types': [], 'task_names': [], 'product_names': [], 'delete_original': False, 'outputs': [{'name': 'png', 'extension': 'png', 'transcoding_type': 'colorspace', 'colorspace': 'Output - sRGB', 'display_view': {'display': '', 'view': ''}, 'oiiotool_args': {'additional_command_args': ['--resize', '50%']}, 'tags': [], 'custom_tags': []}]}
DEBUG: repre (1): `png`
DEBUG: Representation 'png' has no colorspace data. Skipped.

.

If I change Product types field, with textureSet, I get this in Transcode color spaces logs :

DEBUG: Looking for matching profile for: hosts: "substancepainter" | product_types: "textureSet" | product_names: "textureSetSurfacingRoughMain1" | task_names: "surfacingRough" | task_types: "Surfacing"
DEBUG: Profile selected: {'product_types': ['textureSet'], 'hosts': ['substancepainter'], 'task_types': [], 'task_names': [], 'product_names': [], 'delete_original': False, 'outputs': [{'name': 'png', 'extension': 'png', 'transcoding_type': 'colorspace', 'colorspace': 'Output - sRGB', 'display_view': {'display': '', 'view': ''}, 'oiiotool_args': {'additional_command_args': ['--resize', '50%']}, 'tags': [], 'custom_tags': []}]}
DEBUG: Looking for matching profile for: hosts: "substancepainter" | product_types: "workfile" | product_names: "workfileSurfacingRough" | task_names: "surfacingRough" | task_types: "Surfacing"
DEBUG: "workfile" not found in "product_types": ['textureSet']
DEBUG: None of profiles match your setup. hosts: "substancepainter" | product_types: "workfile" | product_names: "workfileSurfacingRough" | task_names: "surfacingRough" | task_types: "Surfacing"
DEBUG: Skipped instance. None of profiles in presets are for Host: "substancepainter" | Product types: "workfile" | Product names: "workfileSurfacingRough" | Task name "surfacingRough" | Task type "Surfacing"
DEBUG: Looking for matching profile for: hosts: "substancepainter" | product_types: "image" | product_names: "textureSurfacingRoughMain1.base" | task_names: "surfacingRough" | task_types: "Surfacing"
DEBUG: "image" not found in "product_types": ['textureSet']
DEBUG: None of profiles match your setup. hosts: "substancepainter" | product_types: "image" | product_names: "textureSurfacingRoughMain1.base" | task_names: "surfacingRough" | task_types: "Surfacing"
DEBUG: Skipped instance. None of profiles in presets are for Host: "substancepainter" | Product types: "image" | Product names: "textureSurfacingRoughMain1.base" | Task name "surfacingRough" | Task type "Surfacing"
DEBUG: Looking for matching profile for: hosts: "substancepainter" | product_types: "image" | product_names: "textureSurfacingRoughMain1.materialParams" | task_names: "surfacingRough" | task_types: "Surfacing"
DEBUG: "image" not found in "product_types": ['textureSet']
DEBUG: None of profiles match your setup. hosts: "substancepainter" | product_types: "image" | product_names: "textureSurfacingRoughMain1.materialParams" | task_names: "surfacingRough" | task_types: "Surfacing"
DEBUG: Skipped instance. None of profiles in presets are for Host: "substancepainter" | Product types: "image" | Product names: "textureSurfacingRoughMain1.materialParams" | Task name "surfacingRough" | Task type "Surfacing"
DEBUG: Looking for matching profile for: hosts: "substancepainter" | product_types: "image" | product_names: "textureSurfacingRoughMain1.normal" | task_names: "surfacingRough" | task_types: "Surfacing"
DEBUG: "image" not found in "product_types": ['textureSet']
DEBUG: None of profiles match your setup. hosts: "substancepainter" | product_types: "image" | product_names: "textureSurfacingRoughMain1.normal" | task_names: "surfacingRough" | task_types: "Surfacing"
DEBUG: Skipped instance. None of profiles in presets are for Host: "substancepainter" | Product types: "image" | Product names: "textureSurfacingRoughMain1.normal" | Task name "surfacingRough" | Task type "Surfacing"

.

In Extract Colorspace data I get this :

DEBUG: No representations at instance : `textureSetSurfacingRoughMain1`

DEBUG: Extension 'spp' is not in allowed extensions.

DEBUG: Looking for matching profile for: task_names: "surfacingRough" | task_types: "Surfacing" | host_names: "substancepainter"

DEBUG: Profile selected: {'host_names': [], 'task_types': [], 'task_names': [], 'type': 'builtin_path', 'builtin_path': '{BUILTIN_OCIO_ROOT}/aces_1.2/config.ocio', 'custom_path': '', 'published_product': {'product_name': '', 'fallback': {'fallback_type': 'builtin_path', 'builtin_path': 'ACES 1.2', 'custom_path': ''}}}

DEBUG: Config data is: `{'path': 'C:\\Users\\Alain\\AppData\\Local\\Ynput\\AYON\\addons\\ayon_ocio_1.1.1\\ayon_ocio\\configs\\OpenColorIOConfigs\\aces_1.2\\config.ocio', 'template': '{BUILTIN_OCIO_ROOT}/aces_1.2/config.ocio'}`

DEBUG: Config data is: `{'path': 'C:\\Users\\Alain\\AppData\\Local\\Ynput\\AYON\\addons\\ayon_ocio_1.1.1\\ayon_ocio\\configs\\OpenColorIOConfigs\\aces_1.2\\config.ocio', 'template': '{BUILTIN_OCIO_ROOT}/aces_1.2/config.ocio'}`

DEBUG: Config data is: `{'path': 'C:\\Users\\Alain\\AppData\\Local\\Ynput\\AYON\\addons\\ayon_ocio_1.1.1\\ayon_ocio\\configs\\OpenColorIOConfigs\\aces_1.2\\config.ocio', 'template': '{BUILTIN_OCIO_ROOT}/aces_1.2/config.ocio'}`

As far as I know, the ExtractOIIOTranscode plugin serves a particular use case:
Post process a sequence of images (mostly render and review) to

  • adjust the colorspace, convert format (e,g, exrjpeg)
  • maybe adjust the resolution

I’m not sure if we can re-use/abuse this system to make it generate multiple representations of the image sequence with different resolutions.
I think only one profile is used, so you’ll mostly get not more that one extra representation.

Thanks Mustafa.

Currently I don’t even succeed to use a single profile :stuck_out_tongue_winking_eye:

For me it’s not an image sequence, I only need it for a few textures.

In case it really can’t work with 2 profiles (the main resolution is 2048, so I need a profil to get a 1024, and another profil to get a 512) :
Does Ayon have another way of producing it ?

It looks like you have color management disabled for your Substance Painter workflow? It’s somehow not detecting any colorspace data for your outputs? because if it had - then it would have had colorspace data anyway.

However, it may also very well be worth it to allow ExtractOIIOTranscode to support a setting like “Dont convert colorspace” so that you can also use it to just convert filetype or perform scaling like this even if NO colorspace data exists in the input instance. Because in your case I don’t think you actually want to mess with the colorspace of the image but JUST want to resize? If that sounds nice, then could you create an issue on ayon-core? :slight_smile:

I have enabled Color Management here :

Settings–>Substance Painter–>Color Management (ImageIO)–>Enable Color Management–>ON

Settings–>Core–>Color Management (ImageIO)–>Enable Color Management–>ON

Ah sorry, you meant to enable it in Substance Painter itself (I’m not used to color management, and I never used Substance before).

Now it detects the colorspace and goes a step further, but I get the “This is not your fault”, with these logs in Integrate Asset :

CRITICAL: Error when registering
Detail: duplicate key value violates unique constraint "representation_unique_name_on_version"
DETAIL:  Key (version_id, name)=(1f12ff6d-9e0e-11ef-9981-f02f74ade395, png) already exists..

The full log of Integrate Asset :

DEBUG: Establishing staging directory @ d:\temp\pyblish_tmp_jsmvfpsm
DEBUG: Looking for matching profile for: hosts: "substancepainter" | product_types: "image" | task_names: "surfacingRough" | task_types: "Surfacing"
DEBUG: "image" not found in "product_types": ['review', 'render', 'prerender']
DEBUG: "substancepainter" not found in "hosts": ['standalonepublisher']
DEBUG: "substancepainter" not found in "hosts": ['maya']
DEBUG: "substancepainter" not found in "hosts": ['traypublisher']
DEBUG: "substancepainter" not found in "hosts": ['max']
DEBUG: Profile selected: {'product_types': [], 'hosts': [], 'task_types': [], 'task_names': [], 'template_name': 'default'}
DEBUG: Product: textureSurfacingRoughMain1.base
DEBUG: http://ayonserver:5000 "POST /graphql HTTP/1.1" 200 474
DEBUG: Response <RestApiResponse [200]>
DEBUG: Prepared product: textureSurfacingRoughMain1.base
DEBUG: http://ayonserver:5000 "POST /graphql HTTP/1.1" 200 105
DEBUG: Response <RestApiResponse [200]>
DEBUG: Source: {root[work]}/UNREAL_POC_PRODUCTS/PROD/CREA/ASSETS_3D/TESTS/BATMAN/Surfacing/WIP/surfacingRough/BATMAN_srf_v023_autosave_0.spp
DEBUG: Creating new version ...
DEBUG: Prepared version: v023
DEBUG: http://ayonserver:5000 "POST /graphql HTTP/1.1" 200 112
DEBUG: Response <RestApiResponse [200]>
DEBUG: Anatomy template name: default
DEBUG: Anatomy template name: default
DEBUG: Anatomy template name: default
DEBUG: Anatomy template name: default
DEBUG: Executing [POST] http://ayonserver:5000/api/projects/UNREAL_POC_PRODUCTS/operations
DEBUG: http://ayonserver:5000 "POST /api/projects/UNREAL_POC_PRODUCTS/operations HTTP/1.1" 200 204
DEBUG: Response <RestApiResponse [200]>
INFO: Product 'textureSurfacingRoughMain1.base' version 23 written to database..
DEBUG: Integrating source files to destination ...
DEBUG: Checking file ... d:\temp\pyblish_tmp_jsmvfpsm\BALL_modelMain_v003_Suzanne_base_Utility - sRGB - Texture.png -> P:\UNREAL_POC_PRODUCTS\PROD\CREA\ASSETS_3D\TESTS\BATMAN\Surfacing\PUBLISH\textureSurfacingRoughMain1.base\v023\BATMAN_textureSurfacingRoughMain1.base_v023.png
DEBUG: Checking file ... d:\temp\pyblish_tmp_jsmvfpsm\BALL_modelMain_v003_Suzanne_base_Utility - sRGB - Texture.tx -> P:\UNREAL_POC_PRODUCTS\PROD\CREA\ASSETS_3D\TESTS\BATMAN\Surfacing\PUBLISH\textureSurfacingRoughMain1.base\v023\BATMAN_textureSurfacingRoughMain1.base_v023.tx
DEBUG: Checking file ... d:\temp\op_transcoding_wsmqhf3s\BALL_modelMain_v003_Suzanne_base_Utility - sRGB - Texture.png -> P:\UNREAL_POC_PRODUCTS\PROD\CREA\ASSETS_3D\TESTS\BATMAN\Surfacing\PUBLISH\textureSurfacingRoughMain1.base\v023\BATMAN_textureSurfacingRoughMain1.base_v023_png.png
DEBUG: Checking file ... d:\temp\pyblish_tmp_wcq8tfuf\BALL_modelMain_v003_Suzanne_base_Utility - sRGB - Texture_thumb.jpg -> P:\UNREAL_POC_PRODUCTS\PROD\CREA\ASSETS_3D\TESTS\BATMAN\Surfacing\PUBLISH\textureSurfacingRoughMain1.base\v023\BATMAN_textureSurfacingRoughMain1.base_v023_thumbnail.jpg
DEBUG: Copying file ... d:\temp\pyblish_tmp_jsmvfpsm\BALL_modelMain_v003_Suzanne_base_Utility - sRGB - Texture.png -> P:\UNREAL_POC_PRODUCTS\PROD\CREA\ASSETS_3D\TESTS\BATMAN\Surfacing\PUBLISH\textureSurfacingRoughMain1.base\v023\BATMAN_textureSurfacingRoughMain1.base_v023.png
DEBUG: Copying file ... d:\temp\pyblish_tmp_jsmvfpsm\BALL_modelMain_v003_Suzanne_base_Utility - sRGB - Texture.tx -> P:\UNREAL_POC_PRODUCTS\PROD\CREA\ASSETS_3D\TESTS\BATMAN\Surfacing\PUBLISH\textureSurfacingRoughMain1.base\v023\BATMAN_textureSurfacingRoughMain1.base_v023.tx
DEBUG: Copying file ... d:\temp\op_transcoding_wsmqhf3s\BALL_modelMain_v003_Suzanne_base_Utility - sRGB - Texture.png -> P:\UNREAL_POC_PRODUCTS\PROD\CREA\ASSETS_3D\TESTS\BATMAN\Surfacing\PUBLISH\textureSurfacingRoughMain1.base\v023\BATMAN_textureSurfacingRoughMain1.base_v023_png.png
DEBUG: Copying file ... d:\temp\pyblish_tmp_wcq8tfuf\BALL_modelMain_v003_Suzanne_base_Utility - sRGB - Texture_thumb.jpg -> P:\UNREAL_POC_PRODUCTS\PROD\CREA\ASSETS_3D\TESTS\BATMAN\Surfacing\PUBLISH\textureSurfacingRoughMain1.base\v023\BATMAN_textureSurfacingRoughMain1.base_v023_thumbnail.jpg
DEBUG: Backed up existing files: []
DEBUG: Transferred files: ['P:\\UNREAL_POC_PRODUCTS\\PROD\\CREA\\ASSETS_3D\\TESTS\\BATMAN\\Surfacing\\PUBLISH\\textureSurfacingRoughMain1.base\\v023\\BATMAN_textureSurfacingRoughMain1.base_v023.png', 'P:\\UNREAL_POC_PRODUCTS\\PROD\\CREA\\ASSETS_3D\\TESTS\\BATMAN\\Surfacing\\PUBLISH\\textureSurfacingRoughMain1.base\\v023\\BATMAN_textureSurfacingRoughMain1.base_v023.tx', 'P:\\UNREAL_POC_PRODUCTS\\PROD\\CREA\\ASSETS_3D\\TESTS\\BATMAN\\Surfacing\\PUBLISH\\textureSurfacingRoughMain1.base\\v023\\BATMAN_textureSurfacingRoughMain1.base_v023_png.png', 'P:\\UNREAL_POC_PRODUCTS\\PROD\\CREA\\ASSETS_3D\\TESTS\\BATMAN\\Surfacing\\PUBLISH\\textureSurfacingRoughMain1.base\\v023\\BATMAN_textureSurfacingRoughMain1.base_v023_thumbnail.jpg']
DEBUG: Retrieving Representation Site Sync information ...
DEBUG: [{'id': 'ea303b1b-6906-4137-878d-57c58359c79c', 'entity_type': 'representation', 'project_name': 'UNREAL_POC_PRODUCTS', 'operation': 'create', 'data': {'id': '1f1724b19e0e11efae54f02f74ade395', 'versionId': '1f12ff6d9e0e11ef9981f02f74ade395', 'files': [{'id': '1f1f88b49e0e11efb278f02f74ade395', 'name': 'BATMAN_textureSurfacingRoughMain1.base_v023.png', 'path': '{root[work]}/UNREAL_POC_PRODUCTS/PROD/CREA/ASSETS_3D/TESTS/BATMAN/Surfacing/PUBLISH/textureSurfacingRoughMain1.base/v023/BATMAN_textureSurfacingRoughMain1.base_v023.png', 'size': 16903, 'hash': 'BATMAN_textureSurfacingRoughMain1,base_v023,png|1731096884,362986|16903', 'hash_type': 'op3'}], 'name': 'png', 'data': {'context': {'root': {'work': 'P:'}, 'project': {'name': 'UNREAL_POC_PRODUCTS', 'code': 'UPP'}, 'hierarchy': 'PROD/CREA/ASSETS_3D/TESTS', 'folder': {'name': 'BATMAN', 'type': 'Asset', 'path': '/PROD/CREA/ASSETS_3D/TESTS/BATMAN'}, 'task': {'name': 'surfacingRough', 'type': 'Surfacing', 'short': 'srf'}, 'product': {'name': 'textureSurfacingRoughMain1.base', 'type': 'image'}, 'version': 23, 'ext': 'png', 'representation': 'png', 'username': 'alain', 'user': 'alain', 'asset': 'BATMAN', 'subset': 'textureSurfacingRoughMain1.base', 'family': 'image'}, 'colorspaceData': {'colorspace': 'Utility - sRGB - Texture', 'config': {'path': 'C:\\Users\\Alain\\AppData\\Local\\Ynput\\AYON\\addons\\ayon_ocio_1.1.1\\ayon_ocio\\configs\\OpenColorIOConfigs\\aces_1.2\\config.ocio', 'template': '{BUILTIN_OCIO_ROOT}/aces_1.2/config.ocio'}}}, 'attrib': {'path': 'P:\\UNREAL_POC_PRODUCTS\\PROD\\CREA\\ASSETS_3D\\TESTS\\BATMAN\\Surfacing\\PUBLISH\\textureSurfacingRoughMain1.base\\v023\\BATMAN_textureSurfacingRoughMain1.base_v023.png', 'template': '{root[work]}/{project[name]}/{hierarchy}/{folder[name]}/{task[type]}/PUBLISH/{product[name]}/v{version:0>3}/{folder[name]}_{product[name]}_v{version:0>3}<_{output}><.{frame:0>4}><_{udim}>.{ext}'}}}, {'id': 'ae6ca3dc-a4f4-41d2-934b-30060fcfa958', 'entity_type': 'representation', 'project_name': 'UNREAL_POC_PRODUCTS', 'operation': 'create', 'data': {'id': '1f1724b29e0e11efa35cf02f74ade395', 'versionId': '1f12ff6d9e0e11ef9981f02f74ade395', 'files': [{'id': '1f1fc3979e0e11efb676f02f74ade395', 'name': 'BATMAN_textureSurfacingRoughMain1.base_v023.tx', 'path': '{root[work]}/UNREAL_POC_PRODUCTS/PROD/CREA/ASSETS_3D/TESTS/BATMAN/Surfacing/PUBLISH/textureSurfacingRoughMain1.base/v023/BATMAN_textureSurfacingRoughMain1.base_v023.tx', 'size': 147165, 'hash': 'BATMAN_textureSurfacingRoughMain1,base_v023,tx|1731096884,0|147165', 'hash_type': 'op3'}], 'name': 'tx', 'data': {'context': {'root': {'work': 'P:'}, 'project': {'name': 'UNREAL_POC_PRODUCTS', 'code': 'UPP'}, 'hierarchy': 'PROD/CREA/ASSETS_3D/TESTS', 'folder': {'name': 'BATMAN', 'type': 'Asset', 'path': '/PROD/CREA/ASSETS_3D/TESTS/BATMAN'}, 'task': {'name': 'surfacingRough', 'type': 'Surfacing', 'short': 'srf'}, 'product': {'name': 'textureSurfacingRoughMain1.base', 'type': 'image'}, 'version': 23, 'ext': 'tx', 'representation': 'tx', 'username': 'alain', 'user': 'alain', 'asset': 'BATMAN', 'subset': 'textureSurfacingRoughMain1.base', 'family': 'image'}, 'colorspaceData': {'colorspace': 'Utility - sRGB - Texture', 'config': {'path': 'C:\\Users\\Alain\\AppData\\Local\\Ynput\\AYON\\addons\\ayon_ocio_1.1.1\\ayon_ocio\\configs\\OpenColorIOConfigs\\aces_1.2\\config.ocio', 'template': '{BUILTIN_OCIO_ROOT}/aces_1.2/config.ocio'}}}, 'attrib': {'path': 'P:\\UNREAL_POC_PRODUCTS\\PROD\\CREA\\ASSETS_3D\\TESTS\\BATMAN\\Surfacing\\PUBLISH\\textureSurfacingRoughMain1.base\\v023\\BATMAN_textureSurfacingRoughMain1.base_v023.tx', 'template': '{root[work]}/{project[name]}/{hierarchy}/{folder[name]}/{task[type]}/PUBLISH/{product[name]}/v{version:0>3}/{folder[name]}_{product[name]}_v{version:0>3}<_{output}><.{frame:0>4}><_{udim}>.{ext}'}}}, {'id': '7d24e04c-3fd4-4c5e-a688-a66ef2a073ea', 'entity_type': 'representation', 'project_name': 'UNREAL_POC_PRODUCTS', 'operation': 'create', 'data': {'id': '1f174bc39e0e11ef90a0f02f74ade395', 'versionId': '1f12ff6d9e0e11ef9981f02f74ade395', 'files': [{'id': '1f2011bc9e0e11efb683f02f74ade395', 'name': 'BATMAN_textureSurfacingRoughMain1.base_v023_png.png', 'path': '{root[work]}/UNREAL_POC_PRODUCTS/PROD/CREA/ASSETS_3D/TESTS/BATMAN/Surfacing/PUBLISH/textureSurfacingRoughMain1.base/v023/BATMAN_textureSurfacingRoughMain1.base_v023_png.png', 'size': 5377, 'hash': 'BATMAN_textureSurfacingRoughMain1,base_v023_png,png|1731096889,9222183|5377', 'hash_type': 'op3'}], 'name': 'png', 'data': {'context': {'root': {'work': 'P:'}, 'project': {'name': 'UNREAL_POC_PRODUCTS', 'code': 'UPP'}, 'hierarchy': 'PROD/CREA/ASSETS_3D/TESTS', 'folder': {'name': 'BATMAN', 'type': 'Asset', 'path': '/PROD/CREA/ASSETS_3D/TESTS/BATMAN'}, 'task': {'name': 'surfacingRough', 'type': 'Surfacing', 'short': 'srf'}, 'product': {'name': 'textureSurfacingRoughMain1.base', 'type': 'image'}, 'version': 23, 'output': 'png', 'ext': 'png', 'representation': 'png', 'username': 'alain', 'user': 'alain', 'asset': 'BATMAN', 'subset': 'textureSurfacingRoughMain1.base', 'family': 'image'}, 'colorspaceData': {'colorspace': 'Utility - sRGB - Texture', 'config': {'path': 'C:\\Users\\Alain\\AppData\\Local\\Ynput\\AYON\\addons\\ayon_ocio_1.1.1\\ayon_ocio\\configs\\OpenColorIOConfigs\\aces_1.2\\config.ocio', 'template': '{BUILTIN_OCIO_ROOT}/aces_1.2/config.ocio'}}}, 'attrib': {'path': 'P:\\UNREAL_POC_PRODUCTS\\PROD\\CREA\\ASSETS_3D\\TESTS\\BATMAN\\Surfacing\\PUBLISH\\textureSurfacingRoughMain1.base\\v023\\BATMAN_textureSurfacingRoughMain1.base_v023_png.png', 'template': '{root[work]}/{project[name]}/{hierarchy}/{folder[name]}/{task[type]}/PUBLISH/{product[name]}/v{version:0>3}/{folder[name]}_{product[name]}_v{version:0>3}<_{output}><.{frame:0>4}><_{udim}>.{ext}'}}}, {'id': '94c30995-c4e4-4df6-b72c-7d60dca0b033', 'entity_type': 'representation', 'project_name': 'UNREAL_POC_PRODUCTS', 'operation': 'create', 'data': {'id': '1f174bc49e0e11ef8196f02f74ade395', 'versionId': '1f12ff6d9e0e11ef9981f02f74ade395', 'files': [{'id': '1f2080f59e0e11efb338f02f74ade395', 'name': 'BATMAN_textureSurfacingRoughMain1.base_v023_thumbnail.jpg', 'path': '{root[work]}/UNREAL_POC_PRODUCTS/PROD/CREA/ASSETS_3D/TESTS/BATMAN/Surfacing/PUBLISH/textureSurfacingRoughMain1.base/v023/BATMAN_textureSurfacingRoughMain1.base_v023_thumbnail.jpg', 'size': 49374, 'hash': 'BATMAN_textureSurfacingRoughMain1,base_v023_thumbnail,jpg|1731096893,7246556|49374', 'hash_type': 'op3'}], 'name': 'thumbnail', 'data': {'context': {'root': {'work': 'P:'}, 'project': {'name': 'UNREAL_POC_PRODUCTS', 'code': 'UPP'}, 'hierarchy': 'PROD/CREA/ASSETS_3D/TESTS', 'folder': {'name': 'BATMAN', 'type': 'Asset', 'path': '/PROD/CREA/ASSETS_3D/TESTS/BATMAN'}, 'task': {'name': 'surfacingRough', 'type': 'Surfacing', 'short': 'srf'}, 'product': {'name': 'textureSurfacingRoughMain1.base', 'type': 'image'}, 'version': 23, 'output': 'thumbnail', 'ext': 'jpg', 'representation': 'thumbnail', 'username': 'alain', 'user': 'alain', 'asset': 'BATMAN', 'subset': 'textureSurfacingRoughMain1.base', 'family': 'image'}}, 'attrib': {'path': 'P:\\UNREAL_POC_PRODUCTS\\PROD\\CREA\\ASSETS_3D\\TESTS\\BATMAN\\Surfacing\\PUBLISH\\textureSurfacingRoughMain1.base\\v023\\BATMAN_textureSurfacingRoughMain1.base_v023_thumbnail.jpg', 'template': '{root[work]}/{project[name]}/{hierarchy}/{folder[name]}/{task[type]}/PUBLISH/{product[name]}/v{version:0>3}/{folder[name]}_{product[name]}_v{version:0>3}<_{output}><.{frame:0>4}><_{udim}>.{ext}'}}}]
DEBUG: Executing [POST] http://ayonserver:5000/api/projects/UNREAL_POC_PRODUCTS/operations
DEBUG: http://ayonserver:5000 "POST /api/projects/UNREAL_POC_PRODUCTS/operations HTTP/1.1" 200 752
DEBUG: Response <RestApiResponse [200]>
CRITICAL: Error when registering
Traceback (most recent call last):
  File "C:\Users\Alain\AppData\Local\Ynput\AYON\addons\core_1.0.2\ayon_core\plugins\publish\integrate.py", line 158, in process
    self.register(instance, file_transactions, filtered_repres)
  File "C:\Users\Alain\AppData\Local\Ynput\AYON\addons\core_1.0.2\ayon_core\plugins\publish\integrate.py", line 350, in register
    op_session.commit()
  File "C:\Program Files\Ynput\AYON 1.1.1\dependencies\ayon_api\operations.py", line 721, in commit
    self._con.send_batch_operations(
  File "C:\Program Files\Ynput\AYON 1.1.1\dependencies\ayon_api\server_api.py", line 8330, in send_batch_operations
    raise FailedOperations((
ayon_api.exceptions.FailedOperations: Operation "7d24e04c-3fd4-4c5e-a688-a66ef2a073ea" failed with data:
{
    "id": "7d24e04c-3fd4-4c5e-a688-a66ef2a073ea",
    "type": "create",
    "entityType": "representation",
    "entityId": "1f174bc39e0e11ef90a0f02f74ade395",
    "data": {
        "id": "1f174bc39e0e11ef90a0f02f74ade395",
        "versionId": "1f12ff6d9e0e11ef9981f02f74ade395",
        "files": [
            {
                "id": "1f2011bc9e0e11efb683f02f74ade395",
                "name": "BATMAN_textureSurfacingRoughMain1.base_v023_png.png",
                "path": "{root[work]}/UNREAL_POC_PRODUCTS/PROD/CREA/ASSETS_3D/TESTS/BATMAN/Surfacing/PUBLISH/textureSurfacingRoughMain1.base/v023/BATMAN_textureSurfacingRoughMain1.base_v023_png.png",
                "size": 5377,
                "hash": "BATMAN_textureSurfacingRoughMain1,base_v023_png,png|1731096889,9222183|5377",
                "hash_type": "op3"
            }
        ],
        "name": "png",
        "data": {
            "context": {
                "root": {
                    "work": "P:"
                },
                "project": {
                    "name": "UNREAL_POC_PRODUCTS",
                    "code": "UPP"
                },
                "hierarchy": "PROD/CREA/ASSETS_3D/TESTS",
                "folder": {
                    "name": "BATMAN",
                    "type": "Asset",
                    "path": "/PROD/CREA/ASSETS_3D/TESTS/BATMAN"
                },
                "task": {
                    "name": "surfacingRough",
                    "type": "Surfacing",
                    "short": "srf"
                },
                "product": {
                    "name": "textureSurfacingRoughMain1.base",
                    "type": "image"
                },
                "version": 23,
                "output": "png",
                "ext": "png",
                "representation": "png",
                "username": "alain",
                "user": "alain",
                "asset": "BATMAN",
                "subset": "textureSurfacingRoughMain1.base",
                "family": "image"
            },
            "colorspaceData": {
                "colorspace": "Utility - sRGB - Texture",
                "config": {
                    "path": "C:\\Users\\Alain\\AppData\\Local\\Ynput\\AYON\\addons\\ayon_ocio_1.1.1\\ayon_ocio\\configs\\OpenColorIOConfigs\\aces_1.2\\config.ocio",
                    "template": "{BUILTIN_OCIO_ROOT}/aces_1.2/config.ocio"
                }
            }
        },
        "attrib": {
            "path": "P:\\UNREAL_POC_PRODUCTS\\PROD\\CREA\\ASSETS_3D\\TESTS\\BATMAN\\Surfacing\\PUBLISH\\textureSurfacingRoughMain1.base\\v023\\BATMAN_textureSurfacingRoughMain1.base_v023_png.png",
            "template": "{root[work]}/{project[name]}/{hierarchy}/{folder[name]}/{task[type]}/PUBLISH/{product[name]}/v{version:0>3}/{folder[name]}_{product[name]}_v{version:0>3}<_{output}><.{frame:0>4}><_{udim}>.{ext}"
        }
    }
}
Detail: duplicate key value violates unique constraint "representation_unique_name_on_version"
DETAIL:  Key (version_id, name)=(1f12ff6d-9e0e-11ef-9981-f02f74ade395, png) already exists..

Traceback (most recent call last):
  File "C:\Users\Alain\AppData\Local\Ynput\AYON\dependency_packages\ayon_2406251801_windows.zip\dependencies\pyblish\plugin.py", line 528, in __explicit_process
    runner(*args)
  File "C:\Users\Alain\AppData\Local\Ynput\AYON\addons\core_1.0.2\ayon_core\plugins\publish\integrate.py", line 170, in process
    raise exc
  File "C:\Users\Alain\AppData\Local\Ynput\AYON\addons\core_1.0.2\ayon_core\plugins\publish\integrate.py", line 158, in process
    self.register(instance, file_transactions, filtered_repres)
  File "C:\Users\Alain\AppData\Local\Ynput\AYON\addons\core_1.0.2\ayon_core\plugins\publish\integrate.py", line 350, in register
    op_session.commit()
  File "C:\Program Files\Ynput\AYON 1.1.1\dependencies\ayon_api\operations.py", line 721, in commit
    self._con.send_batch_operations(
  File "C:\Program Files\Ynput\AYON 1.1.1\dependencies\ayon_api\server_api.py", line 8330, in send_batch_operations
    raise FailedOperations((
ayon_api.exceptions.FailedOperations: Operation "7d24e04c-3fd4-4c5e-a688-a66ef2a073ea" failed with data:
{
    "id": "7d24e04c-3fd4-4c5e-a688-a66ef2a073ea",
    "type": "create",
    "entityType": "representation",
    "entityId": "1f174bc39e0e11ef90a0f02f74ade395",
    "data": {
        "id": "1f174bc39e0e11ef90a0f02f74ade395",
        "versionId": "1f12ff6d9e0e11ef9981f02f74ade395",
        "files": [
            {
                "id": "1f2011bc9e0e11efb683f02f74ade395",
                "name": "BATMAN_textureSurfacingRoughMain1.base_v023_png.png",
                "path": "{root[work]}/UNREAL_POC_PRODUCTS/PROD/CREA/ASSETS_3D/TESTS/BATMAN/Surfacing/PUBLISH/textureSurfacingRoughMain1.base/v023/BATMAN_textureSurfacingRoughMain1.base_v023_png.png",
                "size": 5377,
                "hash": "BATMAN_textureSurfacingRoughMain1,base_v023_png,png|1731096889,9222183|5377",
                "hash_type": "op3"
            }
        ],
        "name": "png",
        "data": {
            "context": {
                "root": {
                    "work": "P:"
                },
                "project": {
                    "name": "UNREAL_POC_PRODUCTS",
                    "code": "UPP"
                },
                "hierarchy": "PROD/CREA/ASSETS_3D/TESTS",
                "folder": {
                    "name": "BATMAN",
                    "type": "Asset",
                    "path": "/PROD/CREA/ASSETS_3D/TESTS/BATMAN"
                },
                "task": {
                    "name": "surfacingRough",
                    "type": "Surfacing",
                    "short": "srf"
                },
                "product": {
                    "name": "textureSurfacingRoughMain1.base",
                    "type": "image"
                },
                "version": 23,
                "output": "png",
                "ext": "png",
                "representation": "png",
                "username": "alain",
                "user": "alain",
                "asset": "BATMAN",
                "subset": "textureSurfacingRoughMain1.base",
                "family": "image"
            },
            "colorspaceData": {
                "colorspace": "Utility - sRGB - Texture",
                "config": {
                    "path": "C:\\Users\\Alain\\AppData\\Local\\Ynput\\AYON\\addons\\ayon_ocio_1.1.1\\ayon_ocio\\configs\\OpenColorIOConfigs\\aces_1.2\\config.ocio",
                    "template": "{BUILTIN_OCIO_ROOT}/aces_1.2/config.ocio"
                }
            }
        },
        "attrib": {
            "path": "P:\\UNREAL_POC_PRODUCTS\\PROD\\CREA\\ASSETS_3D\\TESTS\\BATMAN\\Surfacing\\PUBLISH\\textureSurfacingRoughMain1.base\\v023\\BATMAN_textureSurfacingRoughMain1.base_v023_png.png",
            "template": "{root[work]}/{project[name]}/{hierarchy}/{folder[name]}/{task[type]}/PUBLISH/{product[name]}/v{version:0>3}/{folder[name]}_{product[name]}_v{version:0>3}<_{output}><.{frame:0>4}><_{udim}>.{ext}"
        }
    }
}
Detail: duplicate key value violates unique constraint "representation_unique_name_on_version"
DETAIL:  Key (version_id, name)=(1f12ff6d-9e0e-11ef-9981-f02f74ade395, png) already exists..

I created an enhancement issue on ayon-core, as you suggested. It would indeed be really nice !

(sorry for spamming this thread with so many messages)

This is perfect actually - because it means you did get both transcoded (or at least one?) but their ‘representation’ names conflict with the initial one.

As such, I assume you have on the left hand side (name) entry in settings the same representation name as the source one. You may want to put e.g. png_512 and png_1024 or png_lod2 and png_lod1 respectively to ensure unique representation names. I have a feeling it may pass then.

Thanks soooooo much :star_struck:

Now it works, and it even works with 2 scalings :

1 Like

Could you double check what the files look like in your publish folder? :slight_smile: I wonder how it differentiates the filenames. :thinking:

Usually we have an outputName we can specify to enforce uniqueness - but I didn’t see it on this plug-in.

BATMAN_textureSurfacingRoughMain1.materialParams_v029.png
BATMAN_textureSurfacingRoughMain1.materialParams_v029_png512.png
BATMAN_textureSurfacingRoughMain1.materialParams_v029_png1024.png

Here is my Anatomy–>Publish–>Default–>Filename :
{folder[name]}{product[name]}{@version}<{output}><.{@frame}><{udim}>.{ext}

1 Like

As you implied, switching ON the Color Management just for scaling textures, it’s a hammer to press a button, it triggers lots of stuff we don’t want.

Do you think my enhancement request (“Allow ExtractOIIOTranscode without colorspace, to just scale”) would imply big code changes ? (which means it has low chances to become reality).

It’s mainly here :

.

I have made very dirty hacks in our fork of these files, to make it work without Color Management, but it kills colorspace instead of switching it OFF.
For my company it’s ok, but others would be pleased to have such feature without hacking.

Could you try leaving the colorspace blank?

As far as I know, it’ll use the collected (source) colorspace which leads to no colorspace conversation.

image

The issue that @Yul has is that he wants to run it without colorspace conversion at all - even if no colorspace data was collected because he was working with color management disabled I suppose in Substance Painter.

Yes, that’s exactly what Roy said.
I would like to avoid enabling color management. I just want to use oiio to resize the output.

I have modified ayon-core’s transcoding.py and extract_color_transcode.py to allow me that behaviour, but other companies probably want the same thing, and don’t want to hack ayon-core.

1 Like