mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
use query action in fill workfile attribute
This commit is contained in:
parent
af0b97fafe
commit
ac48f50fdf
1 changed files with 6 additions and 5 deletions
|
|
@ -7,6 +7,10 @@ import datetime
|
||||||
|
|
||||||
import ftrack_api
|
import ftrack_api
|
||||||
|
|
||||||
|
from openpype.client import (
|
||||||
|
get_project,
|
||||||
|
get_assets,
|
||||||
|
)
|
||||||
from openpype.api import get_project_settings
|
from openpype.api import get_project_settings
|
||||||
from openpype.lib import (
|
from openpype.lib import (
|
||||||
get_workfile_template_key,
|
get_workfile_template_key,
|
||||||
|
|
@ -14,7 +18,6 @@ from openpype.lib import (
|
||||||
Anatomy,
|
Anatomy,
|
||||||
StringTemplate,
|
StringTemplate,
|
||||||
)
|
)
|
||||||
from openpype.pipeline import AvalonMongoDB
|
|
||||||
from openpype_modules.ftrack.lib import BaseAction, statics_icon
|
from openpype_modules.ftrack.lib import BaseAction, statics_icon
|
||||||
from openpype_modules.ftrack.lib.avalon_sync import create_chunks
|
from openpype_modules.ftrack.lib.avalon_sync import create_chunks
|
||||||
|
|
||||||
|
|
@ -248,10 +251,8 @@ class FillWorkfileAttributeAction(BaseAction):
|
||||||
# Find matchin asset documents and map them by ftrack task entities
|
# Find matchin asset documents and map them by ftrack task entities
|
||||||
# - result stored to 'asset_docs_with_task_entities' is list with
|
# - result stored to 'asset_docs_with_task_entities' is list with
|
||||||
# tuple `(asset document, [task entitis, ...])`
|
# tuple `(asset document, [task entitis, ...])`
|
||||||
dbcon = AvalonMongoDB()
|
|
||||||
dbcon.Session["AVALON_PROJECT"] = project_name
|
|
||||||
# Quety all asset documents
|
# Quety all asset documents
|
||||||
asset_docs = list(dbcon.find({"type": "asset"}))
|
asset_docs = list(get_assets(project_name))
|
||||||
job_entity["data"] = json.dumps({
|
job_entity["data"] = json.dumps({
|
||||||
"description": "(1/3) Asset documents queried."
|
"description": "(1/3) Asset documents queried."
|
||||||
})
|
})
|
||||||
|
|
@ -276,7 +277,7 @@ class FillWorkfileAttributeAction(BaseAction):
|
||||||
# Keep placeholders in the template unfilled
|
# Keep placeholders in the template unfilled
|
||||||
host_name = "{app}"
|
host_name = "{app}"
|
||||||
extension = "{ext}"
|
extension = "{ext}"
|
||||||
project_doc = dbcon.find_one({"type": "project"})
|
project_doc = get_project(project_name)
|
||||||
project_settings = get_project_settings(project_name)
|
project_settings = get_project_settings(project_name)
|
||||||
anatomy = Anatomy(project_name)
|
anatomy = Anatomy(project_name)
|
||||||
templates_by_key = {}
|
templates_by_key = {}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue