mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
remove unnecessary function
This commit is contained in:
parent
c5bf50a454
commit
aef56b7cd3
2 changed files with 5 additions and 33 deletions
|
|
@ -3425,32 +3425,6 @@ def create_viewer_profile_string(viewer, display=None, path_like=False):
|
|||
return "{} ({})".format(viewer, display)
|
||||
|
||||
|
||||
def prepend_name_before_hashed_frame(original_path, name):
|
||||
"""Function to prepend an extra name before the hashed frame numbers
|
||||
|
||||
Examples:
|
||||
>>> prepend_name_before_hashed_frame("render.####.exr", "baking")
|
||||
render.baking.####.exr
|
||||
>>> prepend_name_before_hashed_frame("render.%04d.exr", "tag")
|
||||
render.tag.%d.exr
|
||||
>>> prepend_name_before_hashed_frame("exr.####.exr", "foo")
|
||||
exr.foo.%04d.exr
|
||||
|
||||
Args:
|
||||
original_path (str): the filename with frame hashes
|
||||
name (str): the name of the tags
|
||||
|
||||
Returns:
|
||||
str: the renamed filename with the tag
|
||||
"""
|
||||
filename = os.path.basename(original_path)
|
||||
|
||||
def insert_name(matchobj):
|
||||
return "{}.{}".format(name, matchobj.group(0))
|
||||
|
||||
return re.sub(r"(%\d*d)|#+", insert_name, filename)
|
||||
|
||||
|
||||
def get_filenames_without_hash(filename, frame_start, frame_end):
|
||||
"""Get filenames without frame hash
|
||||
i.e. "renderCompositingMain.baking.0001.exr"
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ from .lib import (
|
|||
get_view_process_node,
|
||||
get_viewer_config_from_string,
|
||||
deprecated,
|
||||
prepend_name_before_hashed_frame,
|
||||
get_filenames_without_hash
|
||||
)
|
||||
from .pipeline import (
|
||||
|
|
@ -818,15 +817,14 @@ class ExporterReviewMov(ExporterReview):
|
|||
|
||||
self.file = self.fhead + self.name + ".{}".format(self.ext)
|
||||
if ".{}".format(self.ext) not in VIDEO_EXTENSIONS:
|
||||
# filename would be with frame hashes if
|
||||
# the file extension is not in video format
|
||||
filename = prepend_name_before_hashed_frame(
|
||||
self.path_in, self.name)
|
||||
self.file = filename
|
||||
filename = os.path.basename(self.path_in)
|
||||
self.file = self.fhead + self.name + ".{}".format(
|
||||
filename.split(".", 1)[-1]
|
||||
)
|
||||
# make sure the filename are in
|
||||
# correct image output format
|
||||
if not self.file.endswith(".{}".format(ext)):
|
||||
filename_no_ext, _ = os.path.splitext(filename)
|
||||
filename_no_ext, _ = os.path.splitext(self.file)
|
||||
self.file = "{}.{}".format(filename_no_ext, self.ext)
|
||||
|
||||
self.path = os.path.join(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue