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

Unreal: support in Deadline #1

Merged
merged 14 commits into from
Aug 7, 2024
Merged

Conversation

iLLiCiTiT
Copy link
Member

@iLLiCiTiT iLLiCiTiT commented Jul 8, 2024

Changelog Description

This PR should add possibility to render Unreal project on Deadline with Perforce integration (and possibly without P4).

Additional info

It requires ynput/ayon-version-control#2, working Perforce server with user credentials and P4 workspace created following some P4 depot and stream

Testing notes:

  1. set info about P4
    image
    2,provide P4 user credentials (in Project Settings > Site Settings)
    image
  2. Deadline must have some environment variables set
  • either via OS environments
  • OR via env vars set on Unreal in Applications addon
    image
    Expected env var: (applicable values for DL WORKER, not artist machine)
   "UnrealExecutable": {"windows": "C:/Program Files/Epic Games/UE_5.3/Engine/Binaries/Win64/UnrealEditor-Cmd.exe"},
   "UnrealExecutable_5_3": {"windows": "C:/Program Files/Epic Games/UE_5.3/Engine/Binaries/Win64/UnrealEditor-Cmd.exe"},
   "P4PORT":"localhost:1666",
   "P4USER":"admin",
   "P4PASSWD":"pass"
  1. Copy ayon_core/modules/deadline/repository/custom/plugins/UnrealEngine5 to DEADLINE_REPO/custom folder
  2. Render for DL uses existing creator and follow existing workflow, only added Render target
    image
  3. Provide path for render config and render queue ayon+settings://unreal/render_config_path and make sure that it exists in Unreal project
    image
    (expected value /Game/Ayon/DefaultMovieRenderQueueConfig.DefaultMovieRenderQueueConfig)
    (expected value for Render Queue Path - /Game/Ayon/renderQueue
  4. There must be at least 2 instances to be published, changelist_metadata creates instance with information about change list
    image
    (and render instance set to Farm publishing. Presence of changelist_metadata triggers Perforce sync before rendering on Deadline workers, implementation works even Perforce though.)

Additional info

PR moved from ynput/ayon-core#670
Its cleaned up version of ynput/ayon-core#183 .
Unreal part in ynput/ayon-unreal#8
Version control part in ynput/ayon-version-control#2

Official Unreal5 Deadline plugin is there as it contains additional 2 scripts for Perforce which needs to run before Unreal jobs. Its a question how to easily deploy those to DL repo, as it is not possible to just add these 2 to custom/Unreal5 to be picked up in addition to main Unreal5 plugin.
To add them to GlobalJobPreload seems a bit weird. But open for recommendations how to add them for easy deployment

AY-990

kalisp added 2 commits July 8, 2024 18:43
Whole Unreal5 plugin copied here as it is not possible to add to custom folder only `JobPreLoad.py` and `UnrealSyncUtil.py` which is handling Perforce. Might need to be revisited as this would create dependency on official Unreal5 plugin.

`JobPreLoad.py` and `UnrealSyncUtil.py` handles Perforce syncing, must be triggered before Unreal rendering job. It would better to have here only these two files here, but deployment wouldn't be straightforward copy as for other plugins.
@tatiana-ynput tatiana-ynput self-assigned this Jul 23, 2024
Subfolders were added to limit imports in different DCCs
Copy link
Member

@m-u-r-p-h-y m-u-r-p-h-y left a comment

Choose a reason for hiding this comment

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

was requested to test, but I'm lost and without clear test description can not help . . .

kalisp added 2 commits July 24, 2024 12:15
It should be relative path from workspace dir until folder with project
'env' is controlled by AYON, os.getenv might not
Stream is required
Copy link
Member

@antirotor antirotor left a comment

Choose a reason for hiding this comment

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

Just few notes, otherwise it works.

Just for the record, we are including UnrealEngine5 Deadline plugin with small bugfixes as is. Major part is unused by AYON at all, so in the next steps we need to decide what to do with it - as maintaining is probably nothing for us.

@antirotor antirotor added the type: feature Adding something new and exciting to the product label Jul 24, 2024
kalisp and others added 3 commits July 31, 2024 11:14
@kalisp kalisp requested a review from antirotor July 31, 2024 09:20
Copy link
Member

@antirotor antirotor left a comment

Choose a reason for hiding this comment

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

Some question about Deadline plugin configuration....

version = deadlinePlugin.GetPluginInfoEntry("EngineVersion")
deadlinePlugin.LogInfo('Version defined: %s' % version )
version_string = str(version).replace(".", "_")
executable_key = f"UnrealEditorExecutable_{version_string}"
Copy link
Member

Choose a reason for hiding this comment

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

So with removing of hardcoded Unreal executable path by b57f535 this needs basically UnrealEditorExecutable_5_4 to be preset in the param (possibly UnrealEngine5.param) file, but currently there's nothing. Shouldn't we at least provide entries there for the latest 3 versions (5.2, 5.3 and 5.4)? Without it, it crashes:

Error: Job preload script 'C:\ProgramData\Thinkbox\Deadline10\workers\PHOBOS\plugins\66b25541b95e063dbc2eee1c\JobPreLoad.py': Unreal Engine 5.4 entry not found in .param file (FranticX.Scripting.PythonNetException)
   at Deadline.Plugins.DeadlinePlugin.FailRender(String message)

Copy link
Member

Choose a reason for hiding this comment

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

Or even better - set UnrealExecutable environment variable using AYON environments?

Copy link
Member

Choose a reason for hiding this comment

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

I am setting UnrealExecutable in env vars, see in Description
image

Copy link
Member

Choose a reason for hiding this comment

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

oh right, I am doing this too, but still getting thit error 🤔
There is even this entry in Job log:

2024-08-07 10:11:43:  0: INFO: Setting Process Environment Variable UnrealExecutable to C:\Program Files\Epic Games\UE_5.4\Engine\Binaries\Win64\UnrealEditor-Cmd.exe

Copy link
Member

Choose a reason for hiding this comment

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

so it should take both UnrealExecutable or UnrealEditorExecutable_5_4 (notice that extra Editor). So the problem is, that these variables will not make it to the UnrealEngine5 plugin proces (os.getenv() in JobPreLoad.py doesn't have them)

Copy link
Member

@antirotor antirotor left a comment

Choose a reason for hiding this comment

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

it works with this

Copy link
Member

@antirotor antirotor left a comment

Choose a reason for hiding this comment

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

works! thanks

@antirotor antirotor merged commit c975526 into develop Aug 7, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature Adding something new and exciting to the product
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants