OP-4361 - streamline local render

Do not do get render queue again, should be already collected.
This commit is contained in:
Petr Kalis 2022-11-11 12:20:19 +01:00
parent 104fc1fd83
commit 5f302eb95c

View file

@ -21,30 +21,32 @@ class ExtractLocalRender(publish.Extractor):
def process(self, instance):
stub = get_stub()
staging_dir = instance.data["stagingDir"]
self.log.info("staging_dir::{}".format(staging_dir))
self.log.debug("staging_dir::{}".format(staging_dir))
# pull file name from Render Queue Output module
comp_id = instance.data['comp_id']
render_q = stub.get_render_info(comp_id) # re queue render item
if not render_q:
# pull file name collected value from Render Queue Output module
if not instance.data["file_name"]:
raise ValueError("No file extension set in Render Queue")
comp_id = instance.data['comp_id']
stub.render(staging_dir, comp_id)
_, ext = os.path.splitext(os.path.basename(render_q.file_name))
_, ext = os.path.splitext(os.path.basename(instance.data["file_name"]))
ext = ext[1:]
first_file_path = None
files = []
for file_name in os.listdir(staging_dir):
if not file_name.endswith(ext):
continue
files.append(file_name)
if first_file_path is None:
first_file_path = os.path.join(staging_dir,
file_name)
self.log.debug("files::{}".format(os.listdir(staging_dir)))
if not files:
raise ValueError("Nothing rendered!")
self.log.info("no files")
return
resulting_files = files
if len(files) == 1: