AWS Thinkbox Discussion Forums

Job-Info-File in the Unreal Deadline Plugin

Hi,
I’m trying to integrate UNreal in our Pipeline. We render with Deadline and use the Deadline Plugins for Unreal (UnrealDeadlineService and MoviePipelineDeadline). After rendering with Deadline, a Shotgrid-Upload should start. This works with Nuke and rendring via Deadline but not yet for Unreal. We have a custom EventListener but he gets his information such as Output Directory and filename from the Job Info File that was created for the Deadline Job. But when we render from Unreal this information isn’t provided in the usual way in the job info file. There is an ExtraInfo called serialized_pipeline that has a very big and complecated json-script that holds this information but Deadline can’t read that. At least not if I try to get the Output Directory with job.JobOutputDirectories.
My attempt was to first extract the Output Directory and file name from the said json-script in the Job Info in the submit_job(self, job_object) -function of the script deadline_service in the UnrealDeadlineService-Plugin with this:

        job_info = job_data["JobInfo"]

        try:
            data_str = job_info["ExtraInfoKeyValue0"].split('=')[1].strip()
            data_json = json.loads(data_str)
        except (KeyError, json.JSONDecodeError) as e:
            logger.error(
                    "An error occurred"
                )

        output_directory = self.extract_value(data_json, "OutputDirectory")
        filename_format = self.extract_value(data_json, "FileNameFormat")

...

    def extract_value(json_data, target_key):
        """
        Extrahiert den gewünschten Wert für OutputDirectory oder FileNameFormat aus der JSON-Datenstruktur.
    
        :param json_data: JSON-Daten als Dictionary
        :param target_key: Entweder "OutputDirectory" oder "FileNameFormat"
        :return: Der gefundene Wert als String oder None, wenn nicht gefunden
        """
        # Prüfen, ob `Exports` enthalten ist
        exports = json_data.get("Exports", {})
    
        # Über die Einträge in `Exports` iterieren
        for key, value in exports.items():
            # Nur die Einträge mit `DefaultOutputSetting` prüfen
            if "DefaultOutputSetting" in key:
                try:
                    if target_key == "OutputDirectory":
                        return value["Properties"]["__Value"]["OutputDirectory"]["__Value"]["Path"]["__Value"]
                    elif target_key == "FileNameFormat":
                        return value["Properties"]["__Value"]["FileNameFormat"]["__Value"]
                except KeyError:
                    # Wenn der Pfad nicht existiert, weitermachen
                    continue
    
        return None

Then I write this information into the Job Info:

        job_data["JobInfo"].update({
            "OutputDirectory": "%s" % output_directory,
            "OutputFilename": "%s" % filename_format,
            "ExtraInfoKeyValue2": "NoTranscode=False",
            "ExtraInfoKeyValue3": "NoSgUpload=False",
            "ExtraInfoKeyValue4": "Creator=%s" % creator
        })

At least that’s what I’m trying to do because this information doesn’t end up in the Job Info when the job is submitted and I view the Submission parameters in the job properties of the job in Deadline.
What can I do to make it work?
It could also be a problem of Unreal…

And the thing is, some weeks a back a coworker rendered something from Unreal over Deadline and there was a Output Directory and file name in the submission parameters (exactly how it is with Nuke-Jobs) but Deadline still couldn’t find them when the directory was asked with job.JobOutputDirectories.

Do you have any ideas how to fix that and to change the Job Info?

Privacy | Site terms | Cookie preferences