Hello,
During some tests, I've come to realize that sometimes calling Project.AddRenderJob() can return an empty string.
To reproduce the behavior, you need to have some completed or canceled rendered jobs on the queue, manipulate small timelines with non blocking calls and then try to add them to render queue.
The bug doesn't seem to happen if the render queue is currently empty.
The expected behavior is that Resolve API either blocks until it can generate an UUID string, or either returns None or False since raising Python exceptions isn't currently supported.
I'd advocate for None, since it's the same as is returned when you call the function on an empty project with no timelines.
Had to do some bug hunting because the type was right(str), but it returned an empty string.
The code is the following:
This is a python wrapper I've made, but you get the idea. The timelines are single clip timelines.
I suspect what's happening is there's a bug when generating/checking for UUIDs for the job ids.
Adding a blocking call like this works all the time:
When the bug is observed, while debugging, it needs about 2 or 3 of those while loops before it returns an actual UUID.
Currently on Resovle 17.4.6 Build 4, Windows 10, Python 3.6.8, not using headless
During some tests, I've come to realize that sometimes calling Project.AddRenderJob() can return an empty string.
To reproduce the behavior, you need to have some completed or canceled rendered jobs on the queue, manipulate small timelines with non blocking calls and then try to add them to render queue.
The bug doesn't seem to happen if the render queue is currently empty.
The expected behavior is that Resolve API either blocks until it can generate an UUID string, or either returns None or False since raising Python exceptions isn't currently supported.
I'd advocate for None, since it's the same as is returned when you call the function on an empty project with no timelines.
Had to do some bug hunting because the type was right(str), but it returned an empty string.
The code is the following:
- Code: Select all
for key in clips_res.keys():
res_x, res_y = key.split("x")
res_folder = media_pool.add_subfolder(key, ocf_folder)
clips = clips_res[key]
media_pool.move_clips(clips, res_folder)
media_pool.create_timeline_from_clips(res_folder.name, res_folder.clips)
timeline = project.timeline
timeline.set_setting(
"useCustomSettings", "1"
) # enable custom timeline size != project settings
timeline.set_setting("timelineResolutionWidth", res_x)
timeline.set_setting("timelineResolutionHeight", res_y)
render_settings = {
"FormatWidth": int(int(res_x) / proxyfactor),
"FormatHeight": int(int(res_y) / proxyfactor),
"TargetDir": output_dir,
}
# Set Render Resolution
project.set_render_settings(render_settings)
# print(render_id)
render_id = project.add_renderjob()
render_ids.append(render_id)
return render_ids
This is a python wrapper I've made, but you get the idea. The timelines are single clip timelines.
I suspect what's happening is there's a bug when generating/checking for UUIDs for the job ids.
Adding a blocking call like this works all the time:
- Code: Select all
def add_renderjob(self, block: bool = True) -> str:
job_id = self._obj.AddRenderJob()
if block and job_id == "":
while job_id == "":
job_id = self._obj.AddRenderJob()
return job_id
return job_id
When the bug is observed, while debugging, it needs about 2 or 3 of those while loops before it returns an actual UUID.
Currently on Resovle 17.4.6 Build 4, Windows 10, Python 3.6.8, not using headless
https://vimeo.com/pedrolabonia
----
pydavinci: the python package to help you to script Davinci Resolve!
Check now on github: https://github.com/pedrolabonia/pydavinci
----
pydavinci: the python package to help you to script Davinci Resolve!
Check now on github: https://github.com/pedrolabonia/pydavinci