mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
fix the wrong directory for rendering
This commit is contained in:
parent
9989e98e08
commit
c14525f371
4 changed files with 30 additions and 20 deletions
|
|
@ -39,7 +39,7 @@ class CollectRender(pyblish.api.InstancePlugin):
|
||||||
full_render_list = beauty_list
|
full_render_list = beauty_list
|
||||||
|
|
||||||
files_by_aov = {
|
files_by_aov = {
|
||||||
"beauty": beauty_list
|
"max_beauty": beauty_list
|
||||||
}
|
}
|
||||||
|
|
||||||
folder = folder.replace("\\", "/")
|
folder = folder.replace("\\", "/")
|
||||||
|
|
|
||||||
|
|
@ -582,7 +582,7 @@ class AbstractSubmitDeadline(pyblish.api.InstancePlugin):
|
||||||
metadata_folder = metadata_folder.replace(orig_scene,
|
metadata_folder = metadata_folder.replace(orig_scene,
|
||||||
new_scene)
|
new_scene)
|
||||||
instance.data["publishRenderMetadataFolder"] = metadata_folder
|
instance.data["publishRenderMetadataFolder"] = metadata_folder
|
||||||
|
self.log.debug(f"MetadataFolder:{metadata_folder}")
|
||||||
self.log.info("Scene name was switched {} -> {}".format(
|
self.log.info("Scene name was switched {} -> {}".format(
|
||||||
orig_scene, new_scene
|
orig_scene, new_scene
|
||||||
))
|
))
|
||||||
|
|
|
||||||
|
|
@ -132,8 +132,8 @@ class MaxSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline,
|
||||||
|
|
||||||
# Add list of expected files to job
|
# Add list of expected files to job
|
||||||
# ---------------------------------
|
# ---------------------------------
|
||||||
files = instance.data.get("files")
|
exp = instance.data.get("expectedFiles")
|
||||||
for filepath in files:
|
for filepath in self._iter_expected_files(exp):
|
||||||
job_info.OutputDirectory += os.path.dirname(filepath)
|
job_info.OutputDirectory += os.path.dirname(filepath)
|
||||||
job_info.OutputFilename += os.path.basename(filepath)
|
job_info.OutputFilename += os.path.basename(filepath)
|
||||||
|
|
||||||
|
|
@ -162,10 +162,11 @@ class MaxSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline,
|
||||||
instance = self._instance
|
instance = self._instance
|
||||||
filepath = self.scene_path
|
filepath = self.scene_path
|
||||||
|
|
||||||
files = instance.data["files"]
|
files = instance.data["expectedFiles"]
|
||||||
if not files:
|
if not files:
|
||||||
raise RuntimeError("No Render Elements found!")
|
raise RuntimeError("No Render Elements found!")
|
||||||
output_dir = os.path.dirname(files[0])
|
first_file = next(self._iter_expected_files(files))
|
||||||
|
output_dir = os.path.dirname(first_file)
|
||||||
instance.data["outputDir"] = output_dir
|
instance.data["outputDir"] = output_dir
|
||||||
instance.data["toBeRenderedOn"] = "deadline"
|
instance.data["toBeRenderedOn"] = "deadline"
|
||||||
|
|
||||||
|
|
@ -202,17 +203,11 @@ class MaxSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline,
|
||||||
old_output_dir = os.path.dirname(files[0])
|
old_output_dir = os.path.dirname(files[0])
|
||||||
output_beauty = RenderSettings().get_render_output(instance.name,
|
output_beauty = RenderSettings().get_render_output(instance.name,
|
||||||
old_output_dir)
|
old_output_dir)
|
||||||
filepath = self.scene_path
|
files = instance.data["expectedFiles"]
|
||||||
|
first_file = next(self._iter_expected_files(files))
|
||||||
def _clean_name(path):
|
rgb_bname = os.path.basename(output_beauty)
|
||||||
return os.path.splitext(os.path.basename(path))[0]
|
dir = os.path.dirname(first_file)
|
||||||
|
plugin_data["RenderOutput"] = f"{dir}/{rgb_bname}"
|
||||||
new_scene = _clean_name(filepath)
|
|
||||||
orig_scene = _clean_name(instance.context.data["currentFile"])
|
|
||||||
|
|
||||||
output_beauty = output_beauty.replace(orig_scene, new_scene)
|
|
||||||
output_beauty = output_beauty.replace("\\", "/")
|
|
||||||
plugin_data["RenderOutput"] = output_beauty
|
|
||||||
|
|
||||||
renderer_class = get_current_renderer()
|
renderer_class = get_current_renderer()
|
||||||
renderer = str(renderer_class).split(":")[0]
|
renderer = str(renderer_class).split(":")[0]
|
||||||
|
|
@ -226,14 +221,25 @@ class MaxSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline,
|
||||||
]:
|
]:
|
||||||
render_elem_list = RenderSettings().get_render_element()
|
render_elem_list = RenderSettings().get_render_element()
|
||||||
for i, element in enumerate(render_elem_list):
|
for i, element in enumerate(render_elem_list):
|
||||||
element = element.replace(orig_scene, new_scene)
|
elem_bname = os.path.basename(element)
|
||||||
plugin_data["RenderElementOutputFilename%d" % i] = element # noqa
|
new_elem = f"{dir}/{elem_bname}"
|
||||||
|
plugin_data["RenderElementOutputFilename%d" % i] = new_elem # noqa
|
||||||
|
|
||||||
self.log.debug("plugin data:{}".format(plugin_data))
|
self.log.debug("plugin data:{}".format(plugin_data))
|
||||||
plugin_info.update(plugin_data)
|
plugin_info.update(plugin_data)
|
||||||
|
|
||||||
return job_info, plugin_info
|
return job_info, plugin_info
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _iter_expected_files(exp):
|
||||||
|
if isinstance(exp[0], dict):
|
||||||
|
for _aov, files in exp[0].items():
|
||||||
|
for file in files:
|
||||||
|
yield file
|
||||||
|
else:
|
||||||
|
for file in exp:
|
||||||
|
yield file
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_attribute_defs(cls):
|
def get_attribute_defs(cls):
|
||||||
defs = super(MaxSubmitDeadline, cls).get_attribute_defs()
|
defs = super(MaxSubmitDeadline, cls).get_attribute_defs()
|
||||||
|
|
|
||||||
|
|
@ -348,7 +348,7 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin):
|
||||||
self.log.info("Submitting Deadline job ...")
|
self.log.info("Submitting Deadline job ...")
|
||||||
|
|
||||||
url = "{}/api/jobs".format(self.deadline_url)
|
url = "{}/api/jobs".format(self.deadline_url)
|
||||||
response = requests.post(url, json=payload, timeout=10)
|
response = requests.post(url, json=payload, timeout=10, verify=False)
|
||||||
if not response.ok:
|
if not response.ok:
|
||||||
raise Exception(response.text)
|
raise Exception(response.text)
|
||||||
|
|
||||||
|
|
@ -488,11 +488,15 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin):
|
||||||
if cam:
|
if cam:
|
||||||
if aov:
|
if aov:
|
||||||
subset_name = '{}_{}_{}'.format(group_name, cam, aov)
|
subset_name = '{}_{}_{}'.format(group_name, cam, aov)
|
||||||
|
if aov == "max_beauty":
|
||||||
|
subset_name = '{}_{}'.format(group_name, cam)
|
||||||
else:
|
else:
|
||||||
subset_name = '{}_{}'.format(group_name, cam)
|
subset_name = '{}_{}'.format(group_name, cam)
|
||||||
else:
|
else:
|
||||||
if aov:
|
if aov:
|
||||||
subset_name = '{}_{}'.format(group_name, aov)
|
subset_name = '{}_{}'.format(group_name, aov)
|
||||||
|
if aov == "max_beauty":
|
||||||
|
subset_name = '{}'.format(group_name)
|
||||||
else:
|
else:
|
||||||
subset_name = '{}'.format(group_name)
|
subset_name = '{}'.format(group_name)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue