-
Notifications
You must be signed in to change notification settings - Fork 129
General: Move change context functions #2839
General: Move change context functions #2839
Conversation
Task linked: OP-2844 Move change context functions |
def _get_work_folder(session): | ||
"""Convenience function to get the work folder path of the current asset""" | ||
|
||
# Get new filename, create path based on asset and work template | ||
template_work = self._project["config"]["template"]["work"] | ||
work_path = pipeline._format_work_template(template_work, session) | ||
|
||
return os.path.normpath(work_path) | ||
return get_workdir_from_session(session) |
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.
Should we remove the _get_work_folder
function and refactor other code to just use get_workdir_from_session
directly?
Especially since it's now just a single function call. I'd argue the same for the removal of _get_context_directory
in switch_ui.py
There's also _get_work_folder()
in another file that we could remove here.
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.
Done. I actually wasn't sure if the script is even used?
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.
Yes, it's old - probably unused in OpenPype - and it's been a while since we have used it too. We could consider it code debt for a future separate PR and discuss a more thorough cleanup.
Separate from this PR we should look into what's up with this code. That appears extremely connected to Maya only - and it seems to be part of a feature that I personally was unaware of. Is that used? Should that be removed/cleaned? |
It is extremely connected to maya and ftrack. I think it wasn't used for 3 years. Should be removed, but not in this PR. |
The whole tools should be removed and eventually re-written, this was an urgent production requirement a few years back when OP was used only in a handful of places. I'd leave it for a separate PR though |
Brief description
Context change related functions moved from avalon into openpype.
Description
These functions recalculate session changes and change of workdir used primarily in workfiles tool.
Changes
openpype/lib/avalon_context.py
- at this moment there is not a better placeTesting notes: