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

Fix single frame publishing for publish job on farm (to Deadline from e.g. Maya) #955

Conversation

BigRoy
Copy link
Collaborator

@BigRoy BigRoy commented Oct 15, 2024

Changelog Description

Fix publishing of single frame render jobs.

Additional info

Why is this suddenly a new issue? It's due to this PR: #908

That actually fixed a long-standing bug... where a plug-in in Deadline would silently and secretly be fixing it, here: https://github.com/ynput/ayon-deadline/blob/368e2510dc3f8dc904168e51f9afa91c1428986c/client/ayon_deadline/plugins/publish/global/validate_expected_and_rendered_files.py#L74-L77

I couldn't fix this "on collect renders" for Maya - because that'd make it fail here where it still expects it to be a list:

for aov, files in expected_files[0].items():
replaced_files = []
for f in files:
replaced_files.append(
str(f).replace(orig_scene, new_scene)
)
new_exp[aov] = replaced_files
# [] might be too much here, TODO
instance.data["expectedFiles"] = [new_exp]

This likely also fixes it for other hosts that use instance.data["expectedFiles"] with the value being list[dict[str, list[str]]] (Basically the files per AOV, where the list of filenames is list[str] but the integrator and other areas really want a single str insteaf of list[str] if it's a single frame). One host I know that does so, is Houdini render submissions.

Metadata json before this PR for a single frame:

...
            "representations": [
                {
                    "colorspaceData": {
                        "colorspace": "ACES - ACEScg",
                        "config": {
                            "path": "C:/Users/User/AppData/Local/Ynput/AYON/addons/ayon_ocio_1.1.1/ayon_ocio/configs/OpenColorIOConfigs/aces_1.2/config.ocio",
                            "template": "C:/Users/User/AppData/Local/Ynput/AYON/addons/ayon_ocio_1.1.1/ayon_ocio/configs/OpenColorIOConfigs/aces_1.2/config.ocio"
                        },
                        "display": "ACES",
                        "view": "sRGB"
                    },
                    "ext": "png",
                    "files": [
                        "Main.1001.png"
                    ],
                    "fps": 25.0,
                    "frameEnd": 1001,
                    "frameStart": 1001,
                    "name": "png",
                    "stagingDir": "{root[work]}/ayontest/asset/char_hero/work/modeling/renders/maya/ynts_char_hero_workfileModeling_v281/Main",
                    "tags": []
                }
            ],
...

After this PR:

...
                        "representations": [
                {
                    "colorspaceData": {
                        "colorspace": "ACES - ACEScg",
                        "config": {
                            "path": "C:/Users/User/AppData/Local/Ynput/AYON/addons/ayon_ocio_1.1.1/ayon_ocio/configs/OpenColorIOConfigs/aces_1.2/config.ocio",
                            "template": "C:/Users/User/AppData/Local/Ynput/AYON/addons/ayon_ocio_1.1.1/ayon_ocio/configs/OpenColorIOConfigs/aces_1.2/config.ocio"
                        },
                        "display": "ACES",
                        "view": "sRGB"
                    },
                    "ext": "png",
                    "files": "Main.1001.png",
                    "fps": 25.0,
                    "frameEnd": 1001,
                    "frameStart": 1001,
                    "name": "png",
                    "stagingDir": "{root[work]}/ayontest/asset/char_hero/work/modeling/renders/maya/ynts_char_hero_workfileModeling_v281/Main",
                    "tags": []
                }
            ],
...

Note the files key now being a single string instead of list of frames.

Fixes ynput/ayon-maya#150

Testing notes:

  1. Submit single frame render job from maya and houdini
  2. It should publish to deadline fine, and the publish job should succeed (with this PR)
    (Without this PR it should fail on deadline publish job)

Tested:

  • Maya
  • Houdini

Also fixes it for other hosts that use instance.data[`expectedFiles`] with the value being `list[dict[str, list[str]]]` (Basically the files per AOV, where the list of filenames is `list[str]` but the integrator and other areas really want a single `str` insteaf of `list[str]` if it's a single frame)
@BigRoy BigRoy added the type: bug Something isn't working label Oct 15, 2024
@BigRoy BigRoy self-assigned this Oct 15, 2024
@ynbot ynbot added size/XS type: enhancement Improvement of existing functionality or minor addition labels Oct 15, 2024
@ynbot
Copy link
Contributor

ynbot commented Oct 15, 2024

Copy link
Member

@moonyuet moonyuet left a comment

Choose a reason for hiding this comment

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

I tested in Houdini, it works smoothly as expected with the single frame.
image

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 was successfully publishing the render from maya and publish job finnished ok on DL.

Also got into AYON without any issues...all good!

image

@iLLiCiTiT iLLiCiTiT merged commit 3212b2f into ynput:develop Oct 16, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XS type: bug Something isn't working type: enhancement Improvement of existing functionality or minor addition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AY-6945_Maya->Deadline: Single frame submissions fails to publish
5 participants