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

Publish UDIM tiles with publisher #963

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

antirotor
Copy link
Member

Changelog Description

Quick fix to publish UDIM textures as Image in Publisher.

Additional info

With this, you can publish only single type tiles at the same time- like BaseColor or Normal (but not both together)

Testing notes:

Try to publish BaseColor.1001.png and BaseColor.1002.png as Image in Publisher.

publish UDIM tiles in Publisher
@antirotor antirotor requested a review from BigRoy October 22, 2024 13:08
@antirotor antirotor self-assigned this Oct 22, 2024
@ynbot ynbot added type: enhancement Improvement of existing functionality or minor addition size/XS and removed host: TrayPublisher labels Oct 22, 2024
@LiborBatek LiborBatek self-requested a review October 23, 2024 06:31
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.

Gives me error on Integrate asset phase (probably due to my file names used)
Screenshot 2024-10-23 093518

Traceback (most recent call last):
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\dependency_packages\ayon_2406251801_windows.zip\dependencies\pyblish\plugin.py", line 528, in __explicit_process
    runner(*args)
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\core_1.0.3+dev\ayon_core\plugins\publish\integrate.py", line 163, in process
    raise KnownPublishError(exc).with_traceback(sys.exc_info()[2])
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\core_1.0.3+dev\ayon_core\plugins\publish\integrate.py", line 158, in process
    self.register(instance, file_transactions, filtered_repres)
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\core_1.0.3+dev\ayon_core\plugins\publish\integrate.py", line 256, in register
    file_transactions.add(src, dst)
  File "C:\Users\lbate\AppData\Local\Ynput\AYON\addons\core_1.0.3+dev\ayon_core\lib\file_transaction.py", line 97, in add
    raise DuplicateDestinationError(
ayon_core.pipeline.publish.publish_plugins.KnownPublishError: Transfer to destination is already in queue: C:\Projects\Quantum_Demo\assets\props\power_generator\publish\image\textureMain.BaseColor\v001\QD_power_generator_textureMain.BaseColor_v001_1001.png -> C:\projects\Ayon_Tests\maya\props\powerGen\publish\image\imageTexture\v001\ATS_powerGen_imageTexture_v001.png. It's not allowed to be replaced by a new transfer from C:\Projects\Quantum_Demo\assets\props\power_generator\publish\image\textureMain.BaseColor\v001\QD_power_generator_textureMain.BaseColor_v001_1002.png

@LiborBatek
Copy link
Member

LiborBatek commented Oct 23, 2024

After done some more tests, the failure is obviously caused by separator

when using dot instead of underscores it works fine...

QD_power_generator_textureMain.BaseColor.1001.png it also works when version been in the naming like

QD_power_generator_textureMain.BaseColor_v001.1001.png

resulting into successfully published images

Screenshot 2024-10-23 094333

from ayon_core.lib import BoolDef
from ayon_core.pipeline import publish

UDIM_REGEX = re.compile(r"(.*)\.(?P<udim>\d{4})\.(.*)")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Allow either . or _ separator to the udim numbers.

Suggested change
UDIM_REGEX = re.compile(r"(.*)\.(?P<udim>\d{4})\.(.*)")
UDIM_REGEX = re.compile(r"(.*)[._](?P<udim>\d{4})\.(.*)")

Comment on lines +27 to +28
if isinstance(representation["files"], (list, tuple)):
continue
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is wrong, no?

Wouldn't this technically actually skip sequences of UDIMs?
Also, should we pop frame from the representation

Copy link
Collaborator

@BigRoy BigRoy Oct 23, 2024

Choose a reason for hiding this comment

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

I think Libor's screenshot show the problem - it's generating a representation PER image in the sequence? Even though it should be one representation - right?

Comment on lines +38 to +40
BoolDef("isUDIM",
label="Is UDIM",
default=False)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add a tooltip/description to explain what this does and when to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XS type: enhancement Improvement of existing functionality or minor addition
Projects
Status: Review In Progress
Development

Successfully merging this pull request may close these issues.

4 participants