-
Notifications
You must be signed in to change notification settings - Fork 129
Fix: Locally copied version of last published workfile is not incremented #4722
Conversation
* Enhancement: copy last published workfile as reusable methods (WiP) * Added get_host_extensions method, added subset_id and las_version_doc access, added optional arguments to get_last_published_workfile * Plugged in the new methods + minor changes * Added docstrings, last workfile optional argument, and removed unused code * Using new implementation to get local workfile path. Warning: It adds an extra dot to the extension which I need to fix * Refactoring and fixed double dots * Added match subset_id and get representation method, plus clan up * Removed unused vars * Fixed some rebasing errors * delinted unchanged code and renamed get_representation into get_representation_with_task * This time it's really delinted, I hope... * Update openpype/modules/sync_server/sync_server.py reprenation isn't the right spelling (: Co-authored-by: Félix David <felixg.david@gmail.com> * Changes based on reviews * Fixed non imperative docstring and missing space * Fixed another non imperative docstring * Update openpype/modules/sync_server/sync_server.py Fixed typo Co-authored-by: Félix David <felixg.david@gmail.com> Co-authored-by: Hayley GUILLOT <hayleyguillot@outlook.com> Co-authored-by: Félix David <felixg.david@gmail.com>
* Fix: Local workfile overwrite when local version number is higher than published workfile version number (WiP) * Changed regex search, clean up * Readded mistakenly removed newline
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, only one suggestion for markdown doc.
Logic should be in pre hook
The prelaunch hook does not handle cases when there are no profiles in settings, or when |
Found a bug: If you delete all versions of a workfile subset for an asset and try to launch it after, it tries to find the last published workfile (which has been deleted) and hangs forever. It should not try to fetch it and open a new empty file. |
openpype/modules/sync_server/launch_hooks/pre_copy_last_published_workfile.py
Show resolved
Hide resolved
Fixed issue with no profiles returned. |
How should I replicate that? I tried to open DCC on new empty task, works. |
How did you delete it? Did you use the loader action from the standalone loader? (OP tray > Loader) Because maybe @Tilix4 did use that which I believe 'archives' certain publishes instead of actually removing them from the database? |
Indeed that's what I did. That was my guess too. |
Yeah, I used Delete version action in Loader. |
The |
openpype/modules/sync_server/launch_hooks/pre_copy_last_published_workfile.py
Outdated
Show resolved
Hide resolved
openpype/modules/sync_server/launch_hooks/pre_copy_last_published_workfile.py
Outdated
Show resolved
Hide resolved
openpype/modules/sync_server/launch_hooks/pre_copy_last_published_workfile.py
Show resolved
Hide resolved
openpype/modules/sync_server/launch_hooks/pre_copy_last_published_workfile.py
Show resolved
Hide resolved
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
Fix 1
When copied, the local workfile version keeps the published version number, when it must be +1 to follow OP's naming convention.
Fix 2
Local workfile version's name is built from anatomy. This avoids to get workfiles with their publish template naming.
Fix 3
In the case a subset has at least two tasks with published workfiles, for example
Modeling
andRigging
, launchingRigging
was getting the first one with thenext
and trying to find representations, thereforeworkfileModeling
and trying to match the currenttask_name
(Rigging
) with therepresentation["context"]["task"]["name"]
of a Modeling representation, which was ending up to aworkfile_representation
toNone
, and exiting the process.Trying to find the
task_name
in thesubset['name']
fixes it.Fix 4
Fetch input dependencies of workfile.
Replacing #4102 for changes to bring this home.