modified anatomy imports in lib itself

This commit is contained in:
Jakub Trllo 2022-06-30 17:56:54 +02:00
parent 728bfd6571
commit 3bf3c0bab4
3 changed files with 11 additions and 7 deletions

View file

@ -20,10 +20,7 @@ from openpype.settings.constants import (
METADATA_KEYS,
M_DYNAMIC_KEY_LABEL
)
from . import (
PypeLogger,
Anatomy
)
from . import PypeLogger
from .profiles_filtering import filter_profiles
from .local_settings import get_openpype_username
from .avalon_context import (
@ -1305,7 +1302,7 @@ def get_app_environments_for_context(
dict: Environments for passed context and application.
"""
from openpype.pipeline import AvalonMongoDB
from openpype.pipeline import AvalonMongoDB, Anatomy
# Avalon database connection
dbcon = AvalonMongoDB()

View file

@ -14,7 +14,6 @@ from openpype.settings import (
get_project_settings,
get_system_settings
)
from .anatomy import Anatomy
from .profiles_filtering import filter_profiles
from .events import emit_event
from .path_templates import StringTemplate
@ -593,6 +592,7 @@ def get_workdir_with_workdir_data(
))
if not anatomy:
from openpype.pipeline import Anatomy
anatomy = Anatomy(project_name)
if not template_key:
@ -638,6 +638,7 @@ def get_workdir(
TemplateResult: Workdir path.
"""
if not anatomy:
from openpype.pipeline import Anatomy
anatomy = Anatomy(project_doc["name"])
workdir_data = get_workdir_data(
@ -750,6 +751,8 @@ def compute_session_changes(
@with_pipeline_io
def get_workdir_from_session(session=None, template_key=None):
from openpype.pipeline import Anatomy
if session is None:
session = legacy_io.Session
project_name = session["AVALON_PROJECT"]
@ -856,6 +859,8 @@ def create_workfile_doc(asset_doc, task_name, filename, workdir, dbcon=None):
dbcon (AvalonMongoDB): Optionally enter avalon AvalonMongoDB object and
`legacy_io` is used if not entered.
"""
from openpype.pipeline import Anatomy
# Use legacy_io if dbcon is not entered
if not dbcon:
dbcon = legacy_io
@ -1676,6 +1681,7 @@ def _get_task_context_data_for_anatomy(
"""
if anatomy is None:
from openpype.pipeline import Anatomy
anatomy = Anatomy(project_doc["name"])
asset_name = asset_doc["name"]
@ -1744,6 +1750,7 @@ def get_custom_workfile_template_by_context(
"""
if anatomy is None:
from openpype.pipeline import Anatomy
anatomy = Anatomy(project_doc["name"])
# get project, asset, task anatomy context data

View file

@ -9,7 +9,6 @@ import platform
from openpype.client import get_project
from openpype.settings import get_project_settings
from .anatomy import Anatomy
from .profiles_filtering import filter_profiles
log = logging.getLogger(__name__)
@ -227,6 +226,7 @@ def fill_paths(path_list, anatomy):
def create_project_folders(basic_paths, project_name):
from openpype.pipeline import Anatomy
anatomy = Anatomy(project_name)
concat_paths = concatenate_splitted_paths(basic_paths, anatomy)