Skip to content

Commit

Permalink
Fix: Locally copied version of last published workfile is not increme…
Browse files Browse the repository at this point in the history
…nted
  • Loading branch information
Tilix4 committed Nov 16, 2022
1 parent b2e0cd8 commit 5457580
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion openpype/hooks/pre_copy_last_published_workfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
)
from openpype.lib import PreLaunchHook
from openpype.lib.local_settings import get_local_site_id
from openpype.lib.path_tools import version_up
from openpype.lib.profiles_filtering import filter_profiles
from openpype.pipeline.load.utils import get_representation_path
from openpype.settings.lib import get_project_settings
Expand All @@ -31,6 +32,7 @@ def execute(self):
2- Check if workfile in work area doesn't exist
3- Check if published workfile exists and is copied locally in publish
4- Substitute copied published workfile as first workfile
with incremented version by +1
Returns:
None: This is a void method.
Expand Down Expand Up @@ -173,5 +175,9 @@ def execute(self):

# Copy file and substitute path
self.data["last_workfile_path"] = shutil.copy(
published_workfile_path, local_workfile_dir
published_workfile_path,
os.path.join(
local_workfile_dir,
os.path.basename(version_up(published_workfile_path)),
),
)

0 comments on commit 5457580

Please sign in to comment.