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

General: Direct settings imports #3934

Merged
merged 4 commits into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions openpype/hosts/flame/api/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

from Qt import QtCore, QtWidgets

import openpype.api as openpype
import qargparse
from openpype import style
from openpype.settings import get_current_project_settings
from openpype.lib import Logger
from openpype.pipeline import LegacyCreator, LoaderPlugin

Expand Down Expand Up @@ -306,7 +306,7 @@ class Creator(LegacyCreator):

def __init__(self, *args, **kwargs):
super(Creator, self).__init__(*args, **kwargs)
self.presets = openpype.get_current_project_settings()[
self.presets = get_current_project_settings()[
"flame"]["create"].get(self.__class__.__name__, {})

# adding basic current context flame objects
Expand Down
4 changes: 2 additions & 2 deletions openpype/hosts/hiero/api/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from Qt import QtWidgets, QtCore
import qargparse

import openpype.api as openpype
from openpype.settings import get_current_project_settings
from openpype.lib import Logger
from openpype.pipeline import LoaderPlugin, LegacyCreator
from openpype.pipeline.context_tools import get_current_project_asset
Expand Down Expand Up @@ -606,7 +606,7 @@ class Creator(LegacyCreator):
def __init__(self, *args, **kwargs):
super(Creator, self).__init__(*args, **kwargs)
import openpype.hosts.hiero.api as phiero
self.presets = openpype.get_current_project_settings()[
self.presets = get_current_project_settings()[
"hiero"]["create"].get(self.__class__.__name__, {})

# adding basic current context resolve objects
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/maya/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
get_last_versions,
get_representation_by_name
)
from openpype.api import get_anatomy_settings
from openpype.settings import get_anatomy_settings
from openpype.pipeline import (
legacy_io,
discover_loader_plugins,
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/maya/api/lib_rendersettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import sys

from openpype.lib import Logger
from openpype.api import (
from openpype.settings import (
get_project_settings,
get_current_project_settings
)
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/maya/plugins/create/create_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from maya import cmds
from maya.app.renderSetup.model import renderSetup

from openpype.api import (
from openpype.settings import (
get_system_settings,
get_project_settings,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Creator for Unreal Static Meshes."""
from openpype.hosts.maya.api import plugin, lib
from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.pipeline import legacy_io
from maya import cmds # noqa

Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/maya/plugins/create/create_vrayscene.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
lib,
plugin
)
from openpype.api import (
from openpype.settings import (
get_system_settings,
get_project_settings
)
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/maya/plugins/load/load_ass.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import clique

from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.pipeline import (
load,
get_representation_path
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/maya/plugins/load/load_gpucache.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
load,
get_representation_path
)
from openpype.api import get_project_settings
from openpype.settings import get_project_settings


class GpuCacheLoader(load.LoaderPlugin):
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/maya/plugins/load/load_redshift_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import maya.cmds as cmds

from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.pipeline import (
load,
get_representation_path
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/maya/plugins/load/load_reference.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from maya import cmds

from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.pipeline import legacy_io
from openpype.pipeline.create import (
legacy_create,
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/maya/plugins/load/load_vdb_to_arnold.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.pipeline import (
load,
get_representation_path
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/maya/plugins/load/load_vdb_to_redshift.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.pipeline import (
load,
get_representation_path
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/maya/plugins/load/load_vdb_to_vray.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os

from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.pipeline import (
load,
get_representation_path
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/maya/plugins/load/load_vrayproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import maya.cmds as cmds

from openpype.client import get_representation_by_name
from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.pipeline import (
legacy_io,
load,
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/maya/plugins/load/load_vrayscene.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import os
import maya.cmds as cmds # noqa
from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.pipeline import (
load,
get_representation_path
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/maya/plugins/load/load_yeti_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import clique
from maya import cmds

from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.pipeline import (
load,
get_representation_path
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/maya/plugins/load/load_yeti_rig.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from collections import defaultdict

from openpype.api import get_project_settings
from openpype.settings import get_project_settings
import openpype.hosts.maya.api.plugin
from openpype.hosts.maya.api import lib

Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/maya/plugins/publish/submit_maya_muster.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from openpype.lib import requests_post
from openpype.hosts.maya.api import lib
from openpype.pipeline import legacy_io
from openpype.api import get_system_settings
from openpype.settings import get_system_settings


# mapping between Maya renderer names and Muster template ids
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/maya/startup/userSetup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.pipeline import install_host
from openpype.hosts.maya.api import MayaHost
from maya import cmds
Expand Down
4 changes: 1 addition & 3 deletions openpype/hosts/nuke/api/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
import pyblish.api

import openpype
from openpype.api import (
get_current_project_settings
)
from openpype.settings import get_current_project_settings
from openpype.lib import register_event_callback, Logger
from openpype.pipeline import (
register_loader_plugin_path,
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/nuke/api/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import nuke

from openpype.api import get_current_project_settings
from openpype.settings import get_current_project_settings
from openpype.pipeline import (
LegacyCreator,
LoaderPlugin,
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/resolve/api/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ class Creator(LegacyCreator):

def __init__(self, *args, **kwargs):
super(Creator, self).__init__(*args, **kwargs)
from openpype.api import get_current_project_settings
from openpype.settings import get_current_project_settings
resolve_p_settings = get_current_project_settings().get("resolve")
self.presets = {}
if resolve_p_settings:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
from openpype.lib import Logger
from openpype.api import get_project_settings
from openpype.settings import get_project_settings

log = Logger.get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/tvpaint/api/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from openpype.client import get_project, get_asset_by_name
from openpype.hosts import tvpaint
from openpype.api import get_current_project_settings
from openpype.settings import get_current_project_settings
from openpype.lib import register_event_callback
from openpype.pipeline import (
legacy_io,
Expand Down
2 changes: 1 addition & 1 deletion openpype/hosts/unreal/plugins/load/load_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
legacy_io,
)
from openpype.pipeline.context_tools import get_current_project_asset
from openpype.api import get_current_project_settings
from openpype.settings import get_current_project_settings
from openpype.hosts.unreal.api import plugin
from openpype.hosts.unreal.api import pipeline as unreal_pipeline

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
tool_definitions_from_app_manager
)

from openpype.api import get_system_settings
from openpype.settings import get_system_settings
from openpype.lib import ApplicationManager

"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os

import ftrack_api
from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.lib import PostLaunchHook


Expand Down
2 changes: 1 addition & 1 deletion openpype/modules/job_queue/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

import click
from openpype.modules import OpenPypeModule
from openpype.api import get_system_settings
from openpype.settings import get_system_settings


class JobQueueModule(OpenPypeModule):
Expand Down
2 changes: 1 addition & 1 deletion openpype/modules/kitsu/utils/update_zou_with_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
get_assets,
)
from openpype.pipeline import AvalonMongoDB
from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.modules.kitsu.utils.credentials import validate_credentials


Expand Down
2 changes: 1 addition & 1 deletion openpype/modules/shotgrid/lib/settings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from openpype.api import get_system_settings, get_project_settings
from openpype.settings import get_system_settings, get_project_settings
from openpype.modules.shotgrid.lib.const import MODULE_NAME


Expand Down
5 changes: 4 additions & 1 deletion openpype/plugins/publish/collect_settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
from pyblish import api
from openpype.api import get_current_project_settings, get_system_settings
from openpype.settings import (
get_current_project_settings,
get_system_settings,
)


class CollectSettings(api.ContextPlugin):
Expand Down
2 changes: 1 addition & 1 deletion openpype/tools/creator/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from openpype.client import get_asset_by_name, get_subsets
from openpype import style
from openpype.api import get_current_project_settings
from openpype.settings import get_current_project_settings
from openpype.tools.utils.lib import qt_app_context
from openpype.pipeline import legacy_io
from openpype.pipeline.create import (
Expand Down
2 changes: 1 addition & 1 deletion openpype/tools/pyblish_pype/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from . import util
from .constants import InstanceStates

from openpype.api import get_project_settings
from openpype.settings import get_project_settings
iLLiCiTiT marked this conversation as resolved.
Show resolved Hide resolved


class IterationBreak(Exception):
Expand Down
2 changes: 1 addition & 1 deletion openpype/tools/pyblish_pype/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from six import text_type
from .constants import PluginStates, InstanceStates, GroupStates, Roles

from openpype.api import get_system_settings
from openpype.settings import get_system_settings


# ItemTypes
Expand Down
8 changes: 4 additions & 4 deletions openpype/tools/settings/local_settings/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

from openpype import style

from openpype.settings import (
SystemSettings,
ProjectSettings
)
from openpype.settings.lib import (
get_local_settings,
save_local_settings
)
from openpype.lib import Logger
from openpype.tools.settings import CHILD_OFFSET
from openpype.tools.utils import MessageOverlayObject
from openpype.api import (
SystemSettings,
ProjectSettings
)
from openpype.modules import ModulesManager

from .widgets import (
Expand Down
2 changes: 1 addition & 1 deletion openpype/tools/utils/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
)
from openpype.resources import get_image_path
from openpype.lib import filter_profiles, Logger
from openpype.api import get_project_settings
from openpype.settings import get_project_settings
from openpype.pipeline import registered_host

log = Logger.get_logger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion openpype/widgets/password_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from openpype import style
from openpype.resources import get_resource

from openpype.api import get_system_settings
from openpype.settings import get_system_settings
from openpype.settings.lib import (
get_local_settings,
save_local_settings
Expand Down