diff --git a/client/ayon_core/hosts/celaction/plugins/publish/collect_render_path.py b/client/ayon_core/hosts/celaction/plugins/publish/collect_render_path.py index a7eef0fce4..52bb183663 100644 --- a/client/ayon_core/hosts/celaction/plugins/publish/collect_render_path.py +++ b/client/ayon_core/hosts/celaction/plugins/publish/collect_render_path.py @@ -33,7 +33,7 @@ class CollectRenderPath(pyblish.api.InstancePlugin): m_anatomy_key = self.anatomy_template_key_metadata # get folder and path for rendering images from celaction - r_template_item = anatomy.get_template("publish", r_anatomy_key) + r_template_item = anatomy.get_template_item("publish", r_anatomy_key) render_dir = r_template_item["directory"].format_strict(anatomy_data) render_path = r_template_item["path"].format_strict(anatomy_data) self.log.debug("__ render_path: `{}`".format(render_path)) @@ -50,7 +50,9 @@ class CollectRenderPath(pyblish.api.InstancePlugin): instance.data["path"] = render_path # get anatomy for published renders folder path - m_template_item = anatomy.get_template("publish", m_anatomy_key) + m_template_item = anatomy.get_template_item( + "publish", m_anatomy_key, default=None + ) if m_template_item is not None: metadata_path = m_template_item["directory"].format_strict( anatomy_data diff --git a/client/ayon_core/hosts/hiero/api/lib.py b/client/ayon_core/hosts/hiero/api/lib.py index 666119593a..8e08e8cbf3 100644 --- a/client/ayon_core/hosts/hiero/api/lib.py +++ b/client/ayon_core/hosts/hiero/api/lib.py @@ -632,7 +632,9 @@ def sync_avalon_data_to_workfile(): project_name = get_current_project_name() anatomy = Anatomy(project_name) - work_template = anatomy.get_template("work", "default", "path") + work_template = anatomy.get_template_item( + "work", "default", "path" + ) work_root = anatomy.root_value_for_template(work_template) active_project_root = ( os.path.join(work_root, project_name) @@ -825,7 +827,7 @@ class PublishAction(QtWidgets.QAction): # root_node = hiero.core.nuke.RootNode() # # anatomy = Anatomy(get_current_project_name()) -# work_template = anatomy.get_template("work", "default", "path") +# work_template = anatomy.get_template_item("work", "default", "path") # root_path = anatomy.root_value_for_template(work_template) # # nuke_script.addNode(root_node) diff --git a/client/ayon_core/hosts/maya/plugins/publish/extract_workfile_xgen.py b/client/ayon_core/hosts/maya/plugins/publish/extract_workfile_xgen.py index a0328725ca..d305b8dc6c 100644 --- a/client/ayon_core/hosts/maya/plugins/publish/extract_workfile_xgen.py +++ b/client/ayon_core/hosts/maya/plugins/publish/extract_workfile_xgen.py @@ -129,7 +129,9 @@ class ExtractWorkfileXgen(publish.Extractor): template_data = copy.deepcopy(instance.data["anatomyData"]) anatomy = instance.context.data["anatomy"] - publish_template = anatomy.get_template("publish", "default", "file") + publish_template = anatomy.get_template_item( + "publish", "default", "file" + ) published_maya_path = publish_template.format(template_data) published_basename, _ = os.path.splitext(published_maya_path) diff --git a/client/ayon_core/hosts/maya/plugins/publish/extract_xgen.py b/client/ayon_core/hosts/maya/plugins/publish/extract_xgen.py index eff4dcc881..73668da28d 100644 --- a/client/ayon_core/hosts/maya/plugins/publish/extract_xgen.py +++ b/client/ayon_core/hosts/maya/plugins/publish/extract_xgen.py @@ -40,7 +40,7 @@ class ExtractXgen(publish.Extractor): template_data = copy.deepcopy(instance.data["anatomyData"]) template_data.update({"ext": "xgen"}) anatomy = instance.context.data["anatomy"] - file_template = anatomy.get_template("publish", "default", "file") + file_template = anatomy.get_template_item("publish", "default", "file") xgen_filename = file_template.format(template_data) xgen_path = os.path.join( diff --git a/client/ayon_core/hosts/photoshop/api/launch_logic.py b/client/ayon_core/hosts/photoshop/api/launch_logic.py index 9c6a1e8a01..d0823646d7 100644 --- a/client/ayon_core/hosts/photoshop/api/launch_logic.py +++ b/client/ayon_core/hosts/photoshop/api/launch_logic.py @@ -392,13 +392,13 @@ class PhotoshopRoute(WebSocketRoute): ) data["root"] = anatomy.roots - work_template = anatomy.get_template("work", template_key) + work_template = anatomy.get_template_item("work", template_key) # Define saving file extension extensions = host.get_workfile_extensions() - work_root = str(work_template["directory"].format_strict(data)) - file_template = str(work_template["file"]) + work_root = work_template["directory"].format_strict(data) + file_template = work_template["file"].template last_workfile_path = get_last_workfile( work_root, file_template, data, extensions, True ) diff --git a/client/ayon_core/hosts/tvpaint/plugins/load/load_workfile.py b/client/ayon_core/hosts/tvpaint/plugins/load/load_workfile.py index 0b6d67a840..203610288f 100644 --- a/client/ayon_core/hosts/tvpaint/plugins/load/load_workfile.py +++ b/client/ayon_core/hosts/tvpaint/plugins/load/load_workfile.py @@ -80,7 +80,7 @@ class LoadWorkfile(plugin.Loader): ) data["root"] = anatomy.roots - work_template = anatomy.get_template("work", template_key) + work_template = anatomy.get_template_item("work", template_key) # Define saving file extension extensions = host.get_workfile_extensions() @@ -93,9 +93,9 @@ class LoadWorkfile(plugin.Loader): data["ext"] = extension.lstrip(".") - work_root = str(work_template["directory"].format_strict(data)) + work_root = work_template["directory"].format_strict(data) version = get_last_workfile_with_version( - work_root, str(work_template["file"]), data, extensions + work_root, work_template["file"].template, data, extensions )[1] if version is None: diff --git a/client/ayon_core/hosts/unreal/hooks/pre_workfile_preparation.py b/client/ayon_core/hosts/unreal/hooks/pre_workfile_preparation.py index 040beccb5e..54ffba3a63 100644 --- a/client/ayon_core/hosts/unreal/hooks/pre_workfile_preparation.py +++ b/client/ayon_core/hosts/unreal/hooks/pre_workfile_preparation.py @@ -66,7 +66,7 @@ class UnrealPrelaunchHook(PreLaunchHook): self.host_name, ) # Fill templates - template_obj = anatomy.get_template( + template_obj = anatomy.get_template_item( "work", workfile_template_key, "file" ) diff --git a/client/ayon_core/lib/applications.py b/client/ayon_core/lib/applications.py index 123396f5f6..58f910ce31 100644 --- a/client/ayon_core/lib/applications.py +++ b/client/ayon_core/lib/applications.py @@ -1862,9 +1862,9 @@ def _prepare_last_workfile(data, workdir, addons_manager): project_settings=project_settings ) # Find last workfile - file_template = str( - anatomy.get_template("work", template_key, "file") - ) + file_template = anatomy.get_template_item( + "work", template_key, "file" + ).template workdir_data.update({ "version": 1, diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_celaction_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_celaction_deadline.py index e11b74ae81..1fae23c9b2 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_celaction_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_celaction_deadline.py @@ -75,7 +75,9 @@ class CelactionSubmitDeadline(pyblish.api.InstancePlugin): script_name = os.path.basename(script_path) anatomy = instance.context.data["anatomy"] - publish_template = anatomy.get_template("publish", "default", "path") + publish_template = anatomy.get_template_item( + "publish", "default", "path" + ) for item in instance.context: if "workfile" in item.data["productType"]: msg = "Workfile (scene) must be published along" diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_fusion_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_fusion_deadline.py index f99a7c6ba3..cf124c0bcc 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_fusion_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_fusion_deadline.py @@ -124,7 +124,9 @@ class FusionSubmitDeadline( script_path = context.data["currentFile"] anatomy = instance.context.data["anatomy"] - publish_template = anatomy.get_template("publish", "default", "path") + publish_template = anatomy.get_template_item( + "publish", "default", "path" + ) for item in context: if "workfile" in item.data["families"]: msg = "Workfile (scene) must be published along" diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_nuke_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_nuke_deadline.py index 193cad1d24..ac01af901c 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_nuke_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_nuke_deadline.py @@ -198,7 +198,9 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin, AbstractSubmitDeadline""" anatomy = context.data["anatomy"] # WARNING Hardcoded template name 'default' > may not be used - publish_template = anatomy.get_template("publish", "default", "path") + publish_template = anatomy.get_template_item( + "publish", "default", "path" + ) for instance in context: if ( instance.data["productType"] != "workfile" diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_cache_job.py b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_cache_job.py index dbc5a12fa8..50bd414587 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_cache_job.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_cache_job.py @@ -450,7 +450,7 @@ class ProcessSubmittedCacheJobOnFarm(pyblish.api.InstancePlugin, "type": product_type, } - render_dir_template = anatomy.get_template( + render_dir_template = anatomy.get_template_item( "publish", template_name, "directory" ) return render_dir_template.format_strict(template_data) diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py index ce1c75e2ee..84bac6d017 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py @@ -573,7 +573,7 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin, "type": product_type, } - render_dir_template = anatomy.get_template( + render_dir_template = anatomy.get_template_item( "publish", template_name, "directory" ) return render_dir_template.format_strict(template_data) diff --git a/client/ayon_core/pipeline/context_tools.py b/client/ayon_core/pipeline/context_tools.py index bf21b43e0b..84a17be8f2 100644 --- a/client/ayon_core/pipeline/context_tools.py +++ b/client/ayon_core/pipeline/context_tools.py @@ -545,7 +545,7 @@ def get_workdir_from_session(session=None, template_key=None): ) anatomy = Anatomy(project_name) - template_obj = anatomy.get_template("work", template_key, "directory") + template_obj = anatomy.get_template_item("work", template_key, "directory") path = template_obj.format_strict(template_data) if path: path = os.path.normpath(path) diff --git a/client/ayon_core/pipeline/delivery.py b/client/ayon_core/pipeline/delivery.py index 666909ef8d..029775e1db 100644 --- a/client/ayon_core/pipeline/delivery.py +++ b/client/ayon_core/pipeline/delivery.py @@ -77,7 +77,9 @@ def check_destination_path( """ anatomy_data.update(datetime_data) - path_template = anatomy.get_template("delivery", template_name, "path") + path_template = anatomy.get_template_item( + "delivery", template_name, "path" + ) dest_path = path_template.format(anatomy_data) report_items = collections.defaultdict(list) @@ -150,7 +152,9 @@ def deliver_single_file( if format_dict: anatomy_data = copy.deepcopy(anatomy_data) anatomy_data["root"] = format_dict["root"] - template_obj = anatomy.get_template("delivery", template_name, "path") + template_obj = anatomy.get_template_item( + "delivery", template_name, "path" + ) delivery_path = template_obj.format_strict(anatomy_data) # Backwards compatibility when extension contained `.` @@ -220,8 +224,8 @@ def deliver_sequence( report_items["Source file was not found"].append(msg) return report_items, 0 - delivery_template = anatomy.get_template( - "delivery", template_name, "path" + delivery_template = anatomy.get_template_item( + "delivery", template_name, "path", default=None ) if delivery_template is None: msg = ( @@ -233,7 +237,7 @@ def deliver_sequence( # Check if 'frame' key is available in template which is required # for sequence delivery - if "{frame" not in delivery_template: + if "{frame" not in delivery_template.template: msg = ( "Delivery template \"{}\" in anatomy of project \"{}\"" "does not contain '{{frame}}' key to fill. Delivery of sequence" @@ -278,8 +282,7 @@ def deliver_sequence( anatomy_data["frame"] = frame_indicator if format_dict: anatomy_data["root"] = format_dict["root"] - template_obj = anatomy.get_template("delivery", template_name, "path") - delivery_path = template_obj.format_strict(anatomy_data) + delivery_path = delivery_template.format_strict(anatomy_data) delivery_path = os.path.normpath(delivery_path.replace("\\", "/")) delivery_folder = os.path.dirname(delivery_path) diff --git a/client/ayon_core/pipeline/farm/tools.py b/client/ayon_core/pipeline/farm/tools.py index 1ed7e4b3f5..0b647340f3 100644 --- a/client/ayon_core/pipeline/farm/tools.py +++ b/client/ayon_core/pipeline/farm/tools.py @@ -54,7 +54,7 @@ def from_published_scene(instance, replace_in_path=True): template_data["comment"] = None anatomy = instance.context.data['anatomy'] - template_obj = anatomy.get_template("publish", "default", "path") + template_obj = anatomy.get_template_item("publish", "default", "path") template_filled = template_obj.format_strict(template_data) file_path = os.path.normpath(template_filled) diff --git a/client/ayon_core/pipeline/publish/lib.py b/client/ayon_core/pipeline/publish/lib.py index 8d2ae85694..8d3644637b 100644 --- a/client/ayon_core/pipeline/publish/lib.py +++ b/client/ayon_core/pipeline/publish/lib.py @@ -743,8 +743,8 @@ def get_custom_staging_dir_info( template_name = profile["template_name"] or TRANSIENT_DIR_TEMPLATE - custom_staging_dir = anatomy.get_template( - "staging", template_name, "directory" + custom_staging_dir = anatomy.get_template_item( + "staging", template_name, "directory", default=None ) if custom_staging_dir is None: raise ValueError(( @@ -753,7 +753,7 @@ def get_custom_staging_dir_info( ).format(project_name, template_name)) is_persistent = profile["custom_staging_dir_persistent"] - return str(custom_staging_dir), is_persistent + return custom_staging_dir.template, is_persistent def get_published_workfile_instance(context): @@ -805,7 +805,7 @@ def replace_with_published_scene_path(instance, replace_in_path=True): template_data["comment"] = None anatomy = instance.context.data["anatomy"] - template = anatomy.get_template("publish", "default", "path") + template = anatomy.get_template_item("publish", "default", "path") template_filled = template.format_strict(template_data) file_path = os.path.normpath(template_filled) diff --git a/client/ayon_core/pipeline/usdlib.py b/client/ayon_core/pipeline/usdlib.py index 9fabd1dce5..1c7943441e 100644 --- a/client/ayon_core/pipeline/usdlib.py +++ b/client/ayon_core/pipeline/usdlib.py @@ -341,8 +341,8 @@ def get_usd_master_path(folder_entity, product_name, representation): "version": 0, # stub version zero }) - template_obj = anatomy.get_template( - "publish", "default","path" + template_obj = anatomy.get_template_item( + "publish", "default", "path" ) path = template_obj.format_strict(template_data) diff --git a/client/ayon_core/pipeline/workfile/path_resolving.py b/client/ayon_core/pipeline/workfile/path_resolving.py index 239b8c1096..47d6f4ddfa 100644 --- a/client/ayon_core/pipeline/workfile/path_resolving.py +++ b/client/ayon_core/pipeline/workfile/path_resolving.py @@ -135,7 +135,9 @@ def get_workdir_with_workdir_data( project_settings ) - template_obj = anatomy.get_template("work", template_key, "directory") + template_obj = anatomy.get_template_item( + "work", template_key, "directory" + ) # Output is TemplateResult object which contain useful data output = template_obj.format_strict(workdir_data) if output: diff --git a/client/ayon_core/plugins/actions/open_file_explorer.py b/client/ayon_core/plugins/actions/open_file_explorer.py index 9369a25eb0..69375a7859 100644 --- a/client/ayon_core/plugins/actions/open_file_explorer.py +++ b/client/ayon_core/plugins/actions/open_file_explorer.py @@ -70,7 +70,7 @@ class OpenTaskPath(LauncherAction): data = get_template_data(project_entity, folder_entity, task_entity) anatomy = Anatomy(project_name) - workdir = anatomy.get_template( + workdir = anatomy.get_template_item( "work", "default", "folder" ).format(data) @@ -87,7 +87,7 @@ class OpenTaskPath(LauncherAction): return valid_workdir data.pop("task", None) - workdir = anatomy.get_template( + workdir = anatomy.get_template_item( "work", "default", "folder" ).format(data) valid_workdir = self._find_first_filled_path(workdir) diff --git a/client/ayon_core/plugins/publish/collect_otio_subset_resources.py b/client/ayon_core/plugins/publish/collect_otio_subset_resources.py index ad3a4d2c23..37a5e87a7a 100644 --- a/client/ayon_core/plugins/publish/collect_otio_subset_resources.py +++ b/client/ayon_core/plugins/publish/collect_otio_subset_resources.py @@ -43,9 +43,9 @@ class CollectOtioSubsetResources(pyblish.api.InstancePlugin): template_name = self.get_template_name(instance) anatomy = instance.context.data["anatomy"] - publish_path_template = anatomy.get_template( + publish_path_template = anatomy.get_template_item( "publish", template_name, "path" - ) + ).template template = os.path.normpath(publish_path_template) self.log.debug( ">> template: {}".format(template)) diff --git a/client/ayon_core/plugins/publish/collect_resources_path.py b/client/ayon_core/plugins/publish/collect_resources_path.py index 05015909d5..959523918e 100644 --- a/client/ayon_core/plugins/publish/collect_resources_path.py +++ b/client/ayon_core/plugins/publish/collect_resources_path.py @@ -79,7 +79,7 @@ class CollectResourcesPath(pyblish.api.InstancePlugin): "representation": "TEMP" }) - publish_templates = anatomy.get_template( + publish_templates = anatomy.get_template_item( "publish", "default", "directory" ) publish_folder = os.path.normpath( diff --git a/client/ayon_core/plugins/publish/integrate.py b/client/ayon_core/plugins/publish/integrate.py index 16c8ebaaf5..ce34f2e88b 100644 --- a/client/ayon_core/plugins/publish/integrate.py +++ b/client/ayon_core/plugins/publish/integrate.py @@ -665,9 +665,9 @@ class IntegrateAsset(pyblish.api.InstancePlugin): self.log.debug("Anatomy template name: {}".format(template_name)) anatomy = instance.context.data["anatomy"] - publish_template = anatomy.get_template("publish", template_name) + publish_template = anatomy.get_template_item("publish", template_name) path_template_obj = publish_template["path"] - template = os.path.normpath(path_template_obj) + template = path_template_obj.template.replace("\\", "/") is_udim = bool(repre.get("udim")) diff --git a/client/ayon_core/plugins/publish/integrate_hero_version.py b/client/ayon_core/plugins/publish/integrate_hero_version.py index e313c94393..c352e67f89 100644 --- a/client/ayon_core/plugins/publish/integrate_hero_version.py +++ b/client/ayon_core/plugins/publish/integrate_hero_version.py @@ -103,7 +103,9 @@ class IntegrateHeroVersion(pyblish.api.InstancePlugin): project_name = anatomy.project_name template_key = self._get_template_key(project_name, instance) - hero_template = anatomy.get_template("hero", template_key, "path") + hero_template = anatomy.get_template_item( + "hero", template_key, "path", default=None + ) if hero_template is None: self.log.warning(( @@ -320,7 +322,7 @@ class IntegrateHeroVersion(pyblish.api.InstancePlugin): try: src_to_dst_file_paths = [] repre_integrate_data = [] - path_template_obj = anatomy.get_template( + path_template_obj = anatomy.get_template_item( "hero", template_key, "path" ) for repre_info in published_repres.values(): @@ -335,7 +337,9 @@ class IntegrateHeroVersion(pyblish.api.InstancePlugin): anatomy_data.pop("version", None) # Get filled path to repre context - template_filled = path_template_obj.format_strict(anatomy_data) + template_filled = path_template_obj.format_strict( + anatomy_data + ) repre_context = template_filled.used_values for key in self.db_representation_context_keys: value = anatomy_data.get(key) @@ -538,7 +542,7 @@ class IntegrateHeroVersion(pyblish.api.InstancePlugin): "originalBasename": instance.data.get("originalBasename") }) - template_obj = anatomy.get_template( + template_obj = anatomy.get_template_item( "hero", template_key, "directory" ) publish_folder = os.path.normpath( diff --git a/client/ayon_core/tools/push_to_project/models/integrate.py b/client/ayon_core/tools/push_to_project/models/integrate.py index 0987dc0c56..6e43050c05 100644 --- a/client/ayon_core/tools/push_to_project/models/integrate.py +++ b/client/ayon_core/tools/push_to_project/models/integrate.py @@ -973,8 +973,8 @@ class ProjectPushItemProcess: "version": version_entity["version"] }) - publish_template = anatomy.get_template("publish", template_name) - path_template = publish_template["path"].replace("\\", "/") + publish_template = anatomy.get_template_item("publish", template_name) + path_template = publish_template["path"].template.replace("\\", "/") file_template = publish_template["file"] self._log_info("Preparing files to transfer") processed_repre_items = self._prepare_file_transactions( @@ -1011,7 +1011,7 @@ class ProjectPushItemProcess: if repre_output_name is not None: repre_format_data["output"] = repre_output_name - template_obj = anatomy.get_template( + template_obj = anatomy.get_template_item( "publish", template_name, "directory" ) folder_path = template_obj.format_strict(formatting_data) diff --git a/client/ayon_core/tools/texture_copy/app.py b/client/ayon_core/tools/texture_copy/app.py index 9a94ba44f7..c288187aac 100644 --- a/client/ayon_core/tools/texture_copy/app.py +++ b/client/ayon_core/tools/texture_copy/app.py @@ -40,7 +40,7 @@ class TextureCopy: }, }) anatomy = Anatomy(project_name, project_entity=project_entity) - template_obj = anatomy.get_template( + template_obj = anatomy.get_template_item( "publish", "texture", "path" ) return template_obj.format_strict(template_data) diff --git a/client/ayon_core/tools/workfiles/models/workfiles.py b/client/ayon_core/tools/workfiles/models/workfiles.py index ef502e3d6f..479c8ea849 100644 --- a/client/ayon_core/tools/workfiles/models/workfiles.py +++ b/client/ayon_core/tools/workfiles/models/workfiles.py @@ -253,7 +253,7 @@ class WorkareaModel: return list(comment_hints), current_comment def _get_workdir(self, anatomy, template_key, fill_data): - directory_template = anatomy.get_template( + directory_template = anatomy.get_template_item( "work", template_key, "directory" ) return directory_template.format_strict(fill_data).normalized() @@ -300,9 +300,12 @@ class WorkareaModel: workdir = self._get_workdir(anatomy, template_key, fill_data) - file_template = str( - anatomy.get_template("work", template_key, "file") - ) + file_template = anatomy.get_template_item( + "work", template_key, "file" + ).template + + template_has_version = "{version" in file_template + template_has_comment = "{comment" in file_template comment_hints, comment = self._get_comments_from_root( file_template, @@ -313,9 +316,6 @@ class WorkareaModel: ) last_version = self._get_last_workfile_version( workdir, file_template, fill_data, extensions) - str_file_template = str(file_template) - template_has_version = "{version" in str_file_template - template_has_comment = "{comment" in str_file_template return { "template_key": template_key, @@ -344,7 +344,9 @@ class WorkareaModel: workdir = self._get_workdir(anatomy, template_key, fill_data) - file_template = anatomy.get_template("work", template_key, "file") + file_template = anatomy.get_template_item( + "work", template_key, "file" + ).template if use_last_version: version = self._get_last_workfile_version(