mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Use StringTemplate to allow for optional template keys
This commit is contained in:
parent
079f7a935a
commit
e769a76ac3
1 changed files with 3 additions and 4 deletions
|
|
@ -30,6 +30,7 @@ from openpype.lib import (
|
||||||
env_value_to_bool,
|
env_value_to_bool,
|
||||||
Logger,
|
Logger,
|
||||||
get_version_from_path,
|
get_version_from_path,
|
||||||
|
StringTemplate,
|
||||||
)
|
)
|
||||||
|
|
||||||
from openpype.settings import (
|
from openpype.settings import (
|
||||||
|
|
@ -1300,10 +1301,8 @@ def create_write_node(
|
||||||
|
|
||||||
# build file path to workfiles
|
# build file path to workfiles
|
||||||
fdir = str(anatomy_filled["work"]["folder"]).replace("\\", "/")
|
fdir = str(anatomy_filled["work"]["folder"]).replace("\\", "/")
|
||||||
fpath = data["fpath_template"].format(
|
data["work"] = fdir
|
||||||
work=fdir,
|
fpath = StringTemplate(data["fpath_template"]).format_strict(data)
|
||||||
**data,
|
|
||||||
)
|
|
||||||
|
|
||||||
# create directory
|
# create directory
|
||||||
if not os.path.isdir(os.path.dirname(fpath)):
|
if not os.path.isdir(os.path.dirname(fpath)):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue