Skip to content

Commit

Permalink
Change master_task to main_task
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementHector committed Feb 7, 2022
1 parent c5bf5e1 commit 21fc3b2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions openpype/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
get_workdir_data,
get_workdir,
get_workdir_with_workdir_data,
get_master_task,
get_main_task,

create_workfile_doc,
save_workfile_data_to_doc,
Expand Down Expand Up @@ -229,7 +229,7 @@
"get_workdir_data",
"get_workdir",
"get_workdir_with_workdir_data",
"get_master_task",
"get_main_task",

"create_workfile_doc",
"save_workfile_data_to_doc",
Expand Down
24 changes: 12 additions & 12 deletions openpype/lib/avalon_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,27 +375,27 @@ def get_latest_version(asset_name, subset_name, dbcon=None, project_name=None):
return version_doc


def get_master_task(asset_doc, task_name):
"""Retrieve master_task from avalon asset requested task
def get_main_task(asset_doc, task_name):
"""Retrieve main_task from avalon asset requested task
Return the master task if there is one, return the task otherwise.
Return the main task if there is one, return the task otherwise.
Args:
asset_id (int): Id of asset under which the task belongs.
task_name (str): Name of task to retrieve master_task from.
task_name (str): Name of task to retrieve main_task from.
Returns:
str: master task name if there is one, task name otherwise.
str: main task name if there is one, task name otherwise.
"""

if asset_doc:
master_task = (
main_task = (
asset_doc.get("data", {})
.get("tasks", {})
.get(task_name, {})
.get("master_task", None)
.get("main_task", None)
)
if master_task:
return master_task
if main_task:
return main_task
return task_name


Expand Down Expand Up @@ -544,9 +544,9 @@ def get_workdir_data(project_doc, asset_doc, task_name, host_name):
if asset_parents:
parent_name = asset_parents[-1]

master_task = get_master_task(asset_doc, task_name)
if master_task:
task_name = master_task
main_task = get_main_task(asset_doc, task_name)
if main_task:
task_name = main_task

data = {
"project": {
Expand Down
4 changes: 2 additions & 2 deletions openpype/tools/workfiles/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from openpype.tools.utils.delegates import PrettyTimeDelegate
from openpype.lib import (
Anatomy,
get_master_task,
get_main_task,
get_workdir,
get_workfile_doc,
create_workfile_doc,
Expand Down Expand Up @@ -464,7 +464,7 @@ def set_asset_task(self, asset_id, task_name, task_type):
{"type": "asset", "_id": asset_id},
{"data": True}
)
self._task_name = get_master_task(asset_doc, task_name)
self._task_name = get_main_task(asset_doc, task_name)
self._task_type = task_type

# Define a custom session so we can query the work root
Expand Down

0 comments on commit 21fc3b2

Please sign in to comment.