global: allowing build workfile from workfile options schema

This commit is contained in:
Jakub Jezek 2021-05-26 18:31:35 +02:00
parent 5c4446ef0c
commit 97ef333354
No known key found for this signature in database
GPG key ID: D8548FBF690B100A

View file

@ -756,11 +756,22 @@ class BuildWorkfile:
host_name = avalon.api.registered_host().__name__.rsplit(".", 1)[-1]
presets = get_project_settings(avalon.io.Session["AVALON_PROJECT"])
# Get presets for host
build_presets = (
presets.get(host_name, {})
.get("workfile_build")
.get("profiles")
)
# for backward compatibility this has to have exception
# if the concept will be agreed then this needs to be
# refactored without exception
if "nuke" in host_name:
build_presets = (
presets.get(host_name, {})
.get("workfile_options")
.get("builder_profiles")
)
else:
build_presets = (
presets.get(host_name, {})
.get("workfile_build")
.get("profiles")
)
if not build_presets:
return