Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
use context to get shotgrid project id
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementHector committed Jun 20, 2022
1 parent ad0aea0 commit 50ec61f
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ def process(self, context):
self.log.info(avalon_project)
self.log.info(avalon_asset)

sg_project = _get_shotgrid_project(avalon_project)
sg_project = _get_shotgrid_project(context)
sg_task = _get_shotgrid_task(
avalon_project, avalon_asset, avalon_task_name
avalon_project,
avalon_asset,
avalon_task_name
)
sg_entity = _get_shotgrid_entity(avalon_project, avalon_asset)

Expand Down Expand Up @@ -67,9 +69,9 @@ def _get_shotgrid_collection(project):
return client.get_database("shotgrid_openpype").get_collection(project)


def _get_shotgrid_project(avalon_project):
proj_settings = get_shotgrid_project_settings(avalon_project["name"])
shotgrid_project_id = proj_settings.get("shotgrid_project_id")
def _get_shotgrid_project(context):
shotgrid_project_id = context.data["project_settings"].get(
"shotgrid_project_id")
if shotgrid_project_id:
return {"type": "Project", "id": shotgrid_project_id}
return {}
Expand Down

0 comments on commit 50ec61f

Please sign in to comment.